Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
pkgutil.cpython-314.pyc197 linesDownload Raw Back to __pycache__
1+
2��i�>���Rt^RIHt^RIHt^RIt^RIt^RIt^RI	t	^RI3t	^RIt.ROt]!RR4t
R]
nRtRRltRR	lt]RR4l4tRRlt]P']P(P*]4^RIt^RIHtRR
lt]P']]4RtRRltRtRtRsRtR# ]dLi;i)zUtilities to support packages.)�5namedtuple)�singledispatchN�6ModuleInfozmodule_finder name ispkgz.A namedtuple with minimal info about a module.c��^RIpVP^4pV\PP8wdR#VP^4VPV4#)�N)�marshal�read�	importlib�util�MAGIC_NUMBER�load)�streamr�magics&  �Lib\pkgutil.py�	read_codersC����K�K��N�E��	���+�+�+��7�K�K��O��<�<����c#�>"�/3Rlp\W4F�pVx�VP'gK\VP4\	\8PVP,RR4;'g.pVUu.uFqS!V4'dKVNK	pp\WPR,V4Rjx�L9K�	R#uupiL \dTeT!TP4K�K�\dTeT!TP4EKhi;i5i)a_Yields ModuleInfo for all modules recursively10on path, or, if path is None, all accessible modules.11 12'path' should be either None or a list of paths to look for13modules in.14 15'prefix' is a string to output on the front of every module name16on output.17 18Note that this function must import all *packages* (NOT all19modules!) on the given path, in order to access the __path__20attribute to find submodules.21 22'onerror' is a function which gets called with one argument (the23name of the package which was being imported) if any exception24occurs while trying to import a package.  If no onerror function is25supplied, ImportErrors are caught and ignored, while all other26exceptions are propagated, terminating the search.27 28Examples:29 30# list all modules python can access31walk_packages()32 33# list all submodules of ctypes34walk_packages(ctypes.__path__, ctypes.__name__+'.')35c��W9dR#RW&R#)TN�)�p�ms&&r�seen�walk_packages.<locals>.seenBs���6����r�__path__N�.)36�iter_modules�ispkg�37__import__�name�getattr�sys�modules�
walk_packages�ImportError�	Exception)�path�prefix�onerrorr�infors&&&   rr"r"%s����:��38�T�*���39��:�:�:�
G��4�9�9�%��s�{�{�4�9�9�5�z�4�H�N�N�B��$(�7�4�a�t�A�w���4��7�(��y�y��}�g�F�F�F�)+��$8�F���
'��&��D�I�I�&�'��
��&��D�I�I�&�&��	
�sX�(D�C
�:D�?C�C�"D�;C�<D�
!D�.D�4D�=D�D�D�Dc#�"�Vf\4pM1\V\4'd\R4h\	\40V4p/pVF1p\
WA4FwrVWS9gK
^W5&\WEV4x�K!	K3	R#5i)z�Yields ModuleInfo for all submodules on path,41or, if path is None, all top-level modules on sys.path.42 43'path' should be either None or a list of paths to look for44modules in.45 46'prefix' is a string to output on the front of every module name47on output.48Nz9path must be None or list of paths to look for modules in)�iter_importers�49isinstance�str�50ValueError�map�get_importer�iter_importer_modulesr)r%r&�	importers�yielded�irrs&&     rrr^s{����|�"�$�	�	�D�#�	�	��%�&�	&���d�+�	��G�
��0��;�K�D��"� !��
� ��%�0�0�<��s�AA>�"A>c�L�\VR4'g.#VPV4#)r)�hasattrr)�importerr&s&&rr0r0xs%���8�^�,�,��	�� � ��(�(rc#� "�VPe0\PPVP4'gR#/p^RIp\P!VP4pVP
4VF�pVPV4pVR8XgWb9dK#\PPVPV4pRpV'gm\PPV4'dHRV9dATp\P!V4p	V	FpVPV4p51V52R8XgKRpM	K�V'gK�RV9gK�^W&&W,V3x�K�	R# \53d.pELi;i \54d.p	Lsi;i5i)N�__init__FrT)	r%�os�isdir�inspect�listdir�OSError�sort�
getmodulename�join)r6r&r2r;�	filenames�fn�modnamer%r�dircontents�subnames&&         r�_iter_file_finder_modulesrF�sJ����}�}��B�G�G�M�M�(�-�-�$@�$@���G����J�J�x�}�}�-�	��N�N�����'�'��+���J��'�"4���w�w�|�|�H�M�M�2�.�����2�7�7�=�=��.�.�3�b�=��G�
!� �j�j��.��"��!�/�/��3���J�&� �E��	"���7�s�'�)� �G���"�E�)�)�3�����	���"�
!� ��
!�sr�=F�F�	 E'�)A(F�$F�7	F�E;�F�6
F�F�F�'
E8�4F�7E8�8F�;
F�F�55F�F)�zipimporterc#�"�\\PVP,4pVPp\V4p/p^RIpVF�pVPV4'gKWtRP\P4p\V4^8XdKV^,PR4'd-V^,V9d^WW^,&W^,,R3x�\V4^8wdK�VPV^,4pVR8XdK�V'gK�RV9gK�W�9gK�^WX&W,R3x�K�	R#5i)rNz__init__.pyTr8rF)�sorted�	zipimport�_zip_directory_cache�archiver&�lenr;�56startswith�splitr9�sepr?)	r6r&�dirlist�_prefix�plenr2r;rBrCs	&&       r�iter_zipimport_modulesrT�s�����7�7��8H�8H�I�J���/�/���7�|������B��=�=��)�)���E�������(�B��2�w��z�b��e�.�.�}�=�=��a�5��'�%&�G�q�E�N� �a�5�.�$�.�.��2�w��z���+�+�B�q�E�2�G��57�"���w�3�g�-�'�2H�#$�� ��&��-�-�)�s�B4E�7A$E� E�)E�1Ec�0�\P!V4p\PV,pV# \dZ\P58F?pT!T4p\PP
Y4T# \dK=i;i	RpT#i;i)z�Retrieve a finder for the given path item59 60The returned finder is cached in sys.path_importer_cache61if it was newly created by a path hook.62 63The cache (or part of it) can be cleared manually if a64rescan of sys.path_hooks is necessary.65N)r9�fsdecoder �path_importer_cache�KeyError�66path_hooks�67setdefaultr#)�	path_itemr6�	path_hooks&  rr/r/�s������I�&�I���*�*�9�5���O���	����I�
�$�Y�/���'�'�2�2�9�G��68�O��	�
��
��(��H��O�	�s3�1�B�'A;�7B�;B69�B�	B70�71B�Bc#�"�VPR4'dRPV4p\V4hRV9dCVPR4^,p\P72!V4p\
VRR4pVfR#M(\PRjx�L73\PpVFp\V4x�K	R#L,5i)a�Yield finders for the given module name74 75If fullname contains a '.', the finders will be for the package76containing fullname, otherwise they will be all registered top level77finders (i.e. those on both sys.meta_path and sys.path_hooks).78 79If the named module is in a package, that package is imported as a side80effect of invoking this function.81 82If no module name is specified, all top level finders are produced.83rz'Relative module name {!r} not supportedrN)rN�formatr#�84rpartitionr	�
import_modulerr �	meta_pathr%r/)�fullname�msg�pkg_name�pkgr%�items&     rr*r*�s�������3���7�>�>�x�H���#���85�h���&�&�s�+�A�.���%�%�h�/���s�J��-���<����=�=� � ��x�x�����4� � ��	!�s�BC�B?�-Cc	��\V\4'gV#VR,pVR,pVPR4wr4pV'd$\PV,P86pM\PpVEFcp\V\4'gK\V4pVe�.p	\VR4'd-VPV4p87V88eV89P;'g.p	M%\VR4'dVPV4wrIV	FpW�9gKVPV4K	\ PP#Wr4p\ PP%V4'gK�\'V4p
T
;_uu_4V
FFpVP)R4pV'dVP+R4'dK5VPV4KH	RRR4EKf	V# \\3dTu#i;i +'giEK�;i \,d5p\P.P1R	T:R90T:R24Rp?EK�Rp?ii;i)aBExtend a package's path.91 92Intended use is to place the following code in a package's __init__.py:93 94    from pkgutil import extend_path95    __path__ = extend_path(__path__, __name__)96 97For each directory on sys.path that has a subdirectory that98matches the package name, add the subdirectory to the package's99__path__.  This is useful if one wants to distribute different100parts of a single logical package as multiple directories.101 102It also looks for *.pkg files beginning where * matches the name103argument.  This feature is similar to *.pth files (see site.py),104except that it doesn't special-case lines starting with 'import'.105A *.pkg file is trusted at face value: apart from checking for106duplicates, all entries found in a *.pkg file are added to the107path, regardless of whether they are exist the filesystem.  (This108is a feature.)109 110If the input path is not a list (as is the case for frozen111packages) it is returned unchanged.  The input path is not112modified; an extended copy is returned.  Items are only appended113to the copy at the end.114 115It is assumed that sys.path is a sequence.  Items of sys.path that116are not (unicode or 8-bit) strings referring to existing117directories are ignored.  Unicode items of sys.path that cause118errors when used as filenames may cause this function to raise an119exception (in line with os.path.isdir() behavior).120z.pkg:NNNrN�	find_spec�find_loader�121�#zCan't open z: )r+�listr_r r!rrX�AttributeErrorr%r,r/r5rh�submodule_search_locationsri�appendr9r@�isfile�open�rstriprNr=�stderr�write)r%r�	sname_pkg�parent_package�_�122final_name�search_path�dir�finder�portions�spec�portion�pkgfile�f�linercs&&              r�extend_pathr�s���B�d�D�!�!����v�
�I���7�D�$(�O�O�C�$8�!�N�z��	��+�+�n�5�>�>�K��h�h�����#�s�#�#���c�"�����H��v�{�+�+��'�'�123�3���#�#�>�>�D�D�"�H�����/�/�$�0�0��<���#���&��K�K��(�	$��'�'�,�,�s�.��
�7�7�>�>�'�"�"�
*���M��124�Q� !��#�{�{�4�0��#�t���s�';�';�$����D�)�	!"��Q�?�L�K��[�.�)�	��K�	��L�Q�Q��	�
1��125�126� � �")�3�"0�1�1��
1�s<�!G&�5H�1275G?�G?�&G<�;G<�?H�I�(I�Ic�B�\PPV4pVfR#VPpVe\	VR4'gR#\128PPV4;'g \PPV4pVe\	VR4'gR#VPR4pVP^\PPVP44\PP !V!pVP#V4#)a.Get a resource from a package.129 130This is a wrapper round the PEP 302 loader get_data API. The package131argument should be the name of a package, in standard module format132(foo.bar). The resource argument should be in the form of a relative133filename, using '/' as the path separator. The parent directory name '..'134is not allowed, and nor is a rooted name (starting with a '/').135 136The function returns a binary string, which is the contents of the137specified resource.138 139For packages located in the filesystem, which have already been imported,140this is the rough equivalent of141 142    d = os.path.dirname(sys.modules[package].__file__)143    data = open(os.path.join(d, resource), 'rb').read()144 145If the package cannot be located or loaded, or it uses a PEP 302 loader146which does not support get_data(), then None is returned.147N�get_data�__file__�/)r	r148rh�loaderr5r r!�get�149_bootstrap�_loadrO�insertr9r%�dirnamer�r@r�)�package�resourcer}r��mod�parts�
resource_names&&     rr�r�fs���,�>�>�#�#�G�,�D��|��
�[�[�F�
�~�W�V�Z�8�8���;�;�?�?�7�#�,�,����%�%�d�+��150�{�'�#�z�2�2��151
�N�N�3��E�	�L�L��B�G�G�O�O�C�L�L�1�2��G�G�L�L�%�(�M��?�?�=�)�)rc���\f*^RIpRpVPRVRVR2VP4s\P	V4pV'g\RV:24hVP
4pVPR4'dK\P!VR,4pVPR	4pV'dVPR1524M.pM|VPR1534pVP^4p\P!V4pV'd=V^,pVR154V2p	\P!V	4pVP^4T	pKDTp155VFp\W�4p156K	V157# \dK&i;i)a?158Resolve a name to an object.159 160It is expected that `name` will be a string in one of the following161formats, where W is shorthand for a valid Python identifier and dot stands162for a literal period in these pseudo-regexes:163 164W(.W)*165W(.W)*:(W(.W)*)?166 167The first form is intended for backward compatibility only. It assumes that168some part of the dotted name is a package, and the rest is an object169somewhere within that package, possibly nested inside other objects.170Because the place where the package stops and the object hierarchy starts171can't be inferred by inspection, repeated attempts to import must be done172with this form.173 174In the second form, the caller makes the division point clear through the175provision of a single colon: the dotted name to the left of the colon is a176package to be imported, and the dotted name to the right is the object177hierarchy within that package. Only one import is needed in this form. If178it ends with the colon, then a module object is returned.179 180The function will return an object (which might be a module), or raise one181of the following exceptions:182 183ValueError - if `name` isn't in a recognised format184ImportError - if an import failed when it shouldn't have185AttributeError - if a failure occurred when traversing the object hierarchy186                 within the imported package to get to the desired object.187Nz(?!\d)(\w+)(\.(?!\d)(\w+))*z	^(?P<pkg>z)(?P<cln>:(?P<obj>z)?)?$zinvalid format: �clnre�objr)�
_NAME_PATTERN�re�compile�UNICODE�matchr-�	groupdictr�r	r`rO�popr#r)rr��dotted_wordsr�gdr�r�rCr�s�results&          r�resolve_namer��sT��B���5���188�189�Y�|�n�=7�7C�n�E�$K�#%�:�:�/�
�	���D�!�A���+�D�8�4�5�5�	190����B�	�v�v�e�}�}��%�%�b��i�0�����u�
��$)����C� �r���191�192�3����)�)�A�,���%�%�g�.����a��A��)�1�Q�C� �A�
��-�-�a�0���	�	�!�����F�
����#����M���
��
�s� )E#�#E2�1E2)r/r*r"rr�rr�r)N�N)Nr�)r�) �__doc__�collectionsr�	functoolsr�
simplegenericr	�importlib.util�importlib.machineryr9�os.pathr �__all__rrr"rr0rF�register�	machinery�193FileFinderrJrGrTr#r/r*r�r�r�r�rrr�<module>r�s���$�"�5����	��194�����&@�
A�195�E�196��197 �6G�r1�4�)��)�&*�P���
���"�"�$=�?�#	��%�.�8�"�"�;�0F�G��2!�:[�|(*�V�
�G��K�	��	�s�>!B4�4B>�=B>
codekingpro/portable-devtools · Team Ai