Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
pip._vendor.distlib.database.InstalledDistribution Class Reference
Inheritance diagram for pip._vendor.distlib.database.InstalledDistribution:
Inheritance graph
[legend]
Collaboration diagram for pip._vendor.distlib.database.InstalledDistribution:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self, path, metadata=None, env=None)
 
 __repr__ (self)
 
 __str__ (self)
 
 exports (self)
 
 read_exports (self)
 
 write_exports (self, exports)
 
 get_resource_path (self, relative_path)
 
 list_installed_files (self)
 
 write_installed_files (self, paths, prefix, dry_run=False)
 
 check_installed_files (self)
 
 shared_locations (self)
 
 write_shared_locations (self, paths, dry_run=False)
 
 get_distinfo_resource (self, path)
 
 get_distinfo_file (self, path)
 
 list_distinfo_files (self)
 
 __eq__ (self, other)
 
- Public Member Functions inherited from pip._vendor.distlib.database.BaseInstalledDistribution
 get_hash (self, data, hasher=None)
 
- Public Member Functions inherited from pip._vendor.distlib.database.Distribution
 source_url (self)
 
 name_and_version (self)
 
 provides (self)
 
 run_requires (self)
 
 meta_requires (self)
 
 build_requires (self)
 
 test_requires (self)
 
 dev_requires (self)
 
 matches_requirement (self, req)
 
 __hash__ (self)
 

Public Attributes

 modules
 
 finder
 
 requested
 
 name
 
 version
 
 path
 
- Public Attributes inherited from pip._vendor.distlib.database.BaseInstalledDistribution
 path
 
 dist_path
 
- Public Attributes inherited from pip._vendor.distlib.database.Distribution
 metadata
 
 name
 
 key
 
 version
 
 locator
 
 digest
 
 extras
 
 context
 
 download_urls
 
 digests
 
 source_url
 

Static Public Attributes

str hasher = 'sha256'
 
- Static Public Attributes inherited from pip._vendor.distlib.database.BaseInstalledDistribution
 hasher = None
 
- Static Public Attributes inherited from pip._vendor.distlib.database.Distribution
bool build_time_dependency = False
 
bool requested = False
 
 download_url = source_url
 

Protected Member Functions

 _get_records (self)
 
- Protected Member Functions inherited from pip._vendor.distlib.database.Distribution
 _get_requirements (self, req_attr)
 

Detailed Description

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).

Constructor & Destructor Documentation

◆ __init__()

pip._vendor.distlib.database.InstalledDistribution.__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 pip._vendor.distlib.database.BaseInstalledDistribution.

Member Function Documentation

◆ __eq__()

pip._vendor.distlib.database.InstalledDistribution.__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 pip._vendor.distlib.database.Distribution.

◆ __repr__()

pip._vendor.distlib.database.InstalledDistribution.__repr__ (   self)
Return a textual representation of this instance,

Reimplemented from pip._vendor.distlib.database.Distribution.

◆ _get_records()

pip._vendor.distlib.database.InstalledDistribution._get_records (   self)
protected
Get the list of installed files for the distribution
:return: A list of tuples of path, hash and size. Note that hash and
         size might be ``None`` for some entries. The path is exactly
         as stored in the file (which is as in PEP 376).

◆ check_installed_files()

pip._vendor.distlib.database.InstalledDistribution.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.

◆ exports()

pip._vendor.distlib.database.InstalledDistribution.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.

◆ get_distinfo_file()

pip._vendor.distlib.database.InstalledDistribution.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

◆ get_resource_path()

pip._vendor.distlib.database.InstalledDistribution.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.

◆ list_distinfo_files()

pip._vendor.distlib.database.InstalledDistribution.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

◆ list_installed_files()

pip._vendor.distlib.database.InstalledDistribution.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)

◆ read_exports()

pip._vendor.distlib.database.InstalledDistribution.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.

◆ shared_locations()

pip._vendor.distlib.database.InstalledDistribution.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.

◆ write_exports()

pip._vendor.distlib.database.InstalledDistribution.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.

◆ write_installed_files()

pip._vendor.distlib.database.InstalledDistribution.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.

◆ write_shared_locations()

pip._vendor.distlib.database.InstalledDistribution.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.

The documentation for this class was generated from the following file: