%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/nose/sphinx/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/nose/sphinx/__pycache__/pluginopts.cpython-37.pyc

B

k�6S�@s�dZddlZy,ddlmZmZddlmZddlmZWne	k
rLYnXddl
mZddlm
Z
ddlmZdd	lmZdd
lmZddlmZdd
�Zdd�ZGdd�de�ZGdd�de�Zdd�ZdS)a�
Adds a sphinx directive that can be used to automatically document a plugin.

this::

 .. autoplugin :: nose.plugins.foo
    :plugin: Pluggy
    
produces::

  .. automodule :: nose.plugins.foo
  
  Options
  -------

  .. cmdoption :: --foo=BAR, --fooble=BAR

    Do the foo thing to the new thing.

  Plugin
  ------

  .. autoclass :: nose.plugins.foo.Pluggy
     :members:

  Source
  ------

  .. include :: path/to/nose/plugins/foo.py
     :literal:

�N)�nodes�utils)�ViewList)�
directives)�resolve_name)�Plugin)�BuiltinPluginManager)�Config)�TestProgram)�isclassc	Cs*|d}	t|	�}
|�dd�}|r,t|
|�}nDxBt|
�D]6}
t|
|
�}t|�r6t|t�r6|tk	r6d|	|
f}Pq6Wt�}|�d|	d�|�dd�|�dd�|�dd�|�dd�|�}t	�}|�
|i�xJ|D]B}|�|�
�d�|�d	d�|�d
|jdd�|�dd�q�W|�dd�|�d
d�|�dd�|�d|d�|�dd�|�dd�|�dd�|�dd�|�d
d�|�dt�
|jdtj�|
j�dd���d�|�dd�|�dd�t��}|j|_|jj}|jj}g|j_d|j_|j|d|dd�||j_||j_|jS)Nr�pluginz%s.%sz.. automodule :: %s
z	<autodoc>��Optionsz-------z   
z   �
rz------z.. autoclass :: %s
z
   :members:
z   :show-inheritance:
ZSourcez.. include :: %s
�sourcez.pycz.pyz
   :literal:
�)�match_titles)r�get�getattr�dirr�
issubclassrr�append�	OptBucket�options�helprZ
relative_path�document�os�path�abspath�__file__�replacer�section�memo�title_styles�
section_level�nested_parse�children)�dirname�	argumentsr�content�lineno�content_offset�
block_text�state�
state_machineZmod_name�modZ	plug_name�obj�entry�rstZplug�opts�opt�node�surrounding_title_styles�surrounding_section_level�r8�G/opt/alt/python37/lib/python3.7/site-packages/nose/sphinx/pluginopts.py�autoplugin_directive1sd

r:c	Csttt�d�}	|	�t���}
t�}x"|
���d�D]}|�	|d�q2W|�	dd�|�	dd�|�	dd�xJ|
D]B}
|�	|
�
�d�|�	dd�|�	d|
jdd�|�	dd�qpWt�
�}|j|_|jj}|jj}g|j_d	|j_|j|d	|d
d�||j_||j_|jS)zproduces rst from nose help)ZparserClassZpluginsrz	<autodoc>rz-------r
z   
z   rr)r)r	rrZ	getParserr
Zusager�format_help�splitrrrrr!rr"r#r$r%r&)r'r(rr)r*r+r,r-r.Zconfig�parserr2�liner4r5r6r7r8r8r9�autohelp_directivets0

r?c@s.eZdZddd�Zdd�Zdd�Zd	d
�ZdS)rN�	nosetestscCsg|_||_||_dS)N)r3�doc�prog)�selfrArBr8r8r9�__init__�szOptBucket.__init__cCs
t|j�S)N)�iterr3)rCr8r8r9�__iter__�szOptBucket.__iter__cCs|j�d|j��dd�S)Nz%progz:
z::
)rAr rB)rCr8r8r9r;�szOptBucket.format_helpcOs|j�t||��dS)N)r3r�Opt)rC�arg�kwr8r8r9�
add_option�szOptBucket.add_option)Nr@)�__name__�
__module__�__qualname__rDrFr;rJr8r8r8r9r�s
rc@s$eZdZdd�Zdd�Zdd�ZdS)rGcOsB||_|�dd�|_|�dd�|_|�dd�|_|�dd�|_dS)N�action�default�metavarr)r3�poprNrOrPr)rCrHrIr8r8r9rD�s
zOpt.__init__cCsLg}x8|jD].}|}|jdkr0|d|�|�7}|�|�qWdd�|�S)N)�
store_trueZstore_falsez=%sz.. cmdoption :: z, )r3rN�metar�join)rCZbuf�	optstringZdescr8r8r9r�s
zOpt.optionscCs
|jpdS)NZDEFAULT)rP)rCrUr8r8r9rS�szOpt.metaN)rKrLrMrDrrSr8r8r8r9rG�s	rGcCs*|jdtddtjd�|�dtdd�dS)NZ
autopluginr)rrr)rZautohelpr)rrr)Z
add_directiver:rZ	unchangedr?)Zappr8r8r9�setup�s
rV)�__doc__rZdocutilsrrZdocutils.statemachinerZdocutils.parsers.rstr�ImportErrorZ	nose.utilrZnose.plugins.baserZnose.plugins.managerrZnose.configr	Z	nose.corer
�inspectrr:r?�objectrrGrVr8r8r8r9�<module> s$C

Zerion Mini Shell 1.0