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

Public Member Functions

def __init__
 
def can_add
 
def remove
 
def scan
 
def __getitem__
 
def add
 
def best_match
 
def obtain
 
def __iter__
 
def __iadd__
 
def __add__
 

Public Attributes

 platform
 
 python
 

Private Attributes

 _distmap
 
 _cache
 

Detailed Description

Searchable snapshot of distributions on a search path

Constructor & Destructor Documentation

def pip._vendor.pkg_resources.Environment.__init__ (   self,
  search_path = None,
  platform = get_supported_platform(),
  python = PY_MAJOR 
)
Snapshot distributions available on a search path

Any distributions found on `search_path` are added to the environment.
`search_path` should be a sequence of ``sys.path`` items.  If not
supplied, ``sys.path`` is used.

`platform` is an optional string specifying the name of the platform
that platform-specific distributions must be compatible with.  If
unspecified, it defaults to the current platform.  `python` is an
optional string naming the desired version of Python (e.g. ``'3.3'``);
it defaults to the current version.

You may explicitly set `platform` (and/or `python`) to ``None`` if you
wish to map *all* distributions, not just those compatible with the
running platform or Python version.

Member Function Documentation

def pip._vendor.pkg_resources.Environment.__add__ (   self,
  other 
)
Add an environment or distribution to an environment
def pip._vendor.pkg_resources.Environment.__getitem__ (   self,
  project_name 
)
Return a newest-to-oldest list of distributions for `project_name`
def pip._vendor.pkg_resources.Environment.__iadd__ (   self,
  other 
)
In-place addition of a distribution or environment
def pip._vendor.pkg_resources.Environment.__iter__ (   self)
Yield the unique project names of the available distributions
def pip._vendor.pkg_resources.Environment.add (   self,
  dist 
)
Add `dist` if we ``can_add()`` it and it isn't already added
def pip._vendor.pkg_resources.Environment.best_match (   self,
  req,
  working_set,
  installer = None 
)
Find distribution best matching `req` and usable on `working_set`

This calls the ``find(req)`` method of the `working_set` to see if a
suitable distribution is already active.  (This may raise
``VersionConflict`` if an unsuitable version of the project is already
active in the specified `working_set`.)  If a suitable distribution
isn't active, this method returns the newest distribution in the
environment that meets the ``Requirement`` in `req`.  If no suitable
distribution is found, and `installer` is supplied, then the result of
calling the environment's ``obtain(req, installer)`` method will be
returned.
def pip._vendor.pkg_resources.Environment.can_add (   self,
  dist 
)
Is distribution `dist` acceptable for this environment?

The distribution must match the platform and python version
requirements specified when this environment was created, or False
is returned.
def pip._vendor.pkg_resources.Environment.obtain (   self,
  requirement,
  installer = None 
)
Obtain a distribution matching `requirement` (e.g. via download)

Obtain a distro that matches requirement (e.g. via download).  In the
base ``Environment`` class, this routine just returns
``installer(requirement)``, unless `installer` is None, in which case
None is returned instead.  This method is a hook that allows subclasses
to attempt other ways of obtaining a distribution before falling back
to the `installer` argument.
def pip._vendor.pkg_resources.Environment.remove (   self,
  dist 
)
Remove `dist` from the environment
def pip._vendor.pkg_resources.Environment.scan (   self,
  search_path = None 
)
Scan `search_path` for distributions usable in this environment

Any distributions found are added to the environment.
`search_path` should be a sequence of ``sys.path`` items.  If not
supplied, ``sys.path`` is used.  Only distributions conforming to
the platform/python version defined at initialization are added.

Member Data Documentation

pip._vendor.pkg_resources.Environment._cache
private
pip._vendor.pkg_resources.Environment._distmap
private
pip._vendor.pkg_resources.Environment.platform
pip._vendor.pkg_resources.Environment.python

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

Copyright 2014 Google Inc. All rights reserved.