view MoinMoin/version.py @ 1079:029754c52b11

Changed file format of meta file (\r\n line endings). Enhanced docstrings.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Fri, 28 Jul 2006 16:01:19 +0200
parents 141083b64fb1
children f37b49b6313d
line wrap: on
line source
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - Version Information

    @copyright: 2000-2006 by Jürgen Hermann <jh@web.de>
    @license: GNU GPL, see COPYING for details.
"""
import sys

try:
    from patchlevel import patchlevel
except:
    patchlevel = 'release'

project = "MoinMoin"
release = '1.6.0alpha'
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__':
    if len(sys.argv) > 1 and sys.argv[1] == "update":
        update()
    else:
        print project, release, revision