
    e%                       U d Z ddlm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 ddlmZ dd	lm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mZmZ ddlmZ dZdZ dddddddddfdddddd dd!d"fd#d$dd%d&dd'd(fd)d*dd+d,d-fd.d/dd0d&dd1d(fd2d3dd+d4d-fd5d6d+d7d8d9fd:d;d+d7d<d9fd=d>dd?d@dAdBfdCdDd+d7dEd9fdFd+d7dGdHfdIdJdKddLdMddNdOjC                  e       dPdQfdRdRd+d7dSdTfdUdVddWdXd&dYdZfd[d\de d]dd^dZfd_dd`dae	jD                  dbdcfdddeddfdgdhdifdjdedkdlddmdndofdpdqdrdsdtdufdvd+d7dwdHffZ#dxe$dy<    G dz d{ee      Z%e&d|k(  r e%ejN                  d}d        yy)~z:Create UML diagrams for classes and modules in <packages>.    )annotationsN)Sequence)NoReturn)	constants)_ArgumentsManager)_ArgumentsProvider)discover_package_path)augmented_sys_path)writer)DiadefsHandler)Linkerproject_from_files)check_graphviz_availability!check_if_graphviz_supports_formatinsert_default_options)Options)dotpumlplantumlmmdhtml)	z#77AADDz#99DDFFz#44BB99z#BBCC33z#AAAA00z#EEDD88z#EE8866z#FFAABBz#DDDDDDzfilter-modef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extendz<class>csvclasseszbcreate a class diagram with all classes related to <class>; this uses by default the options -ASmy)r   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   r#   zall-ancestorsA
store_truez0show all ancestors off all classes in <projects>)r   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bFz4include builtin objects in representation of classes)r   r!   r   r#   zshow-stdlibLz=include standard library objects in representation of classeszmodule-namesmynz<y or n>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 valueszno-standalonez only show nodes with connections)r!   r   r#   outputooutput_formatr   z<format>zOcreate a *.<format> output file if format is available. Available formats are: z, z{. Any other format will be tried to create by means of the 'dot' command line tool, which requires a graphviz installation.)r   r   r!   r   r"   r    r#   	colorizedzKUse colored output. Classes/modules of the same package get the same color.)r   r!   r   r#   zmax-color-depthmax_color_depth   z<depth>z2Use separate colors up to package depth of <depth>)r   r!   r   r"   r    r#   zcolor-palettecolor_palettez<color1,color2,...>z%Comma separated list of colors to useignorez<file[,file...]>ignore_listzIFiles or directories to be skipped. 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#   zoutput-directorypathdz<output_directory>zset the output directory path.)r   r    r   r!   r"   r#   zsource-rootsglob_paths_csvz<path>[,<path>...] zAdd paths to the list of the source roots. Supports globbing patterns. The source root is an absolute path or a path relative to the current working directory used to determine a package namespace for modules located under the source root.)r    r"   r   r#   verbosezDMakes pyreverse more verbose/talkative. Mostly useful for debugging.r   OPTIONSc                  (    e Zd ZdZeZdZddZddZy)Runz=Base class providing common behaviour for pyreverse commands.	pyreversec                0   d|v r9t        d       t        t        j                         t        j                  d       t        j                  | dt               t        j                  | |        t                | j                  |      }| j                  j                  t        vrLt                t        d| j                  j                   d       t        | j                  j                         t        j                  | j!                  |             y )Nz	--versionz pyreverse is included in pylint:r   rH   )progdescriptionzFormat zO is not supported natively. Pyreverse will try to generate it using Graphviz...)printr   full_versionsysexitr   __init____doc__r   r   !_parse_command_line_configurationconfigr6   DIRECTLY_SUPPORTED_FORMATSr   r   run)selfargss     7/usr/lib/python3/dist-packages/pylint/pyreverse/main.pyrP   zRun.__init__  s    $45)(()HHQK""4kwO##D$/ 	 55d;;;$$,FF')$++334 5G G .dkk.G.GH$     c           	     N   |st        | j                                yt        |D ch c]"  }t        || j                  j
                        $ c}      }t        |      5  t        || j                  j                  | j                  j                  | j                  j                        }t        |d      }t        | j                        }|j                  ||      }ddd       t        j                  | j                        j!                         yc c}w # 1 sw Y   =xY w)z#Checking arguments and run project.   )project_name
black_listrD   T)tagNr   )rL   r#   listr	   rS   source_rootsr
   r   r=   r<   rD   r   r   get_diadefsr   DiagramWriterwrite)rV   rW   argextra_packages_pathsr=   linkerhandlerdiadefss           rX   rU   zRun.run+  s    $))+#MQRc"3(@(@AR 
   45 		;(![[00;;22++	G G.F$T[[1G))'6:G		; 	T[[)//8 S		; 		;s   'DB DD$N)rW   zSequence[str]returnr   )rW   z	list[str]ri   r*   )	__name__
__module____qualname__rQ   rE   optionsnamerP   rU   rC   rY   rX   rG   rG     s    GGD!0rY   rG   __main__r[   )(rQ   
__future__r   rN   collections.abcr   typingr   pylintr   pylint.config.arguments_managerr    pylint.config.arguments_providerr   pylint.lintr	   pylint.lint.utilsr
   pylint.pyreverser   pylint.pyreverse.diadefslibr   pylint.pyreverse.inspectorr   r   pylint.pyreverse.utilsr   r   r   pylint.typingr   rT   DEFAULT_COLOR_PALETTEjoinDEFAULT_IGNORE_LISTrE   __annotations__rG   rj   argvrC   rY   rX   <module>r      s  
 A " 
 $   = ? - 0 # 6 A 
 "   	!.	
* 	 )		
 	#W	

 	"F		
 	,]	

 	"P		
 	"J		
 	"S		
 	!F	
	 	"c		
 	"6	
 	#!  $		*D EF G@A	
$ 	"a		
 	% H	

 	#,,;	

 	)! 44_	
	 	'+	
	 	+4	

 	$+_		

 	"Z	
cY Yx1
/ 1h z rY   