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

Public Member Functions

def __init__
 
def findall
 
def add
 
def add_many
 
def sorted
 
def clear
 
def process_directive
 

Public Attributes

 base
 
 prefix
 
 allfiles
 
 files
 

Private Member Functions

def _parse_directive
 
def _include_pattern
 
def _exclude_pattern
 
def _translate_pattern
 
def _glob_to_re
 

Detailed Description

A list of files built by on exploring the filesystem and filtered by
applying various patterns to what we find there.

Constructor & Destructor Documentation

def pip._vendor.distlib.manifest.Manifest.__init__ (   self,
  base = None 
)
Initialise an instance.

:param base: The base directory to explore under.

Member Function Documentation

def pip._vendor.distlib.manifest.Manifest._exclude_pattern (   self,
  pattern,
  anchor = True,
  prefix = None,
  is_regex = False 
)
private
Remove strings (presumably filenames) from 'files' that match
'pattern'.

Other parameters are the same as for 'include_pattern()', above.
The list 'self.files' is modified in place. Return True if files are
found.

This API is public to allow e.g. exclusion of SCM subdirs, e.g. when
packaging source distributions
def pip._vendor.distlib.manifest.Manifest._glob_to_re (   self,
  pattern 
)
private
Translate a shell-like glob pattern to a regular expression.

Return a string containing the regex.  Differs from
'fnmatch.translate()' in that '*' does not match "special characters"
(which are platform-specific).
def pip._vendor.distlib.manifest.Manifest._include_pattern (   self,
  pattern,
  anchor = True,
  prefix = None,
  is_regex = False 
)
private
Select strings (presumably filenames) from 'self.files' that
match 'pattern', a Unix-style wildcard (glob) pattern.

Patterns are not quite the same as implemented by the 'fnmatch'
module: '*' and '?'  match non-special characters, where "special"
is platform-dependent: slash on Unix; colon, slash, and backslash on
DOS/Windows; and colon on Mac OS.

If 'anchor' is true (the default), then the pattern match is more
stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
'anchor' is false, both of these will match.

If 'prefix' is supplied, then only filenames starting with 'prefix'
(itself a pattern) and ending with 'pattern', with anything in between
them, will match.  'anchor' is ignored in this case.

If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
'pattern' is assumed to be either a string containing a regex or a
regex object -- no translation is done, the regex is just compiled
and used as-is.

Selected strings will be added to self.files.

Return True if files are found.
def pip._vendor.distlib.manifest.Manifest._parse_directive (   self,
  directive 
)
private
Validate a directive.
:param directive: The directive to validate.
:return: A tuple of action, patterns, thedir, dir_patterns
def pip._vendor.distlib.manifest.Manifest._translate_pattern (   self,
  pattern,
  anchor = True,
  prefix = None,
  is_regex = False 
)
private
Translate a shell-like wildcard pattern to a compiled regular
expression.

Return the compiled regex.  If 'is_regex' true,
then 'pattern' is directly compiled to a regex (if it's a string)
or just returned as-is (assumes it's a regex object).
def pip._vendor.distlib.manifest.Manifest.add (   self,
  item 
)
Add a file to the manifest.

:param item: The pathname to add. This can be relative to the base.
def pip._vendor.distlib.manifest.Manifest.add_many (   self,
  items 
)
Add a list of files to the manifest.

:param items: The pathnames to add. These can be relative to the base.
def pip._vendor.distlib.manifest.Manifest.clear (   self)
Clear all collected files.
def pip._vendor.distlib.manifest.Manifest.findall (   self)
Find all files under the base and set ``allfiles`` to the absolute
pathnames of files found.
def pip._vendor.distlib.manifest.Manifest.process_directive (   self,
  directive 
)
Process a directive which either adds some files from ``allfiles`` to
``files``, or removes some files from ``files``.

:param directive: The directive to process. This should be in a format
     compatible with distutils ``MANIFEST.in`` files:

     http://docs.python.org/distutils/sourcedist.html#commands
def pip._vendor.distlib.manifest.Manifest.sorted (   self,
  wantdirs = False 
)
Return sorted files in directory order

Member Data Documentation

pip._vendor.distlib.manifest.Manifest.allfiles
pip._vendor.distlib.manifest.Manifest.base
pip._vendor.distlib.manifest.Manifest.files
pip._vendor.distlib.manifest.Manifest.prefix

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

Copyright 2014 Google Inc. All rights reserved.