diff MoinMoin/version.py @ 491:be33ecd58d4e

add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc imported from: moin--main--1.5--patch-495
author Thomas Waldmann <tw@waldmann-edv.de>
date Wed, 22 Mar 2006 09:55:32 +0000
parents 2bdb90aa1005
children 400516d5adc3
line wrap: on
line diff
--- a/MoinMoin/version.py	Wed Mar 22 09:03:08 2006 +0000
+++ b/MoinMoin/version.py	Wed Mar 22 09:55:32 2006 +0000
@@ -6,6 +6,7 @@
     @copyright: 2000-2006 by Jürgen Hermann <jh@web.de>
     @license: GNU GPL, see COPYING for details.
 """
+import sys
 
 try:
     from patchlevel import patchlevel
@@ -16,6 +17,25 @@
 release  = '1.5.2'
 revision = patchlevel
 
+def update():
+    """ update the version information in package init """
+    fname = 'MoinMoin/__init__.py'
+    f = file(fname)
+    lines = f.readlines()
+    f.close()
+    f = file(fname, "w")
+    version_pattern = "%s Version " % project
+    version_string = version_pattern + "%s %s" % (release, revision)
+    for line in lines:
+        if version_pattern in line:
+            f.write("%s\n" % version_string)
+        else:
+            f.write(line)
+    f.close()
+
 if __name__ == '__main__':
-    print project, release, revision
+    if len(sys.argv) > 1 and sys.argv[1] == "update":
+        update()
+    else:
+        print project, release, revision