
    	z]1                     B    d Z dZddlmZ ddlmZ  G d de          ZdS ))ServerreStructuredText    )_Server)
Connectionc                        e Zd ZdZeddf fd	Zd Zd Zd Zd Z	 e
ej                  Z e
ej                  Z e
ej                  Z xZS )r   a%  An opaque object representing a server that listens for connections from
    other applications.

    This class is not useful to instantiate directly: you must subclass it and
    either extend the method connection_added, or append to the
    list on_connection_added.

    :Since: 0.83
    Nc                 \    t          t          |                               | ||||          S )a  Construct a new Server.

        :Parameters:
            `address` : str
                Listen on this address.
            `connection_class` : type
                When new connections come in, instantiate this subclass
                of dbus.connection.Connection to represent them.
                The default is Connection.
            `mainloop` : dbus.mainloop.NativeMainLoop or None
                The main loop with which to associate the new connections.
            `auth_mechanisms` : sequence of str
                Authentication mechanisms to allow. The default is to allow
                any authentication mechanism supported by ``libdbus``.
        )superr   __new__)clsaddressconnection_classmainloopauth_mechanisms	__class__s        -/usr/lib/python3/dist-packages/dbus/server.pyr
   zServer.__new__+   s3    " VS!!))#w8H/+ + 	+    c                 2    i | _         g | _        	 g | _        d S N)_Server__connectionson_connection_addedon_connection_removed)selfargskwargss      r   __init__zServer.__init__?   s,    #% 	K &("	 	r   c                 d    |                     | j                   |                     |           d S r   )call_on_disconnectionconnection_removedconnection_added)r   conns     r   _on_new_connectionzServer._on_new_connectionN   s3    ""4#:;;;d#####r   c                 B    | j         r| j         D ]} ||           dS dS )a  Respond to the creation of a new Connection.

        This base-class implementation just invokes the callbacks in
        the on_connection_added attribute.

        :Parameters:
            `conn` : dbus.connection.Connection
                A D-Bus connection which has just been added.

                The type of this parameter is whatever was passed
                to the Server constructor as the ``connection_class``.
        N)r   r   r    cbs      r   r   zServer.connection_addedR   sD     # 	.  4	 	 r   c                 B    | j         r| j         D ]} ||           dS dS )a  Respond to the disconnection of a Connection.

        This base-class implementation just invokes the callbacks in
        the on_connection_removed attribute.

        :Parameters:
            `conn` : dbus.connection.Connection
                A D-Bus connection which has just become disconnected.

                The type of this parameter is whatever was passed
                to the Server constructor as the ``connection_class``.
        N)r   r#   s      r   r   zServer.connection_removedc   sD     % 	0  4	 	 r   )__name__
__module____qualname____doc__r   r
   r   r!   r   r   propertyr   get_addressr   get_ididget_is_connectedis_connected__classcell__)r   s   @r   r   r       s          0:t+ + + + + +(  $ $ $  "  " 8G/00G8GN++B8G455LLLLLr   r   N)__all____docformat___dbus_bindingsr   dbus.connectionr   r    r   r   <module>r6      ss   4 " " " " " " " & & & & & &V6 V6 V6 V6 V6W V6 V6 V6 V6 V6r   