509318396
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
iRÛVd"  ã               @   sÔ   d Z ddlmZ dZdZddlmZ dd	lmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZ dd
lmZ ddlmZ ddlmZ er�ddlmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )z9Implementation for dbus.Bus. Not to be imported directly.é    )Ú
generatorsÚBusÚ	SystemBusÚ
SessionBusÚ
StarterBusZreStructuredText)ÚDBusException)ÚBUS_DAEMON_IFACEÚBUS_DAEMON_NAMEÚBUS_DAEMON_PATHÚBUS_SESSIONÚBUS_STARTERÚ
BUS_SYSTEMÚ DBUS_START_REPLY_ALREADY_RUNNINGÚDBUS_START_REPLY_SUCCESSÚvalidate_bus_nameÚvalidate_interface_nameÚvalidate_member_nameÚvalidate_object_path)ÚBusConnection)ÚSignalMessage)Úis_py2)Ú
UTF8Stringc                   sŽ   e Zd ZdZi Zejddfdd„Z‡ fdd„Zdd	„ Z	e
e	ddd
ƒZddd„ZeeƒZddd„ZeeƒZddd„ZeeƒZdd„ ZeZ‡  ZS )r   a   A connection to one of three possible standard buses, the SESSION,
    SYSTEM, or STARTER bus. This class manages shared connections to those
    buses.

    If you're trying to subclass `Bus`, you may be better off subclassing
    `BusConnection`, which doesn't have all this magic.
    FNc             C   sx   | r|| j kr| j | S |tkr(t}n(|tkr6t}n|tkrDt}ntd| ƒ‚tj	|||d�}||_
|st|| j |< |S )aË  Constructor, returning an existing instance where appropriate.

        The returned instance is actually always an instance of `SessionBus`,
        `SystemBus` or `StarterBus`.

        :Parameters:
            `bus_type` : cls.TYPE_SESSION, cls.TYPE_SYSTEM or cls.TYPE_STARTER
                Connect to the appropriate bus
            `private` : bool
                If true, never return an existing shared instance, but instead
                return a private connection.

                :Deprecated: since 0.82.3. Use dbus.bus.BusConnection for
                    private connections.

            `mainloop` : dbus.mainloop.NativeMainLoop
                The main loop to use. The default is to use the default
                main loop if one has been set up, or raise an exception
                if none has been.
        :Changed: in dbus-python 0.80:
            converted from a wrapper around a Connection to a Connection
            subclass.
        zinvalid bus_type %s)Úmainloop)Ú_shared_instancesr   r   r   r   r   r   Ú
ValueErrorr   Ú__new__Ú	_bus_type)ÚclsZbus_typeÚprivater   ÚsubclassZbus© r    ú/usr/lib64/python3.6/_dbus.pyr   :   s    

zBus.__new__c                s4   | j }| jjj|ƒ| kr"| jj|= tt| ƒjƒ  d S )N)r   Ú	__class__r   ÚgetÚsuperr   Úclose)ÚselfÚt)r"   r    r!   r%   m   s    
z	Bus.closec             C   s   | S )zªReturn self, for backwards compatibility with earlier dbus-python
        versions where Bus was not a subclass of Connection.

        :Deprecated: since 0.80.0
        r    )r&   r    r    r!   Úget_connections   s    zBus.get_connectionz¹self._connection == self, for backwards
                           compatibility with earlier dbus-python versions
                           where Bus was not a subclass of Connection.c             C   s
   t | d�S )z³Static method that returns a connection to the session bus.

        :Parameters:
            `private` : bool
                If true, do not return a shared connection.
        )r   )r   )r   r    r    r!   Úget_session   s    zBus.get_sessionc             C   s
   t | d�S )z²Static method that returns a connection to the system bus.

        :Parameters:
            `private` : bool
                If true, do not return a shared connection.
        )r   )r   )r   r    r    r!   Ú
get_systemŠ   s    zBus.get_systemc             C   s
   t | d�S )z³Static method that returns a connection to the starter bus.

        :Parameters:
            `private` : bool
                If true, do not return a shared connection.
        )r   )r   )r   r    r    r!   Úget_starter–   s    zBus.get_starterc             C   sP   | j tkrd}n$| j tkr d}n| j tkr0d}nd}d| jj| jj|t| ƒf S )NZsessionÚsystemZstarterzunknown bus typez<%s.%s (%s) at %#x>)r   r   r   r   r"   Ú
__module__Ú__name__Úid)r&   Únamer    r    r!   Ú__repr__¡   s    


zBus.__repr__)F)F)F)r.   r-   Ú__qualname__Ú__doc__r   r   ÚTYPE_SESSIONr   r%   r(   ÚpropertyZ_connectionr)   Ústaticmethodr*   r+   r1   Ú__str__Ú__classcell__r    r    )r"   r!   r   /   s    2
	
	
	c               @   s   e Zd ZdZddd„ZdS )r   zThe system-wide message bus.FNc             C   s   t j| t j||d�S )aÆ  Return a connection to the system bus.

        :Parameters:
            `private` : bool
                If true, never return an existing shared instance, but instead
                return a private connection.
            `mainloop` : dbus.mainloop.NativeMainLoop
                The main loop to use. The default is to use the default
                main loop if one has been set up, or raise an exception
                if none has been.
        )r   r   )r   r   ZTYPE_SYSTEM)r   r   r   r    r    r!   r   µ   s    zSystemBus.__new__)FN)r.   r-   r2   r3   r   r    r    r    r!   r   ³   s   c               @   s   e Zd ZdZddd„ZdS )r   z(The session (current login) message bus.FNc             C   s   t j| t j||d�S )aÇ  Return a connection to the session bus.

        :Parameters:
            `private` : bool
                If true, never return an existing shared instance, but instead
                return a private connection.
            `mainloop` : dbus.mainloop.NativeMainLoop
                The main loop to use. The default is to use the default
                main loop if one has been set up, or raise an exception
                if none has been.
        )r   r   )r   r   r4   )r   r   r   r    r    r!   r   Æ   s    zSessionBus.__new__)FN)r.   r-   r2   r3   r   r    r    r    r!   r   Ä   s   c               @   s   e Zd ZdZddd„ZdS )r   zjThe bus that activated this process (only valid if
    this process was launched by DBus activation).
    FNc             C   s   t j| t j||d�S )aÛ  Return a connection to the bus that activated this process.

        :Parameters:
            `private` : bool
                If true, never return an existing shared instance, but instead
                return a private connection.
            `mainloop` : dbus.mainloop.NativeMainLoop
                The main loop to use. The default is to use the default
                main loop if one has been set up, or raise an exception
                if none has been.
        )r   r   )r   r   ZTYPE_STARTER)r   r   r   r    r    r!   r   Ù   s    zStarterBus.__new__)FN)r.   r-   r2   r3   r   r    r    r    r!   r   Õ   s   N)r   r   r   r   )r3   Z
__future__r   Ú__all__Z__docformat__Zdbus.exceptionsr   Z_dbus_bindingsr   r	   r
   r   r   r   r   r   r   r   r   r   Zdbus.busr   Zdbus.lowlevelr   Zdbus._compatr   r   r   r   r   r   r    r    r    r!   Ú<module>   s   8 