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 mercurial style git diff between given filenode_old and filenode_new.
Returns unified diff between given filenode_old and filenode_new.
Utitlites aimed to help achieve mostly basic tasks.
If pygments are available on the system then returned output is colored. Otherwise unchanged content is returned.
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, VCSError is raised unless search_recursively is set to True - in that case, function would try to find scm starting at given path and moving up. If we can’t go up any further, VCSError is raised.
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.