B
    A!p\                 @   s  d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	m
Z
 ddlmZ ddlmZ ddlmZ d	ed
dddddddfdeddddg ddfdeddddddfded dd!d"fd#ed$dd%dd&dfd'ed(dd)d"fd*ed+d,d-d.d/fd0ed1dd2d3d4d5fd6ed7d,d-d8d/fd9ed:d;dd<d=d>d?fd@dAdBdCdDdEdFfdGdHddIdJdKdLffZdMdN ZG dOdP dPeZedQkreejdRd  dS )Sz[
  %prog [options] <packages>

  create UML diagrams for classes and modules in <packages>
    )print_functionN)ConfigurationMixIn)Linkerproject_from_files)DiadefsHandler)writer)insert_default_optionszfilter-modefZPUB_ONLYmodestringZstorez<mode>a  filter attributes and functions according to
    <mode>. Correct modes are :
                            'PUB_ONLY' filter all non public attributes
                                [DEFAULT], equivalent to PRIVATE+SPECIAL_A
                            'ALL' no filter
                            'SPECIAL' filter Python special functions
                                except constructor
                            'OTHER' filter protected and private
                                attributes)shortdefaultdesttypeactionmetavarhelpclasscappendz<class>classeszbcreate a class diagram with all classes related to <class>; this uses by default the options -ASmy)r   r   r   r   r   r   zshow-ancestorsaz
<ancestor>intzAshow <ancestor> generations of ancestor classes not in <projects>)r   r   r   r   r   zall-ancestorsAz0show all ancestors off all classes in <projects>)r   r   r   zshow-associatedsz<association_level>zGshow <association_level> levels of associated classes not in <projects>zall-associatedSz:show recursively all associated off all associated classeszshow-builtinb
store_trueFz4include builtin objects in representation of classes)r   r   r   r   zmodule-namesmZynz[yn]z0include module name in representation of classes)r   r   r   r   r   zonly-classnameskzMdon't show attributes and methods in the class boxes; this disables -f valuesoutputooutput_formatdotz<format>z4create a *.<format> output file if format available.)r   r   r   r   r   r   ignoreZcsvz<file[,file...]>
black_list)ZCVSzPAdd files or directories to the blacklist. They should be base names, not paths.)r   r   r   r   r   project pz<project name>zset the project name.)r   r   r   r   r   c             C   sL   yt jddgt jt jd W n* tk
rF   td|   td Y nX dS )z5check if we need graphviz for different output formatr#   z-V)stdoutstderrz~The output format '%s' is currently not available.
Please install 'Graphviz' to have other output formats than 'dot' or 'vcg'.    N)
subprocessZcallPIPEOSErrorprintsysexit)r"    r2   4lib/python3.7/site-packages/pylint/pyreverse/main.py_check_graphviz_available   s    r4   c               @   s$   e Zd ZdZeZdd Zdd ZdS )Runz<base class providing common behaviour for pyreverse commandsc             C   sH   t j| td t  |  }| jjdkr4t| jj t	| 
| d S )N)Zusage)r#   vcg)r   __init____doc__r   Zload_command_line_configurationconfigr"   r4   r0   r1   run)selfargsr2   r2   r3   r7      s    zRun.__init__c          	   C   s   |st |   dS tjdt  z<t|| jj	| jj
d}t|dd}t| j}|||}W dtjd X | jjdkrt| j| nt| j| dS )z"checking arguments and run project   r   )Zproject_namer%   T)tagNr6   )r/   r   r0   pathinsertosgetcwdr   r9   r&   r%   r   r   Zget_diadefspopr"   r   Z	VCGWriterwriteZ	DotWriter)r;   r<   r&   ZlinkerZhandlerZdiadefsr2   r2   r3   r:      s"    
zRun.runN)__name__
__module____qualname__r8   OPTIONSZoptionsr7   r:   r2   r2   r2   r3   r5      s   	r5   __main__r=   )r8   Z
__future__r   rA   r,   r0   Zpylint.configr   Zpylint.pyreverse.inspectorr   r   Zpylint.pyreverse.diadefslibr   Zpylint.pyreverser   Zpylint.pyreverse.utilsr   dictrH   r4   r5   rE   argvr2   r2   r2   r3   <module>   s   		)
