选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
U e5d@%ã @s²ddlZddlZddlmZddlmZmZddlm Z ddl m Z ddl m Z mZddlmZdd lmZdd lmZmZmZmZmZdd lmZdd lmZmZdd lmZdddddddddg Zee efZ!ee ej"fZ#edœdd„Z$e dœdd„Z%eeej&dœdd„Z'dd „Z(e!e#ed!œd"d„Z)d-e!e#e e ed%œd&d„Z*e!e#e+d!œd'd„Z,d.e!e#e e e d%œd(d„Z-ee!e#eed!œd)d„ƒZ.e!e e/d*œd+d„Z0e!ee dœd,d„Z1dS)/éNé)Úabc)ÚcontextmanagerÚsuppress)Ú import_module)ÚResourceLoader)ÚBytesIOÚ TextIOWrapper)ÚPath)Ú ModuleType)ÚIterableÚIteratorÚOptionalÚSetÚUnion)Úcast)ÚBinaryIOÚTextIO)ÚZipImportErrorÚPackageÚResourceÚcontentsÚ is_resourceÚ open_binaryÚ open_textÚpathÚ read_binaryÚ read_text)ÚreturncCs\t|dƒr0|jjdkr*td |jj¡ƒ‚qX|Sn(t|ƒ}|jjdkrTtd |¡ƒ‚n|SdS)z»Take a package name or module object and return the module. If a name, the module is imported. If the passed or imported module object is not a package, raise an exception. Ú__spec__Nz{!r} is not a package)ÚhasattrrÚsubmodule_search_locationsÚ TypeErrorÚformatÚnamer)ÚpackageÚmodule©r'ú+/usr/lib64/python3.8/importlib/resources.pyÚ _get_package"s  ÿ r)cCs,tj |¡\}}|r$td |¡ƒ‚n|SdS)z€Normalize a path by ensuring it is a string. If the resulting string contains path separators, an exception is raised. z{!r} must be only a file nameN)ÚosrÚsplitÚ ValueErrorr#)rÚparentÚ file_namer'r'r(Ú_normalize_path6sr/)r%rcCs,|j}t|jdƒr(ttj|j |j¡ƒSdS)NÚget_resource_reader)rr ÚloaderrÚ resources_abcÚResourceReaderr0r$)r%Úspecr'r'r(Ú_get_resource_readerBs   ÿr5cCs&|jjdks|jjs"td|›�ƒ‚dS)NzPackage has no location )rÚoriginÚ has_locationÚFileNotFoundError)r%r'r'r(Ú_check_locationPsr9)r%Úresourcerc Csôt|ƒ}t|ƒ}t|ƒ}|dk r*| |¡St|ƒtj |jj ¡}tj  |¡}tj  ||¡}zt |dd�WSt k rîtt|jjƒ}d}t|jjdƒr¸tt ƒ�| |¡}W5QRX|dkrÞ|jj}d ||¡} t| ƒ‚n t|ƒYSYnXdS)zDReturn a file-like object opened for binary reading of the resource.NÚrb)ÚmodeÚget_dataú{!r} resource not found in {!r})r/r)r5Ú open_resourcer9r*rÚabspathrr6ÚdirnameÚjoinÚopenÚOSErrorrrr1r rr=r$r#r8r) r%r:ÚreaderÚabsolute_package_pathÚ package_pathÚ full_pathr1ÚdataÚ package_nameÚmessager'r'r(rUs2   ÿ úutf-8Ústrict)r%r:ÚencodingÚerrorsrc Cs t|ƒ}t|ƒ}t|ƒ}|dk r2t| |¡||ƒSt|ƒtj |j j ¡}tj  |¡}tj  ||¡}zt |d||d�WStk �rtt|j jƒ}d} t|j jdƒrÆttƒ�| |¡} W5QRX| dkrì|j j} d || ¡} t| ƒ‚ntt| ƒ||ƒYSYnXdS)zBReturn a file-like object opened for text reading of the resource.NÚr)r<rNrOr=r>)r/r)r5r r?r9r*rr@rr6rArBrCrDrrr1r rr=r$r#r8r) r%r:rNrOrErFrGrHr1rIrJrKr'r'r(rts2  ÿ c Cs:t|ƒ}t|ƒ}t||ƒ�}| ¡W5QR£SQRXdS)z+Return the binary contents of the resource.N)r/r)rÚread)r%r:Úfpr'r'r(r–s c Cs>t|ƒ}t|ƒ}t||||ƒ�}| ¡W5QR£SQRXdS)z‹Return the decoded string of the resource. The decoding-related arguments have the same semantics as those of bytes.decode(). N)r/r)rrQ)r%r:rNrOrRr'r'r(ržs c cst|ƒ}t|ƒ}t|ƒ}|dk rNzt| |¡ƒVWdStk rJYqVXnt|ƒd}|jjdk r|t|jjƒj }||}|dk r”|  ¡r”|Vnxt ||ƒ�}|  ¡}W5QRXt  ¡\}}z$t ||¡t |¡t|ƒVW5zt |¡Wntk �rYnXXdS)akA context manager providing a file path object to the resource. If the resource does not already exist on its own on the file system, a temporary file will be created. If the file was created, the file will be deleted upon exiting the context manager (no exception is raised if the file was deleted prior to the context manager exiting). N)r/r)r5r Ú resource_pathr8r9rr6r-ÚexistsrrQÚtempfileZmkstempr*ÚremoveÚwriteÚclose) r%r:rEZ file_pathÚpackage_directoryrRrIÚfdZraw_pathr'r'r(r­s6      )r%r$rc Cs|t|ƒ}t|ƒt|ƒ}|dk r*| |¡Sztt|ƒƒ}Wnttfk rTYdSX||krbdSt|j j ƒj |}|  ¡S)zYTrue if 'name' is a resource inside 'package'. Directories are *not* resources. NF) r)r/r5rÚsetrÚNotADirectoryErrorr8r rr6r-Úis_file)r%r$rEZpackage_contentsrr'r'r(rÜs cCsTt|ƒ}t|ƒ}|dk r | ¡S|jjdks4|jjs8dSt|jjƒj}t  |¡SdS)zõReturn an iterable of entries in 'package'. Note that not all entries are resources. Specifically, directories are not considered resources. Use `is_resource()` on each entry returned here to check if it is a resource or not. Nr') r)r5rrr6r7r r-r*Úlistdir)r%rErYr'r'r(rós)rLrM)rLrM)2r*rUÚrr2Ú contextlibrrÚ importlibrÚ importlib.abcrÚiorr Úpathlibr Útypesr Útypingr r rrrrZ typing.iorrZ zipimportrÚ__all__ÚstrrÚPathLikerr)r/r3r5r9rrÚbytesrrrÚboolrrr'r'r'r(Úsh       ÷  ÿ !ýý " ýý .