관리-도구
편집 파일: pluginopts.cpython-38.pyc
U )�e � @ s� d Z ddlZz,ddlmZmZ ddlmZ ddlmZ W n e k rL Y nX ddl mZ ddlm Z ddlmZ dd lmZ dd lmZ ddlmZ dd � Zdd� ZG dd� de�ZG dd� 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 C s$ |d } t | �} |�dd �}|r,t| |�}nBt| �D ]8} t| | �}t|�r4t|t�r4|tk r4d| | f } qnq4t� }|�d| d� |�dd� |�dd� |�dd� |�dd� |� }t � }|� |i � |D ]B}|�|� � d� |�d d� |�d |j d d� |�dd� q�|�dd� |�d d� |�dd� |�d| d� |�dd� |�dd� |�dd� |�dd� |�d d� |�dt� |jd tj�| 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 � <autodoc>� �Options�-------� � � r z------z.. autoclass :: %s z :members: z :show-inheritance: ZSourcez.. include :: %s �sourcez.pycz.pyz :literal: � �Zmatch_titles)r �get�getattr�dirr � issubclassr r �append� OptBucket�options�helpr � 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_machine�mod_name�modZ plug_name�obj�entry�rstZplug�opts�opt�node�surrounding_title_styles�surrounding_section_level� r>