View file File name : docstring.cpython-36.opt-1.pyc Content :3 ��<_ � , @ s� d dl mZmZmZmZmZmZmZ dadd� Z dd� Z dd� Zeje ejeejeejeejeejeejeejeejeejeejeejeejeejeejeej e!ej"e!ej#e!ej$dej%dej&dej'diZ(d d � Z)dd� Z*d d� Z+dd� Z,e e,� dS )� )� VFuncInfo�FunctionInfo�CallableInfo� ObjectInfo� StructInfo� Direction�TypeTagNc C s | a dS )z�Set doc string generator function :param callable func: Callable which takes a GIInfoStruct and returns documentation for it. N)�_generate_doc_string_func)�func� r �!/usr/lib64/python3.6/docstring.py�set_doc_string_generator% s r c C s t S )z6Returns the currently registered doc string generator.)r r r r r �get_doc_string_generator/ s r c C s t | �S )aE 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 )�infor r r �generate_doc_string4 s r c C sf | j � }tj|d �}|r(t|d�r(|jS |tjkr^| j� }|j� }|sN| j � S d|j � |f S | j � S )N�__name__z%s.%s)Zget_tag�_type_tag_to_py_type�get�hasattrr r � INTERFACEZ get_interface�get_nameZget_tag_as_stringZ get_namespace)Zgi_typeZtype_tagZpy_typeZifaceZ info_namer r r �_get_pytype_hint\ s r c C s g }t | t�rdg}nt | t�r.| j� r.dg}| j� }d }t� }t� }x:|D ]2}|j|j� � |j|j� j � � |j|j � � qLW x�t|�D ]�\}}|j� t jkr�q�||kr�q�|j� }t|j� �} | |kr�|d| 7 }|j� s�||kr�|d7 }n|j� �r|d7 }|j|� q�W dj|�} g }t| j� �}| j� �rf|�rf||k�rf|}| j� �r\|d7 }|j|� xlt|�D ]`\}}|j� t jk�r��qp||k�r��qp|j� }t|j� �} | |k�r�|d| 7 }|j|� �qpW |�r�d| j| dj|�f S d | j| f S d S )N�self�void�:z=Nonez=<optional>z, z or Nonez%s(%s) -> %sz%s(%s))r )� isinstancer r Z is_methodZ get_arguments�set�addZget_destroyZget_typeZget_array_lengthZget_closure� enumerateZ get_directionr ZOUTr r Zmay_be_nullZis_optional�append�joinZget_return_typeZskip_returnZmay_return_null�INr ) r Zin_args_strs�argsZhint_blacklistZignore_indicesZuser_data_indices�arg�iZargstrZhintZin_args_strZ out_args_strsZreturn_hintr r r �_generate_callable_info_docn sb r% c C s� d}d}t | t�r4| j� dkrH|d| j� d 7 }n|d| j� d 7 }x,| j� D ] }|j� rR|dt|� d 7 }qRW |r�|| S dS d S )Nz :Constructors: :: � � z z() z(**properties) � )r r Zget_sizer Zget_methodsZis_constructorr% )r �header�docZmethod_infor r r �_generate_class_info_doc� s r+ c C s, t | ttf�rt| �S t | t�r(t| �S dS )Nr&