Package pybaz :: Class ArchSourceTree
[frames | no frames]

Type ArchSourceTree

object --+                    
         |                    
basestring --+                
             |                
           str --+            
                 |            
          PathName --+        
                     |        
               DirName --+    
                         |    
                SourceTree --+
                             |
                            ArchSourceTree

Known Subclasses:
LibraryTree, WorkingTree

Abstract base class for Arch source trees.


Method Summary
  check_is_tree_root(self)

pathname.PathName

file_find(self, name, revision)
Find a pristine copy of a file for a given revision.

str

get_tag(self, name)
Read a file id set by an explicit id tag or tagline.
  get_tagging_method(self)
  get_tree(self)
  get_tree_version(self)
Default version of the tree, also called tree-version.
  inventory(self, *args, **kw)
Deprecated.

iterable of FileName, DirName, ArchSourceTree according to the arguments.

iter_inventory(self, source, precious, backups, junk, unrecognized, trees, directories, files, both, names, limit)
Tree inventory.

iterable of tuples (id, item), where item is FileName, DirName, ArchSourceTree according to the arguments and id is the associated inventory id.

iter_inventory_ids(self, source, precious, backups, junk, unrecognized, trees, directories, files, both, limit)
Tree inventory with file ids.
  iter_log_versions(self, limit, reverse)
Iterate over versions this tree has a log-version for.

iterator of Patchlog.

iter_logs(self, version, reverse)
Iterate over patchlogs present in this tree.
    Inherited from SourceTree
  __new__(cls, root)
Create a source tree object for the given root path. (Static method)
    Inherited from PathName
  __div__(self, path)
  __repr__(self)
  abspath(self)
  basename(self)
  dirname(self)
  realpath(self)
  splitname(self)
    Inherited from str
  __add__(x, y)
x.__add__(y) <==> x+y
  __contains__(x, y)
x.__contains__(y) <==> y in x
  __eq__(x, y)
x.__eq__(y) <==> x==y
  __ge__(x, y)
x.__ge__(y) <==> x>=y
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __getitem__(x, y)
x.__getitem__(y) <==> x[y]
  __getnewargs__(...)
  __getslice__(x, i, j)
Use of negative indices is not supported.
  __gt__(x, y)
x.__gt__(y) <==> x>y
  __hash__(x)
x.__hash__() <==> hash(x)
  __le__(x, y)
x.__le__(y) <==> x<=y
  __len__(x)
x.__len__() <==> len(x)
  __lt__(x, y)
x.__lt__(y) <==> x<y
  __mod__(x, y)
x.__mod__(y) <==> x%y
  __mul__(x, n)
x.__mul__(n) <==> x*n
  __ne__(x, y)
x.__ne__(y) <==> x!=y
  __rmod__(x, y)
x.__rmod__(y) <==> y%x
  __rmul__(x, n)
x.__rmul__(n) <==> n*x
  __str__(x)
x.__str__() <==> str(x)
  capitalize(S)
Return a copy of the string S with only its first character capitalized.
  center(S, width)
Return S centered in a string of length width.
  count(S, sub, start, end)
Return the number of occurrences of substring sub in string S[start:end].
  decode(S, encoding, errors)
Decodes S using the codec registered for encoding.
  encode(S, encoding, errors)
Encodes S using the codec registered for encoding.
  endswith(S, suffix, start, end)
Return True if S ends with the specified suffix, False otherwise.
  expandtabs(S, tabsize)
Return a copy of S where all tab characters are expanded using spaces.
  find(S, sub, start, end)
Return the lowest index in S where substring sub is found, such that sub is contained within s[start,end].
  index(S, sub, start, end)
Like S.find() but raise ValueError when the substring is not found.
  isalnum(S)
Return True if all characters in S are alphanumeric and there is at least one character in S, False otherwise.
  isalpha(S)
Return True if all characters in S are alphabetic and there is at least one character in S, False otherwise.
  isdigit(S)
Return True if all characters in S are digits and there is at least one character in S, False otherwise.
  islower(S)
Return True if all cased characters in S are lowercase and there is at least one cased character in S, False otherwise.
  isspace(S)
Return True if all characters in S are whitespace and there is at least one character in S, False otherwise.
  istitle(S)
Return True if S is a titlecased string and there is at least one character in S, i.e.
  isupper(S)
Return True if all cased characters in S are uppercase and there is at least one cased character in S, False otherwise.
  join(S, sequence)
Return a string which is the concatenation of the strings in the sequence.
  ljust(S, width)
Return S left justified in a string of length width.
  lower(S)
Return a copy of the string S converted to lowercase.
  lstrip(S, chars)
Return a copy of the string S with leading whitespace removed.
  replace(...)
