annotate 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
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 #!/usr/bin/env python
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 # -*- coding: iso-8859-1 -*-
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
4 MoinMoin - Version Information
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
5
363
89d0a178964a 1.5.0 release final changes: updated docs, i18n, underlay, interwiki. fixed SystemAdmin macro to use cfg.superuser.
Thomas Waldmann <tw@waldmann-edv.de>
parents: 337
diff changeset
6 @copyright: 2000-2006 by Jürgen Hermann <jh@web.de>
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
7 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
8 """
491
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
9 import sys
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
10
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
11 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
12 from patchlevel import patchlevel
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
13 except:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
14 patchlevel = 'release'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
15
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16 project = "MoinMoin"
431
2bdb90aa1005 release 1.5.2
Thomas Waldmann <tw@waldmann-edv.de>
parents: 421
diff changeset
17 release = '1.5.2'
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
18 revision = patchlevel
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
19
491
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
20 def update():
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
21 """ update the version information in package init """
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
22 fname = 'MoinMoin/__init__.py'
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
23 f = file(fname)
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
24 lines = f.readlines()
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
25 f.close()
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
26 f = file(fname, "w")
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
27 version_pattern = "%s Version " % project
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
28 version_string = version_pattern + "%s %s" % (release, revision)
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
29 for line in lines:
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
30 if version_pattern in line:
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
31 f.write("%s\n" % version_string)
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
32 else:
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
33 f.write(line)
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
34 f.close()
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
35
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
36 if __name__ == '__main__':
491
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
37 if len(sys.argv) > 1 and sys.argv[1] == "update":
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
38 update()
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
39 else:
be33ecd58d4e add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc
Thomas Waldmann <tw@waldmann-edv.de>
parents: 431
diff changeset
40 print project, release, revision
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
41