Let us walk on the 3-isogeny graph
|
Public Member Functions | |
__init__ (self) | |
resource_exists (self, package_or_requirement, resource_name) | |
resource_isdir (self, package_or_requirement, resource_name) | |
resource_filename (self, package_or_requirement, resource_name) | |
resource_stream (self, package_or_requirement, resource_name) | |
resource_string (self, package_or_requirement, resource_name) | |
resource_listdir (self, package_or_requirement, resource_name) | |
extraction_error (self) | |
get_cache_path (self, archive_name, names=()) | |
postprocess (self, tempname, filename) | |
set_extraction_path (self, path) | |
cleanup_resources (self, force=False) | |
Data Fields | |
cached_files | |
Static Public Attributes | |
extraction_path = None | |
Static Protected Member Functions | |
_warn_unsafe_extraction_path (path) | |
Manage resource extraction and packages
Definition at line 1195 of file __init__.py.
__init__ | ( | self | ) |
Definition at line 1200 of file __init__.py.
Referenced by Protocol.__init_subclass__().
|
staticprotected |
If the default extraction path is overridden and set to an insecure location, such as /tmp, it opens up an opportunity for an attacker to replace an extracted file with an unauthorized payload. Warn the user if a known insecure location is used. See Distribute #375 for more details.
Definition at line 1289 of file __init__.py.
cleanup_resources | ( | self, | |
force = False |
|||
) |
Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be called when the extraction path is a temporary directory exclusive to a single process. This method is not automatically called; you must call it explicitly or register it as an ``atexit`` function if you wish to ensure cleanup of a temporary directory used for extractions.
Definition at line 1359 of file __init__.py.
extraction_error | ( | self | ) |
Give an error message for problems extracting file(s)
Definition at line 1233 of file __init__.py.
get_cache_path | ( | self, | |
archive_name, | |||
names = () |
|||
) |
Return absolute location in cache for `archive_name` and `names` The parent directory of the resulting path will be created if it does not already exist. `archive_name` should be the base filename of the enclosing egg (which may not be the name of the enclosing zipfile!), including its ".egg" extension. `names`, if provided, should be a sequence of path name parts "under" the egg's extraction location. This method should only be called by resource providers that need to obtain an extraction location, and only for names they intend to extract, as it tracks the generated names for possible cleanup later.
Definition at line 1263 of file __init__.py.
postprocess | ( | self, | |
tempname, | |||
filename | |||
) |
Perform any platform-specific postprocessing of `tempname` This is where Mac header rewrites should be done; other platforms don't have anything special they should do. Resource providers should call this method ONLY after successfully extracting a compressed resource. They must NOT call it on resources that are already in the filesystem. `tempname` is the current (temporary) name of the file, and `filename` is the name it will be renamed to by the caller after this routine returns.
Definition at line 1315 of file __init__.py.
resource_exists | ( | self, | |
package_or_requirement, | |||
resource_name | |||
) |
Does the named resource exist?
Definition at line 1203 of file __init__.py.
resource_filename | ( | self, | |
package_or_requirement, | |||
resource_name | |||
) |
Return a true filesystem path for specified resource
Definition at line 1211 of file __init__.py.
resource_isdir | ( | self, | |
package_or_requirement, | |||
resource_name | |||
) |
Is the named resource an existing directory?
Definition at line 1207 of file __init__.py.
resource_listdir | ( | self, | |
package_or_requirement, | |||
resource_name | |||
) |
List the contents of the named resource directory
Definition at line 1229 of file __init__.py.
resource_stream | ( | self, | |
package_or_requirement, | |||
resource_name | |||
) |
Return a readable file-like object for specified resource
Definition at line 1217 of file __init__.py.
resource_string | ( | self, | |
package_or_requirement, | |||
resource_name | |||
) |
Return specified resource as a string
Definition at line 1223 of file __init__.py.
set_extraction_path | ( | self, | |
path | |||
) |
Set the base path where resources will be extracted to, if needed. If you do not call this routine before any extractions take place, the path defaults to the return value of ``get_default_cache()``. (Which is based on the ``PYTHON_EGG_CACHE`` environment variable, with various platform-specific fallbacks. See that routine's documentation for more details.) Resources are extracted to subdirectories of this path based upon information given by the ``IResourceProvider``. You may set this to a temporary directory, but then you must call ``cleanup_resources()`` to delete the extracted files when done. There is no guarantee that ``cleanup_resources()`` will be able to remove all extracted files. (Note: you may not change the extraction path for a given resource manager once resources have been extracted, unless you first call ``cleanup_resources()``.)
Definition at line 1335 of file __init__.py.
cached_files |
Definition at line 1201 of file __init__.py.
|
static |
Set the base path where resources will be extracted to, if needed. If you do not call this routine before any extractions take place, the path defaults to the return value of ``get_default_cache()``. (Which is based on the ``PYTHON_EGG_CACHE`` environment variable, with various platform-specific fallbacks. See that routine's documentation for more details.) Resources are extracted to subdirectories of this path based upon information given by the ``IResourceProvider``. You may set this to a temporary directory, but then you must call ``cleanup_resources()`` to delete the extracted files when done. There is no guarantee that ``cleanup_resources()`` will be able to remove all extracted files. (Note: you may not change the extraction path for a given resource manager once resources have been extracted, unless you first call ``cleanup_resources()``.)
Definition at line 1198 of file __init__.py.