S.replace (old, new[, count]) -> string
  rfind(S, sub, start, end)
Return the highest index in S where substring sub is found, such that sub is contained within s[start,end].
  rindex(S, sub, start, end)
Like S.rfind() but raise ValueError when the substring is not found.
  rjust(S, width)
Return S right justified in a string of length width.
  rstrip(S, chars)
Return a copy of the string S with trailing whitespace removed.
  split(S, sep, maxsplit)
Return a list of the words in the string S, using sep as the delimiter string.
  splitlines(S, keepends)
Return a list of the lines in S, breaking at line boundaries.
  startswith(S, prefix, start, end)
Return True if S starts with the specified prefix, False otherwise.
  strip(S, chars)
Return a copy of the string S with leading and trailing whitespace removed.
  swapcase(S)
Return a copy of the string S with uppercase characters converted to lowercase and vice versa.
  title(S)
Return a titlecased version of S, i.e.
  translate(S, table, deletechars)
Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256.
  upper(S)
Return a copy of the string S converted to uppercase.
  zfill(S, width)
Pad a numeric string S with zeros on the left, to fill a field of the specified width.
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Property Summary
  tagging_method
  tree_revision
  tree_version

Instance Method Details

file_find(self, name, revision)

Find a pristine copy of a file for a given revision.

Will create the requested revision in the library or in the current tree pristines if needed.

Parameters:
name -

name of the file.


           (type=

str

)
revision -

revision to look for the file into.


           (type=

Revision

)
Returns:

absolute path name of a pristine copy of the file.


           (type=

pathname.PathName

)
Raises:
errors.MissingFileError -

file is not source or is not present in the specified revision.

get_tag(self, name)

Read a file id set by an explicit id tag or tagline.

FIXME: update docstring when support for pybaz<1.3 is dropped, as this release fixed "baz id" to report name-based ids correctly.

Parameters:
name -

name of a source file relative to the tree-root.


           (type=

str

)
Returns:

file id if the file has an explicit id or a tagline.


           (type=

str

)

get_tree_version(self)

Default version of the tree, also called tree-version.

Raises:
errors.TreeVersionError -

no valid default version set.

IOError -

unable to read the ++default-version file.

inventory(self, *args, **kw)

Deprecated.

Inventory of the source tree as a list.

See Also:

iter_inventory

iter_inventory(self, source=False, precious=False, backups=False, junk=False, unrecognized=False, trees=False, directories=False, files=False, both=False, names=False, limit=None)

Tree inventory.

The kind of files looked for is specified by setting to True exactly one of the following keyword arguments:

source, precious, backups, junk, unrecognized, trees.

If the trees argument is not set, whether files, directory or both should be listed is specified by setting to True exactly one of the following keyword arguments:

directories, files, both.
Keyword Parameters:
source -

list source files only.

precious -

list precious files only.

backups -

list backup files only.

junk -

list junk files only.

unrecognized -

list unrecognized files only.

trees -

list nested trees only. If this is true, the iterator wil only yield ArchSourceTree objects.

directories -

list directories only, yield only FileName objects.

files -

list files only, yield only DirName objects.

both -

list both files and directories, yield both FileName and DirName objects.

name -

do inventory as if the id-tagging-method was set to names. That is useful to ignore untagged-source classification.

limit -

restrict the inventory to this directory. Must be the name of a directory relative to the tree root.

Returns:

iterable of FileName, DirName, ArchSourceTree according to the arguments.

iter_inventory_ids(self, source=False, precious=False, backups=False, junk=False, unrecognized=False, trees=False, directories=False, files=False, both=False, limit=None)

Tree inventory with file ids.

Returns:

iterable of tuples (id, item), where item is FileName, DirName, ArchSourceTree according to the arguments and id is the associated inventory id.

See Also:

ArchSourceTree.iter_inventory

iter_log_versions(self, limit=None, reverse=False)

Iterate over versions this tree has a log-version for.

Parameters:
limit -

only iterate log-versions in this namespace.


           (type=

Archive, Category, Branch, Version

)
reverse -

yield log-versions in reverse order.


           (type=

bool

)

iter_logs(self, version=None, reverse=False)

Iterate over patchlogs present in this tree.

Parameters:
version -

list patchlogs from this version. Defaults to the tree-version.


           (type=

Version

)
reverse -

iterate more recent logs first.


           (type=

bool

)
Returns:

patchlogs from version.


           (type=

iterator of Patchlog.

)
Raises:
errors.TreeVersionError -

no valid default version set.

IOError -

unable to read the ++default-version file.


Property Details

tagging_method

Get Method:
get_tagging_method(self)

tree_version

Get Method:
get_tree_version(self)

Generated by Epydoc 2.1 on Fri Jul 7 17:05:29 2006 http://epydoc.sf.net