๓
งZc           @   si  d  d l  m Z m Z m Z m Z m Z m Z m Z d	 a	 d   Z
 d   Z d   Z i e e j 6e e j 6e e j 6e e j 6e e j 6e e j 6e e j 6e e j 6e e j 6e e j 6e e j 6e e j 6e e j 6e e j 6e e j  6e! e j" 6e! e j# 6e! e j$ 6d	 e j% 6d	 e j& 6d	 e j' 6d	 e j( 6Z) d   Z* d   Z+ d   Z, d   Z- e
 e-  d	 S(
   i   (   t	   VFuncInfot   FunctionInfot   CallableInfot
   ObjectInfot
   StructInfot	   Directiont   TypeTagc         C   s
   |  a  d S(   s   Set doc string generator function

    :param callable func:
        Callable which takes a GIInfoStruct and returns documentation for it.
    N(   t   _generate_doc_string_func(   t   func(    (    s2   /usr/lib64/python2.7/site-packages/gi/docstring.pyt   set_doc_string_generator%   s    c           C   s   t  S(   s6   Returns the currently registered doc string generator.(   R   (    (    (    s2   /usr/lib64/python2.7/site-packages/gi/docstring.pyt   get_doc_string_generator/   s    c         C   s
   t  |   S(   sE  Generate a doc string given a GIInfoStruct.

    :param gi.types.BaseInfo info:
        GI info instance to generate documentation for.
    :returns:
        Generated documentation as a string.
    :rtype: str

    This passes the info struct to the currently registered doc string
    generator and returns the result.
    (   R   (   t   info(    (    s2   /usr/lib64/python2.7/site-packages/gi/docstring.pyt   generate_doc_string4   s    c         C   s   |  j    } t j | d   } | r: t | d  r: | j S| t j k r |  j   } | j	   } | sq |  j
   Sd | j   | f S|  j
   S(   Nt   __name__s   %s.%s(   t   get_tagt   _type_tag_to_py_typet   gett   Nonet   hasattrR   R   t	   INTERFACEt   get_interfacet   get_namet   get_tag_as_stringt   get_namespace(   t   gi_typet   type_tagt   py_typet   ifacet	   info_name(    (    s2   /usr/lib64/python2.7/site-packages/gi/docstring.pyt   _get_pytype_hint\   s    
c         C   sฮ  g  } t  |  t  r! d g } n* t  |  t  rK |  j   rK d g } qK n  |  j   } d
 } t   } t   } xM | D]E } | j | j    | j | j   j	    | j | j
    qv Wxอ t |  D]ฟ \ } } | j   t j k r๓ qฬ n  | | k rqฬ n  | j   } t | j    }	 |	 | k r@| d |	 7} n  | j   sX| | k re| d 7} n | j   r~| d 7} n  | j |  qฬ Wd j |  }
 g  } t |  j    } |  j   r| r| | k r| } |  j   r๔| d 7} n  | j |  n  x t |  D] \ } } | j   t j k r8qn  | | k rJqn  | j   } t | j    }	 |	 | k r| d |	 7} n  | j |  qW| rนd |  j |
 d j |  f Sd	 |  j |
 f Sd  S(   Nt   selft   voidt   :s   =Nones   =<optional>s   , s    or Nones   %s(%s) -> %ss   %s(%s)(   s   void(   t
   isinstanceR    R   t	   is_methodt   get_argumentst   sett   addt   get_destroyt   get_typet   get_array_lengtht   get_closuret	   enumeratet   get_directionR   t   OUTR   R   t   may_be_nullt   is_optionalt   appendt   joint   get_return_typet   skip_returnt   may_return_nullt   INR   (   R   t   in_args_strst   argst   hint_blacklistt   ignore_indicest   user_data_indicest   argt   it   argstrt   hintt   in_args_strt   out_args_strst   return_hint(    (    s2   /usr/lib64/python2.7/site-packages/gi/docstring.pyt   _generate_callable_info_docn   sb    		c         C   sท   d } d } t  |  t  rK |  j   d k rc | d |  j   d 7} qc n | d |  j   d 7} x; |  j   D]- } | j   rp | d t |  d 7} qp qp W| rฏ | | Sd Sd  S(   Ns   
:Constructors:

::

t    i    s       s   ()
s   (**properties)
s   
(   R!   R   t   get_sizeR   t   get_methodst   is_constructorRA   (   R   t   headert   doct   method_info(    (    s2   /usr/lib64/python2.7/site-packages/gi/docstring.pyt   _generate_class_info_docฎ   s    c         C   s<   t  |  t t f  r t |   St  |  t  r8 t |   Sd S(   NRB   (   R!   R   R   RI   R   RA   (   R   (    (    s2   /usr/lib64/python2.7/site-packages/gi/docstring.pyt   _generate_doc_dispatchร   s
    

N(.   t   _giR    R   R   R   R   R   R   R   R   R	   R
   R   t   boolt   BOOLEANt   intt   INT8t   UINT8t   INT16t   UINT16t   INT32t   UINT32t   INT64t   UINT64t   floatt   FLOATt   DOUBLEt   listt   GLISTt   GSLISTt   ARRAYt   dictt   GHASHt   strt   UTF8t   FILENAMEt   UNICHARR   t   GTYPEt   ERRORt   VOIDR   R   RA   RI   RJ   (    (    (    s2   /usr/lib64/python2.7/site-packages/gi/docstring.pyt   <module>   s>   4	
		



















		@		
