comparison publish.py @ 11:231e3317477d

More version reporting test.py -> test-svn.py publish.py now generates test.py rather than test-pub.py actually added $Rev$ to test-svn.py's properties
author Oleg Oshmyan <chortos@inbox.lv>
date Fri, 12 Mar 2010 23:59:26 +0000
parents c87ec78f1fae
children a2c9f7cfa174
comparison
equal deleted inserted replaced
10:c87ec78f1fae 11:231e3317477d
1 #! /usr/bin/python 1 #! /usr/bin/python
2 # Copyright (c) 2009-2010 Chortos-2 <chortos@inbox.lv> 2 # Copyright (c) 2009-2010 Chortos-2 <chortos@inbox.lv>
3 3
4 with open('test.py') as t: 4 with open('test-svn.py') as t:
5 f = t.read() 5 f = t.read()
6 i = f.find('# $Rev: ') 6 i = f.find('# $Rev: ')
7 j = f.find('\n', i) 7 j = f.find('\n', i)
8 rev = f[i+8:j-1] 8 rev = f[i+8:j-1]
9 f = f[0:i] + f[j+1:] 9 f = f[0:i] + f[j+1:]
10 f = f.replace('$$REV$$', rev) 10 f = f.replace('$$REV$$', rev)
11 with open('test-pub.py', 'wb') as t: 11 with open('test.py', 'wb') as t:
12 t.write(f) 12 t.write(f)