Orbits  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes | List of all members
pip._vendor.distlib.database.InstalledDistribution Class Reference
Inheritance diagram for pip._vendor.distlib.database.InstalledDistribution:
pip._vendor.distlib.database.BaseInstalledDistribution pip._vendor.distlib.database.Distribution _object

Public Member Functions

def __init__
 
def __repr__
 
def __str__
 
def exports
 
def read_exports
 
def write_exports
 
def get_resource_path
 
def list_installed_files
 
def write_installed_files
 
def check_installed_files
 
def shared_locations
 
def write_shared_locations
 
def get_distinfo_resource
 
def get_distinfo_file
 
def list_distinfo_files
 
def __eq__
 
- Public Member Functions inherited from pip._vendor.distlib.database.BaseInstalledDistribution
def __init__
 
def get_hash
 
- Public Member Functions inherited from pip._vendor.distlib.database.Distribution
def __init__
 
def source_url
 
def name_and_version
 
def provides
 
def run_requires
 
def meta_requires
 
def build_requires
 
def test_requires
 
def dev_requires
 
def matches_requirement
 
def __repr__
 
def __eq__
 
def __hash__
 

Public Attributes

 finder
 
 requested
 
 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
 
 source_url
 

Static Public Attributes

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

Private Member Functions

def _get_records
 

Static Private Attributes

 __hash__ = object.__hash__
 

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

def pip._vendor.distlib.database.InstalledDistribution.__init__ (   self,
  path,
  metadata = None,
  env = None 
)

Member Function Documentation

def pip._vendor.distlib.database.InstalledDistribution.__eq__ (   self,
  other 
)
def pip._vendor.distlib.database.InstalledDistribution.__repr__ (   self)
def pip._vendor.distlib.database.InstalledDistribution.__str__ (   self)
def pip._vendor.distlib.database.InstalledDistribution._get_records (   self)
private
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).
def 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.
def 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.
def 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
def pip._vendor.distlib.database.InstalledDistribution.get_distinfo_resource (   self,
  path 
)
def 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.
def 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
def 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)
def 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.
def 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.
def 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.
def 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.
def 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.

Member Data Documentation

pip._vendor.distlib.database.InstalledDistribution.__hash__ = object.__hash__
staticprivate
pip._vendor.distlib.database.InstalledDistribution.finder
string pip._vendor.distlib.database.InstalledDistribution.hasher = 'sha256'
static
pip._vendor.distlib.database.InstalledDistribution.path
pip._vendor.distlib.database.InstalledDistribution.requested

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

Copyright 2014 Google Inc. All rights reserved.