ó
§Zc           @   s3  d  d l  m Z m Z d  d l m Z d d l m Z d d l Z e d ƒ Z g  Z	 d e j
 f d „  ƒ  YZ
 e e
 ƒ Z
 e	 j d ƒ d	 e j f d
 „  ƒ  YZ e e ƒ Z e	 j d	 ƒ d e j f d „  ƒ  YZ e e ƒ Z e	 j d ƒ d d d „  ƒ  YZ d e j f d „  ƒ  YZ e e ƒ Z e	 j d ƒ d S(   i   (   t   overridet   deprecated_init(   t   get_introspection_moduleiÿÿÿÿ(   t   GLibNt   Giot   FileEnumeratorc           B   s    e  Z d  „  Z d „  Z e Z RS(   c         C   s   |  S(   N(    (   t   self(    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __iter__"   s    c         C   s)   |  j  d  ƒ } | d  k	 r | St ‚ d  S(   N(   t	   next_filet   Nonet   StopIteration(   R   t	   file_info(    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __next__%   s    (   t   __name__t
   __module__R   R   t   next(    (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyR   !   s   			t   MenuItemc           B   s   e  Z d  „  Z RS(   c         C   s:   x3 | D]+ \ } } } |  j  | t j | | ƒ ƒ q Wd  S(   N(   t   set_attribute_valueR   t   Variant(   R   t
   attributest   namet   format_stringt   value(    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   set_attribute6   s    (   R   R   R   (    (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyR   5   s   t   Settingsc           B   sb   e  Z d  Z e e j j d d ƒZ d „  Z d „  Z d „  Z	 e	 Z
 d „  Z d	 „  Z d
 „  Z RS(   s0   Provide dictionary-like access to GLib.Settings.t	   arg_namest   schemat   patht   backendc         C   s   | |  j  ƒ  k S(   N(   t	   list_keys(   R   t   key(    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __contains__E   s    c         C   s   t  |  j ƒ  ƒ S(   N(   t   lenR   (   R   (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __len__H   s    c         C   s   t  S(   N(   t   True(   R   (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __bool__K   s    c         C   s5   | |  k r" t  d | f ƒ ‚ n  |  j | ƒ j ƒ  S(   Ns   unknown key: %r(   t   KeyErrort	   get_valuet   unpack(   R   R   (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __getitem__S   s    c         C   s  | |  k r" t  d | f ƒ ‚ n  |  j | ƒ } | j d ƒ j ƒ  } | j d ƒ } | d k rƒ | j d ƒ j ƒ  } | d } nt | d k rá | j d ƒ j d ƒ j ƒ  } | j ƒ  } | | k r÷ t d | | f ƒ ‚ q÷ n t d t | ƒ ƒ ‚ |  j	 | t
 j | | ƒ ƒ d  S(   Ns   unknown key: %ri    i   t   typet   enums$   value %s is not an allowed enum (%s)s'   Cannot handle allowed type range class (   R$   t	   get_ranget   get_child_valuet
   get_stringt   get_type_stringR&   t
   ValueErrort   NotImplementedErrort   strt	   set_valueR   R   (   R   R   R   t   ranget   type_t   vt   type_strt   allowed(    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __setitem__Z   s    c         C   s
   |  j  ƒ  S(   N(   R   (   R   (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   keyst   s    (   R   s   pathR   (   R   R   t   __doc__R   R   R   t   __init__R   R!   R#   t   __nonzero__R'   R7   R8   (    (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyR   ?   s   						t   _DBusProxyMethodCallc           B   s8   e  Z d  Z d „  Z d „  Z d „  Z e d „  ƒ Z RS(   s1   Helper class to implement DBusProxy method calls.c         C   s   | |  _  | |  _ d  S(   N(   t
   dbus_proxyt   method_name(   R   R=   R>   (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyR:   ~   s    	c   
      C   s“   | \ } } } y | j  | ƒ } WnQ t k
 ru t j ƒ  d  \ } }	 | ra | | |	 | ƒ n | | |	 | ƒ d  SX| | |  j | ƒ | ƒ d  S(   Ni   (   t   call_finisht	   Exceptiont   syst   exc_infot   _unpack_result(
   R   t   objt   resultt	   user_datat   result_callbackt   error_callbackt   real_user_datat   rett   etypet   e(    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __async_result_handler‚   s    c         O   s  | r? | d } | d } t  | t ƒ sE t d | ƒ ‚ qE n d } t j | t | ƒ ƒ } d | k rÑ | d | j d ƒ | j d ƒ f } |  j j |  j	 | | j d d ƒ | j d	 d
 ƒ d  |  j | ƒ nF |  j j |  j	 | | j d d ƒ | j d	 d
 ƒ d  ƒ } |  j | ƒ Sd  S(   Ni    i   s6   first argument must be the method signature string: %rs   ()t   result_handlert   error_handlerRF   t   flagst   timeoutiÿÿÿÿ(   t
   isinstanceR0   t	   TypeErrorR   R   t   tuplet   getR=   t   callR>   R	   t*   _DBusProxyMethodCall__async_result_handlert	   call_syncRC   (   R   t   argst   kwargst	   signaturet   arg_variantRF   RE   (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __call__‘   s&    

!	c         C   sJ   | j  ƒ  } t | ƒ d k r+ | d } n t | ƒ d k rF d } n  | S(   s?   Convert a D-BUS return variant into an appropriate return valuei   i    N(   R&   R    R	   (   t   klassRE   (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyRC   ®   s    	(   R   R   R9   R:   RW   R]   t   classmethodRC   (    (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyR<   {   s
   			t	   DBusProxyc           B   s   e  Z d  Z d „  Z RS(   s$  Provide comfortable and pythonic method calls.

    This marshalls the method arguments into a GVariant, invokes the
    call_sync() method on the DBusProxy object, and unmarshalls the result
    GVariant back into a Python tuple.

    The first argument always needs to be the D-Bus signature tuple of the
    method call. Example:

      proxy = Gio.DBusProxy.new_sync(...)
      result = proxy.MyMethod('(is)', 42, 'hello')

    The exception are methods which take no arguments, like
    proxy.MyMethod('()'). For these you can omit the signature and just write
    proxy.MyMethod().

    Optional keyword arguments:

    - timeout: timeout for the call in milliseconds (default to D-Bus timeout)

    - flags: Combination of Gio.DBusCallFlags.*

    - result_handler: Do an asynchronous method call and invoke
         result_handler(proxy_object, result, user_data) when it finishes.

    - error_handler: If the asynchronous call raises an exception,
      error_handler(proxy_object, exception, user_data) is called when it
      finishes. If error_handler is not given, result_handler is called with
      the exception object as result instead.

    - user_data: Optional user data to pass to result_handler for
      asynchronous calls.

    Example for asynchronous calls:

      def mymethod_done(proxy, result, user_data):
          if isinstance(result, Exception):
              # handle error
          else:
              # do something with result

      proxy.MyMethod('(is)', 42, 'hello',
          result_handler=mymethod_done, user_data='data')
    c         C   s   t  |  | ƒ S(   N(   R<   (   R   R   (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   __getattr__ë   s    (   R   R   R9   Ra   (    (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyR`   ¾   s   ,(    (   t	   overridesR    R   t   moduleR   t   gi.repositoryR   RA   R   t   __all__R   t   appendR   R   R<   R`   (    (    (    s6   /usr/lib64/python2.7/site-packages/gi/overrides/Gio.pyt   <module>   s$   8C0