Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 \ö4ã@s¬dZddlZddlZddlZddlZddlmZmZm Z ddddgZ iZ Gdd„dƒZ Gd d„dƒZ dd d„Zdd d„Zdd d „Zdd„Zdd„Zdd„Zedkr¨eƒdS)açParse a Python module and describe its classes and methods. Parse enough of a Python file to recognize imports and class and method definitions, and to find out the superclasses of a class. The interface consists of a single function: readmodule_ex(module [, path]) where module is the name of a Python module, and path is an optional list of directories where the module is to be searched. If present, path is prepended to the system search path sys.path. The return value is a dictionary. The keys of the dictionary are the names of the classes defined in the module (including classes that are defined via the from XXX import YYY construct). The values are class instances of the class Class defined here. One special key/value pair is present for packages: the key '__path__' has a list as its value which contains the package search path. A class is described by the class Class in this module. Instances of this class have the following instance variables: module -- the module name name -- the name of the class super -- a list of super classes (Class instances) methods -- a dictionary of methods file -- the file in which the class was defined lineno -- the line in the file on which the class statement occurred The dictionary of methods uses the method names as keys and the line numbers on which the method was defined as values. If the name of a super class is not recognized, the corresponding entry in the list of super classes is not a class instance but a string giving the name of the super class. Since import statements are recognized and imported modules are scanned as well, this shouldn't happen often. A function is described by the class Function in this module. Instances of this class have the following instance variables: module -- the module name name -- the name of the class file -- the file in which the class was defined lineno -- the line in the file on which the class statement occurred éN)ÚNAMEÚDEDENTÚOPÚ readmoduleÚ readmodule_exÚClassÚFunctioncs(eZdZdZ‡fdd„Zdd„Z‡ZS)rz"Class to represent a Python class.cs4||_||_|dkrg}||_i|_||_||_dS)N)ÚmoduleÚnameÚsuperÚmethodsÚfileÚlineno)Úselfr r r r r)Ú __class__©ú/usr/lib64/python3.6/pyclbr.pyÚ__init__7szClass.__init__cCs||j|<dS)N)r )rr rrrrÚ _addmethodAszClass._addmethod)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__rr)rrr5s c@seZdZdZdd„ZdS)rz.Class to represent a top-level Python functioncCs||_||_||_||_dS)N)r r r r)rr r r rrrrrFszFunction.__init__N)rrrrrrrrrrDscCs:i}x0t||pgƒjƒD]\}}t|tƒr|||<qW|S)z}Backwards compatible interface. Call readmodule_ex() and then only keep Class objects from the resulting dictionary.)Ú _readmoduleÚitemsÚ isinstancer)r ÚpathÚresÚkeyÚvaluerrrrLs   cCst||p gƒS)zÕRead a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. )r)r rrrrrXsc&!CsÊ|dk rd||f}n|}|tkr*t|Si}|tjkrL|dkrL|t|<|S|jdƒ}|dkrÀ|d|…}||dd…}t|||ƒ}|dk ršd||f}d|kr°tdj|ƒƒ‚t||d|ƒSd} |dk rÒ|} n |tj} tj j || ƒ} |t|<| j dk �r| j |d<y| j j |ƒ} | dk�r$|SWnttfk �r@|SX| j j|ƒ} tj| ƒ} g}tj| jƒ}�y<�x4|D�]*\}}}}}|tk�rÀ|\}}x$|�rº|dd|k�rº|d=�q˜W�qt|dk�rl|\}}x$|�rö|dd|k�rö|d=�qÔWt|ƒdd …\}}}|tk�r�qt|�rH|dd}t|tƒ�rZ|j||ƒnt||| |ƒ||<|jd|fƒ�qt|d k�rD|\}}x$|�r¢|dd|k�r¢|d=�q€Wt|ƒdd …\}}}|tk�rÈ�qtt|ƒdd …\}}}d}|d k�rg}d}g}�xt|ƒdd …\}}}|dk�rž|dk�rždj|ƒ}||k�rD||}nL|jdƒ}t|ƒdk�r�|d} |d}| tk�r�t| }!||!k�r�|!|}|j|ƒg}|d k�r²|d7}nX|d k�rÒ|d8}|dk�r Pn8|d k�rè|dk�rèn"|tt fk�rü|dk�rü|j|ƒ�qüW|}t|||| |ƒ}|�s2|||<|j||fƒ�qt|dk�rÔ|ddk�rÔt!|ƒ}"xl|"D]d\}#}$yL|dk�rŠt|#|ƒn2yt|#||ƒWn tk �rºt|#gƒYnXWn YnX�qjWnÊ|dk�rt|ddk�rtt"|ƒ\}#}|# �st|dk�r�qtt!|ƒ}yt|#||ƒ}!Wn�wtYnXxd|D]\\}}%||!k�rd|!|||%�p`|<n4|dk�r>x(|!D] }|ddk�rt|!|||<�qtW�q>W�qtWWnt#k �r¼YnX| j$ƒ|S)a.Do the hard work for readmodule[_ex]. If INPACKAGE is given, it must be the dotted name of the package in which we are searching for a submodule, and then PATH must be the package search path; otherwise, we are searching for a top-level module, and PATH is combined with sys.path. Nz%s.%sÚ.réÚ__path__zNo package named {}ÚdeféÚclassú(ú)ú,ÚéÚimportÚfromÚ*Ú_éÿÿÿÿr0r0r0r0r0r0)r(r)éþÿÿÿr0)%Ú_modulesÚsysÚbuiltin_module_namesÚrfindrÚ ImportErrorÚformatrÚ importlibÚutilÚ_find_spec_from_pathÚsubmodule_search_locationsÚloaderÚ get_sourceÚAttributeErrorÚ get_filenameÚioÚStringIOÚtokenizeÚgenerate_tokensÚreadlinerÚnextrrrrrÚappendÚjoinÚsplitÚlenrÚ _getnamelistÚ_getnameÚ StopIterationÚclose)&r rZ inpackageZ fullmoduleÚdictÚiÚpackageZ submoduleÚparentÚfZ search_pathÚspecÚsourceZfnameÚstackÚgÚ tokentypeÚtokenÚstartZ_endÚ_linerZ thisindentZ meth_nameZ cur_classÚ class_nameZinheritÚnamesÚlevelr ÚnÚcÚmÚdÚmodulesÚmodZ_mod2Zn2rrrras                                           "rcCstg}xjt|ƒ\}}|sP|dkr.t|ƒ\}}nd}|j||fƒx |dkr`d|kr`t|ƒd}qBW|dkrPqW|S)NÚasr)Ú r")rKrFrE)rVr\r rXZname2rrrrJs rJcCs”g}t|ƒdd…\}}|tkr0|dkr0d|fS|j|ƒxJt|ƒdd…\}}|dkrZPt|ƒdd…\}}|tkrxP|j|ƒqTsz_main..)rr&r#z defr$éýÿÿÿ)ÚosÚoperatorrgr3ÚargvrÚexistsÚdirnameÚbasenameÚlowerÚendswithrÚlistÚvaluesÚsortrrÚprintr r rÚsortedr rr) rlrgrcrrNZobjsÚobjr r rrrrÚ_mainFs*         rzÚ__main__)N)N)N)rr@r3Úimportlib.utilr8rBrXrrrÚ__all__r2rrrrrrJrKrzrrrrrÚ(s$  ?