Revert "Add documentation of ":" and "dashed" bar types."
[lilypond.git] / buildscripts / pytt.py
blob1026c02bf7b06dafbced04566ed1b787327f9ff0
1 #! @PYTHON@
3 import os
4 import re
5 import sys
7 frm = re.compile (sys.argv[1], re.MULTILINE)
8 to = sys.argv[2]
10 if not sys.argv[3:] or sys.argv[3] == '-':
11 sys.stdout.write (re.sub (frm, to, sys.stdin.read ()))
12 for file in sys.argv[3:]:
13 s = open (file).read ()
14 name = os.path.basename (file)
15 base, ext = os.path.splitext (name)
16 t = re.sub (frm, to % locals (), s)
17 if s != t:
18 if 1:
19 os.system ('mv %(file)s %(file)s~~' % locals ())
20 h = open (file, "w")
21 h.write (t)
22 h.close ()
23 else:
24 sys.stdout.write (t)