1#!/usr/bin/env python 2# -*- coding: iso-8859-1 -*- 3""" 4 MoinMoin - Version Information 5 6 @copyright: 2000-2006 Juergen Hermann <jh@web.de>, 7 2003-2020 MoinMoin:ThomasWaldmann 8 @license: GNU GPL, see COPYING for details. 9""" 10import sys 11 12try: 13 from MoinMoin.patchlevel import patchlevel 14except: 15 patchlevel = 'release' 16 17project = "MoinMoin" 18release = '1.9.11' 19release_short = '1911' # used for url_prefix_static 20revision = patchlevel 21 22def update(): 23 """ update the version information in package init """ 24 fname = 'MoinMoin/__init__.py' 25 f = file(fname) 26 lines = f.readlines() 27 f.close() 28 f = file(fname, "w") 29 version_pattern = "%s Version " % project 30 version_string = version_pattern + "%s %s" % (release, revision) 31 for line in lines: 32 if version_pattern in line: 33 f.write("%s\n" % version_string) 34 else: 35 f.write(line) 36 f.close() 37 38if __name__ == '__main__': 39 if len(sys.argv) > 1 and sys.argv[1] == "update": 40 update() 41 else: 42 print project, release, revision 43