Attachment 'brushes.py'
Download
Toggle line numbers
1 #!/usr/bin/python
2 '''
3 Created on 4.12.2010
4
5 @author: klavdij
6 '''
7
8 import os.path
9 import sys
10
11 def callb(arg, dirname, fnames):
12 for fname in fnames:
13 ext = os.path.splitext(fname)[1]
14 if ext == '.myb':
15 fullname = os.path.join(dirname, fname)
16 print fullname, '...',
17 lines = open(fullname).readlines()
18 for i in xrange(len(lines)):
19 if lines[i].startswith('slow_tracking_per_dab'):
20 lines[i] = 'slow_tracking_per_dab 0.0\n'
21 elif lines[i].startswith('slow_tracking'):
22 lines[i] = 'slow_tracking 0.0\n'
23 open(fullname, 'w').writelines(lines)
24 print ' ok'
25
26 if len(sys.argv) < 2:
27 print 'Usage: brushes.py topdir'
28 sys.exit(1)
29
30 dirname = sys.argv[1]
31 os.path.walk(dirname, callb, None)
32 print 'Done'
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.