ó
ćŻSc           @   sŔ   d  Z  d d l Z d d l m Z e e d  e d d d e j k r] d d l m Z	 n d d l	 Z	 d d l
 Z d	 e	 j 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˙˙˙˙N(   t   warnsŕ   dbus.gobject_service is deprecated, and is not available under Python 3.

Porting from gobject (PyGObject 2) to gi.repository.GObject (PyGObject 3),
and using dbus.gi_service instead of dbus.gobject_service, is recommended.
t
   stackleveli   t   gi(   t   GObjectt   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   s<   t  j j j |  | | |  t j j j |  | | |  d  S(   N(   t   gobjectR   t	   __class__t   __init__t   dbust   servicet   InterfaceType(   t   clst   namet   basest   dct(    (    s:   /usr/lib64/python2.7/site-packages/dbus/gobject_service.pyR   /   s    (   t   __name__t
   __module__t   __doc__R   (    (    (    s:   /usr/lib64/python2.7/site-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   R   R   R   R	   t   Object(   t   selfR   R   t   kwargsR   R   (    (    s:   /usr/lib64/python2.7/site-packages/dbus/gobject_service.pyR   =   s    N(   R   R   R   R   t   __metaclass__R   R   (    (    (    s:   /usr/lib64/python2.7/site-packages/dbus/gobject_service.pyR   3   s   (   R   t   syst   warningsR    t   _warnt   DeprecationWarningt   modulest   gi.repositoryR   R   t   dbus.serviceR   R   R	   R
   R   R   R   (    (    (    s:   /usr/lib64/python2.7/site-packages/dbus/gobject_service.pyt   <module>   s   %