OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, path, metadata=None, env=None) |
def | __repr__ (self) |
def | __str__ (self) |
def | exports (self) |
def | read_exports (self) |
def | write_exports (self, exports) |
def | get_resource_path (self, relative_path) |
def | list_installed_files (self) |
def | write_installed_files (self, paths, prefix, dry_run=False) |
def | check_installed_files (self) |
def | shared_locations (self) |
def | write_shared_locations (self, paths, dry_run=False) |
def | get_distinfo_resource (self, path) |
def | get_distinfo_file (self, path) |
def | list_distinfo_files (self) |
def | __eq__ (self, other) |
![]() | |
def | get_hash (self, data, hasher=None) |
![]() | |
def | __init__ (self, metadata) |
def | source_url (self) |
def | name_and_version (self) |
def | provides (self) |
def | run_requires (self) |
def | meta_requires (self) |
def | build_requires (self) |
def | test_requires (self) |
def | dev_requires (self) |
def | matches_requirement (self, req) |
def | __hash__ (self) |
Data Fields | |
modules | |
finder | |
requested | |
path | |
![]() | |
path | |
dist_path | |
![]() | |
metadata | |
name | |
key | |
version | |
locator | |
digest | |
extras | |
context | |
download_urls | |
digests | |
source_url | |
Static Public Attributes | |
hasher | |
![]() | |
hasher | |
![]() | |
build_time_dependency | |
requested | |
download_url | |
Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used).
def __init__ | ( | self, | |
metadata, | |||
path = None , |
|||
env = None |
|||
) |
Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found.
Reimplemented from BaseInstalledDistribution.
def __eq__ | ( | self, | |
other | |||
) |
See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False.
Reimplemented from Distribution.
def __repr__ | ( | self | ) |
Return a textual representation of this instance,
Reimplemented from Distribution.
def __str__ | ( | self | ) |
def check_installed_files | ( | self | ) |
Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value.
def exports | ( | self | ) |
Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name.
def get_distinfo_file | ( | self, | |
path | |||
) |
Returns a path located under the ``.dist-info`` directory. Returns a string representing the path. :parameter path: a ``'/'``-separated path relative to the ``.dist-info`` directory or an absolute path; If *path* is an absolute path and doesn't start with the ``.dist-info`` directory path, a :class:`DistlibException` is raised :type path: str :rtype: str
def get_distinfo_resource | ( | self, | |
path | |||
) |
def get_resource_path | ( | self, | |
relative_path | |||
) |
NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found.
def list_distinfo_files | ( | self | ) |
Iterates over the ``RECORD`` entries and returns paths for each line if the path is pointing to a file located in the ``.dist-info`` directory or one of its subdirectories. :returns: iterator of paths
def list_installed_files | ( | self | ) |
Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size)
def read_exports | ( | self | ) |
Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries.
def shared_locations | ( | self | ) |
A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory.
def write_exports | ( | self, | |
exports | |||
) |
Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries.
def write_installed_files | ( | self, | |
paths, | |||
prefix, | |||
dry_run = False |
|||
) |
Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths.
def write_shared_locations | ( | self, | |
paths, | |||
dry_run = False |
|||
) |
Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to.
finder |
|
static |
modules |
path |
requested |