3
tûœ]¹  ã               @   s€  d Z ddlZddlZddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ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d/ed0dd1d2d3d4�fd5ed6d+d,d7d.�fd8ed9d:dd;d<d=d>�fd?d@dAdBdRdDdEœfdFdGddHdIdJdKœffZdLdM„ ZG dNdO„ dOeƒZedPk�r|eejdQd… ƒ dS )Sz[
  %prog [options] <packages>

  create UML diagrams for classes and modules in <packages>
é    N)ÚConfigurationMixIn)Úwriter)ÚDiadefsHandler)ÚLinkerÚproject_from_files)Úinsert_default_optionszfilter-modeÚfZPUB_ONLYÚmodeÚstringÚ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   ÚignoreÚcsvz<file[,file...]>Ú
black_listÚ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j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)Ú
subprocessÚcallÚPIPEÚOSErrorÚprintÚsysÚexit)r"   © r5   ú7/tmp/pip-build-fn42xldr/pylint/pylint/pyreverse/main.pyÚ_check_graphviz_availableŸ   s    r7   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jdkr4t| jjƒ tj	| j
|ƒƒ d S )N)Úusager#   Úvcg)r#   r:   )r   Ú__init__Ú__doc__r   Zload_command_line_configurationÚconfigr"   r7   r3   r4   Úrun)ÚselfÚargsr5   r5   r6   r;   ±   s    zRun.__init__c             C   s¨   |st | jƒ ƒ dS tjjdtjƒ ƒ z<t|| jj	| jj
d�}t|dd�}t| jƒ}|j||ƒ}W dtjjdƒ X | jjdkr’tj| jƒj|ƒ ntj| jƒj|ƒ dS )z"checking arguments and run projecté   r   )Úproject_namer&   T)ÚtagNr:   )r2   r   r3   ÚpathÚinsertÚosÚgetcwdr   r=   r(   r&   r   r   Zget_diadefsÚpopr"   r   Z	VCGWriterÚwriteZ	DotWriter)r?   r@   r(   ZlinkerÚhandlerZdiadefsr5   r5   r6   r>   º   s"    
zRun.runN)Ú__name__Ú
__module__Ú__qualname__r<   ÚOPTIONSÚoptionsr;   r>   r5   r5   r5   r6   r8   ¬   s   	r8   Ú__main__rA   )r'   )r<   rF   r.   r3   Zpylint.configr   Zpylint.pyreverser   Zpylint.pyreverse.diadefslibr   Zpylint.pyreverse.inspectorr   r   Zpylint.pyreverse.utilsr   ÚdictrN   r7   r8   rK   Úargvr5   r5   r5   r6   Ú<module>   s¸   	)
