Dashboard
PHP:
8.1.33
OS:
Linux
User:
lawtemple
/
/
usr
/
lib
/
python2.7
/
site-packages
/
importlib_resources
📤 Upload
📝 New File
📁 New Folder
Close
Editing: _common.pyc
� ���cc @@ s5 d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z m Z m Z m Z e r� d d l m Z m Z m Z d d l m Z e e j e f Z n d � Z d � Z d � Z d � Z d � Z d � Z e j d d � � Z e d � � Z e j e � e j d � � � Z d S( i ( t absolute_importNi ( t Patht FileNotFoundErrort singledispatcht package_spec( t Uniont Anyt Optional( t ResourceReaderc C@ s t t | � � S( s3 Get a Traversable resource from a package ( t from_packaget get_package( t package( ( s? /usr/lib/python2.7/site-packages/importlib_resources/_common.pyt files s c C@ sF t | � } t j j | � \ } } | rB t d j | � � � n | S( s� Normalize a path by ensuring it is a string. If the resulting string contains path separators, an exception is raised. s {!r} must be only a file name( t strt ost patht splitt ValueErrort format( R t str_patht parentt file_name( ( s? /usr/lib/python2.7/site-packages/importlib_resources/_common.pyt normalize_path s c C@ s; | j } t | j d d � } | d k r. d S| | j � S( s? Return the package's loader if it's a ResourceReader. t get_resource_readerN( t __spec__t getattrt loadert Nonet name( R t spect reader( ( s? /usr/lib/python2.7/site-packages/importlib_resources/_common.pyR ( s c C@ s# t | t j � r | St j | � S( N( t isinstancet typest ModuleTypet importlibt import_module( t cand( ( s? /usr/lib/python2.7/site-packages/importlib_resources/_common.pyt resolve9 s c C@ s= t | � } t | � j d k r9 t d j | � � � n | S( s� Take a package name or module object and return the module. Raise an exception if the resolved module is not a package. s {!r} is not a packageN( R% R t submodule_search_locationsR t TypeErrorR ( R t resolved( ( s? /usr/lib/python2.7/site-packages/importlib_resources/_common.pyR A s c C@ s+ t | � } | j j | j � } | j � S( s= Return a Traversable object for the given package. ( R R R R R ( R R R ( ( s? /usr/lib/python2.7/site-packages/importlib_resources/_common.pyR M s t c c@ sw t j d | � \ } } z2 t j | | � � t j | � ~ t | � VWd y t j | � Wn t k rq n XXd S( Nt suffix( t tempfilet mkstempR t writet closeR t removeR ( R R* t fdt raw_path( ( s? /usr/lib/python2.7/site-packages/importlib_resources/_common.pyt _tempfileW s c C@ s t | j d | j �S( su Given a Traversable object, return that object as a path on the local file system in a context manager. R* ( R2 t read_bytesR ( R ( ( s? /usr/lib/python2.7/site-packages/importlib_resources/_common.pyt as_filei s c c@ s | Vd S( s7 Degenerate behavior for pathlib.Path objects. N( ( R ( ( s? /usr/lib/python2.7/site-packages/importlib_resources/_common.pyt _r s (! t __future__R R R+ t contextlibR R"