~qcumber-some/widelands/bug1197429

« back to all changes in this revision

Viewing changes to utils/replace.py

  • Committer: sirver
  • Date: 2005-11-07 20:42:37 UTC
  • Revision ID: git-v1:4389943402547e2a672839ffe0633c0bfb61492d
- added 2 scripts needed for localisation
- added 1 script to replace a string in a file ( which is need fairly often )


git-svn-id: https://widelands.svn.sourceforge.net/svnroot/widelands/trunk@949 37b2a8de-5219-0410-9f54-a31bc463ab9c

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python -tt
 
2
 
 
3
import sys
 
4
import os
 
5
 
 
6
expr = sys.argv[1]
 
7
files = sys.argv[2:]
 
8
 
 
9
for file in files:
 
10
    os.system("cat '%s' | sed '%s' > /tmp/tmpfile" % ( file, expr ));
 
11
    os.system("mv /tmp/tmpfile '%s'" % file );
 
12