ó
æö/Nc           @   sf   d  Z  d d l Z d d l Z d e j e j j f d „  ƒ  YZ d e j e j j	 f d „  ƒ  YZ
 d S(   s:   Support code for implementing D-Bus services via GObjects.iÿÿÿÿNt   ExportedGObjectTypec           B   s   e  Z d  Z d „  Z RS(   sˆ   A metaclass which inherits from both GObjectMeta and
    `dbus.service.InterfaceType`. Used as the metaclass for `ExportedGObject`.
    c         C   s9   t  j j |  | | | ƒ t j j j |  | | | ƒ d  S(   N(   t   gobjectt   GObjectMetat   __init__t   dbust   servicet   InterfaceType(   t   clst   namet   basest   dct(    (    s8   /usr/lib/python2.7/dist-packages/dbus/gobject_service.pyR       s    (   t   __name__t
   __module__t   __doc__R   (    (    (    s8   /usr/lib/python2.7/dist-packages/dbus/gobject_service.pyR       s   t   ExportedGObjectc           B   s#   e  Z d  Z e Z d d d „ Z RS(   s.  A GObject which is exported on the D-Bus.

    Because GObject and `dbus.service.Object` both have custom metaclasses,
    the naive approach using simple multiple inheritance won't work. This
    class has `ExportedGObjectType` as its metaclass, which is sufficient
    to make it work correctly.
    c         K   s|   | j  d d ƒ } | j  d d ƒ } | d k	 r@ | j | ƒ n  t j j |  |  t j j j |  d | d | d | ƒd S(   sn  Initialize an exported GObject.

        :Parameters:
            `conn` : dbus.connection.Connection
                The D-Bus connection or bus
            `object_path` : str
                The object path at which to register this object.
        :Keywords:
            `bus_name` : dbus.service.BusName
                A bus name to be held on behalf of this object, or None.
            `gobject_properties` : dict
                GObject properties to be set on the constructed object.

                Any unrecognised keyword arguments will also be interpreted
                as GObject properties.
            t   bus_namet   gobject_propertiest   connt   object_pathN(	   t   popt   Nonet   updateR   t   GObjectR   R   R   t   Object(   t   selfR   R   t   kwargsR   R   (    (    s8   /usr/lib/python2.7/dist-packages/dbus/gobject_service.pyR   .   s    N(   R   R   R   R    t   __metaclass__R   R   (    (    (    s8   /usr/lib/python2.7/dist-packages/dbus/gobject_service.pyR   $   s   (   R   R   t   dbus.serviceR   R   R   R   R    R   R   R   (    (    (    s8   /usr/lib/python2.7/dist-packages/dbus/gobject_service.pyt   <module>   s   "