Back to index

moin  1.9.0~rc2
version.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- coding: iso-8859-1 -*-
00003 """
00004     MoinMoin - Version Information
00005 
00006     @copyright: 2000-2006 Juergen Hermann <jh@web.de>,
00007                 2003-2009 MoinMoin:ThomasWaldmann
00008     @license: GNU GPL, see COPYING for details.
00009 """
00010 import sys
00011 
00012 try:
00013     from MoinMoin.patchlevel import patchlevel
00014 except:
00015     patchlevel = 'release'
00016 
00017 project = "MoinMoin"
00018 release = '1.9.0rc2'
00019 release_short = '190' # used for url_prefix_static
00020 revision = patchlevel
00021 
00022 def update():
00023     """ update the version information in package init """
00024     fname = 'MoinMoin/__init__.py'
00025     f = file(fname)
00026     lines = f.readlines()
00027     f.close()
00028     f = file(fname, "w")
00029     version_pattern = "%s Version " % project
00030     version_string = version_pattern + "%s %s" % (release, revision)
00031     for line in lines:
00032         if version_pattern in line:
00033             f.write("%s\n" % version_string)
00034         else:
00035             f.write(line)
00036     f.close()
00037 
00038 if __name__ == '__main__':
00039     if len(sys.argv) > 1 and sys.argv[1] == "update":
00040         update()
00041     else:
00042         print project, release, revision
00043