Package csb :: Module build :: Class RevisionHandler
[frames] | no frames]

Class RevisionHandler

source code

object --+
         |
        RevisionHandler

Determines the current SVN revision number of a working copy.

Instance Methods
 
__init__(self, path, svn='svn')
x.__init__(...) initializes x; see help(type(x)) for signature
source code
RevisionInfo
read(self)
Return the current revision information.
source code
 
write(self, revision, sourcefile)
Finalize the __version__ = major.minor.micro.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, path, svn='svn')
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • path (str) - a local checkout path to be examined
  • svn (str) - name of the svn program
Overrides: object.__init__
(inherited documentation)

read(self)

source code 

Return the current revision information.

Returns: RevisionInfo

To Do: we can easily extend the svn output parser to grab more attributes, say URL, author, etc. RevisionInfo would also has to be extended

write(self, revision, sourcefile)

source code 

Finalize the __version__ = major.minor.micro.{revision} tag. Overwrite sourcefile in place by substituting the {revision} macro.

Parameters:
  • revision (int) - revision number to write to the source file.
  • sourcefile (str) - python source file with a __version__ tag, typically "csb/__init__.py"
Returns:
sourcefile.__version__