Mercurial > ~astiob > upreckon > hgweb
view publish.py @ 12:7c6f02865bf6
$Rev$ substitution hopefully works
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Sat, 13 Mar 2010 00:00:07 +0000 |
parents | 231e3317477d |
children | a2c9f7cfa174 |
line wrap: on
line source
#! /usr/bin/python # Copyright (c) 2009-2010 Chortos-2 <chortos@inbox.lv> with open('test-svn.py') as t: f = t.read() i = f.find('# $Rev: ') j = f.find('\n', i) rev = f[i+8:j-1] f = f[0:i] + f[j+1:] f = f.replace('$$REV$$', rev) with open('test.py', 'wb') as t: t.write(f)