
    	z]1                     :    d Z dZddlmZ ddlmZ  G d de      Zy))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                 2    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__+   s%    " VS)#w8H/+ 	+    c                 0    i | _         g | _        	 g | _        y N)_Server__connectionson_connection_addedon_connection_removed)selfargskwargss      r   __init__zServer.__init__?   s'    #% 	K &("	r   c                 \    |j                  | j                         | j                  |       y r   )call_on_disconnectionconnection_removedconnection_added)r   conns     r   _on_new_connectionzServer._on_new_connectionN   s$    ""4#:#:;d#r   c                 P    | j                   r| j                   D ]
  } ||        yy)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   s.     ##.. 4 $r   c                 P    | j                   r| j                   D ]
  } ||        yy)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   s.     %%0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+($"" G//0GGNN+BG445Lr   r   N)__all____docformat___dbus_bindingsr   dbus.connectionr   r    r   r   <module>r6      s%   4 " " &V6W V6r   