update_revnum.py
14 lines
| 355 B
| text/x-python
|
PythonLexer
/ tools / update_revnum.py
ville
|
r988 | #!/usr/bin/env python | ||
""" Change the revision number in Release.py """ | ||||
import os | ||||
import re | ||||
Ville M. Vainio
|
r1051 | rev = os.popen('bzr revno').read().strip() | ||
ville
|
r988 | |||
print "current rev is",rev | ||||
assert ':' not in rev | ||||
Ville M. Vainio
|
r1052 | rfile = open('../IPython/Release.py','rb').read() | ||
ville
|
r988 | newcont = re.sub(r'revision\s*=.*', "revision = '%s'" % rev, rfile) | ||
Ville M. Vainio
|
r1052 | open('../IPython/Release.py','wb').write(newcont) | ||