~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/versioninfo.py

  • Committer: Jonathan Lange
  • Date: 2011-02-18 16:02:56 UTC
  • mto: This revision was merged to the branch mainline in revision 12472.
  • Revision ID: jml@canonical.com-20110218160256-0s9ovj3mm0axh4g5
version.txt is unused.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
will have appropriate values from version_info.
21
21
 
22
22
If that file exists, and contains invalid Python, there will be an error when
23
 
this module is loaded.  This module is imported into
24
 
canonical/launchpad/__init__.py so that such errors are caught at start-up.
25
 
 
26
 
This module also reads version.txt at the top of the tree (i.e. a sibling of
27
 
bzr-version-info.py), which contains the Launchpad release number.  If that
28
 
file does not exist, we make something up.
 
23
this module is loaded.  This module is imported into lp/app/__init__.py so
 
24
that such errors are caught at start-up.
29
25
"""
30
26
 
31
27
__all__ = [
56
52
    revno = versioninfo.get('revno')
57
53
    date = versioninfo.get('date')
58
54
    branch_nick = versioninfo.get('branch_nick')
59
 
 
60
 
 
61
 
try:
62
 
    version_file = open('version.txt')
63
 
except IOError:
64
 
    release = 'x.y.z'
65
 
else:
66
 
    try:
67
 
        version_data = version_file.read()
68
 
        release = version_data.strip()
69
 
    finally:
70
 
        version_file.close()