vcs 0.4.0 documentation
This module provides some useful tools for vcs like annotate/diff html output. It also includes some internal helpers.
Public API
Private API
Returns html portion containing annotated table with 3 columns: line numbers, changeset information and pygmentized line of code.
Parameters: |
|
---|
Give it a unified diff and it returns a list of the files that were mentioned in the diff together with a dict of meta information that can be used to render it in a HTML template.
Parameters: |
|
---|
Return udiff as html table with customized css classes
make a fresh copy of generator, we should not iterate thru an original as it’s needed for repeating operations on this instance of DiffProcessor
Prepare the passed udiff for HTML rendering. It’l return a list of dicts
Returns raw string as udiff
Returns tuple of adde,and removed lines for this instance
Returns git style diff between given filenode_old and filenode_new.
Parameters: | ignore_whitespace – ignore whitespaces in diff |
---|
Returns unified diff between given filenode_old and filenode_new.
Utitlites aimed to help achieve mostly basic tasks.
Returns dictionary for each attribute from given obj.
If pygments are available on the system then returned output is colored. Otherwise unchanged content is returned.
Returns path’s subdirectories which seems to be a repository.
Returns one of alias from ALIASES (in order of precedence same as shortcuts given in ALIASES) and top working dir path for the given argument. If no scm-specific directory is found or more than one scm is found at that directory, VCSError is raised.
Parameters: |
|
---|
Returns all scm’s found at the given path. If no scm is recognized - empty list is returned.
Parameters: | path – path to directory which should be checked. May be callable. |
---|---|
Raises VCSError: | |
if given path is not a directory |
Backported for Python 2.5.
Returns dictionary with start, main and end ids.
Examples:
>>> parse_changesets('aaabbb')
{'start': None, 'main': 'aaabbb', 'end': None}
>>> parse_changesets('aaabbb..cccddd')
{'start': 'aaabbb', 'main': None, 'end': 'cccddd'}
Parses given text and returns datetime.datetime instance or raises ValueError.
Parameters: | text – string of desired date/datetime or something more verbose, like yesterday, 2weeks 3days, etc. |
---|
Runs command on the system with given args.
Decorator for easier creation of property from potentially expensive to calculate attribute of the class.
Usage:
class Foo(object):
@LazyProperty
def bar(self):
print 'Calculating self._bar'
return 42
Taken from http://blog.pythonisito.com/2008/08/lazy-descriptors.html and used widely.
Same as above but uses thread local dict for cache storage.