§
/œ4àÊ卑ã óÜ — d Z ddlmZ ddlmZ ddlZddlZddlZddl Z ddl
Z ddlZddlm
Z
ddlZg d¢Z edd¦ « Zd e_ d
„ Zd„ Zdd
„Zd d„Zed!d„¦ « Zd!d„Ze ej j e¦ « d„ Z G d„ d¦ « Z G d„ d¦ « Z ddlZddlmZ d!d„Ze ee¦ « n# e $ r Y nw xY wd„ Z!d!d„Z"d„ Z#d„ Z$d„ Z%d„ Z&da'd„ Z(dS )"zUtilities to support packages.é )Ú
namedtuple)ÚsingledispatchN)Ú
ModuleType)Úget_importerÚiter_importersÚ
get_loaderÚfind_loaderÚ
walk_packagesÚiter_modulesÚget_dataÚImpImporterÚ ImpLoaderÚ read_codeÚextend_pathÚ
ModuleInfor zmodule_finder name ispkgz.A namedtuple with minimal info about a module.c ó¼ — | j } ||¦ « S # t $ r= | |¦ « }|€Y dS t j ||¦ « cY S w xY w)z'Return the finder-specific module spec.N)Ú find_specÚAttributeErrorÚfind_moduleÚ importlibÚutilÚspec_from_loader)ÚfinderÚnamer Úloaders ú4/opt/alt/python-internal/lib64/python3.11/pkgutil.pyÚ _get_specr sy € ðØÔ$ˆ ð ˆy˜‰ŒÐøõ
ð =ð =ð =Ø×#Ò# DÑ)Ô)ˆØˆ>Ø�4�4ÝŒ~×.Ò.¨t°VÑ<Ô<Ð<Ð<Ð<ð =øøøs ‚ ”!A¸ AÁAc ó¶ — dd l }| d¦ « }|t j j k rd S | d¦ « | | ¦ « S )Nr é é )ÚmarshalÚreadr r ÚMAGIC_NUMBERÚload)Ústreamr! Úmagics r r r ( sR € ð €N€N€Nà�KŠK˜‰NŒN€EØ• ”Ô+Ò+Ð+؈tà
‡K‚K��O„O€OØ�<Š<˜ÑÔÐó Ú c # óª ‡K — i fd„Št | |¦ « D ]¹}|V — |j r¬ t |j ¦ « t t
j |j dd¦ « pg } ˆfd„| D ¦ « } t | |j dz |¦ « E d{V —† Œx# t $ r |� ||j ¦ « Y Œ–t $ r |� ||j ¦ « n‚ Y Œµw xY wŒºdS )a« Yields ModuleInfo for all modules recursively
on path, or, if path is None, all accessible modules.
'path' should be either None or a list of paths to look for
modules in.
'prefix' is a string to output on the front of every module name
on output.
Note that this function must import all *packages* (NOT all
modules!) on the given path, in order to access the __path__
attribute to find submodules.
'onerror' is a function which gets called with one argument (the
name of the package which was being imported) if any exception
occurs while trying to import a package. If no onerror function is
supplied, ImportErrors are caught and ignored, while all other
exceptions are propagated, terminating the search.
Examples:
# list all modules python can access
walk_packages()
# list all submodules of ctypes
walk_packages(ctypes.__path__, ctypes.__name__+'.')
c ó — | |v rdS d|| <