blob: 025d0a2372041f4810913d5799ff0fe1a83a60a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!/usr/bin/python
import string
import os,sys
import re
import StringIO
library = os.getcwd().split('/')[-1]
print "current library: " + library + "\n"
for root, dirs, files in os.walk('.'):
dirs.remove('.svn')
# print "root: " + root
for name in files:
m = re.search(".*-help\.pd$", name)
if m:
helppatch = os.path.join(root, m.string)
fd = open(helppatch, 'r')
contents = fd.readlines()
fd.close()
firstline = contents[0]
contents.remove(firstline)
# fd = open(helppatch + ".new", 'w')
print helppatch
fd = open(helppatch, 'w')
fd.write(firstline)
fd.write("#X declare -lib " + library.lower() + ";\n")
fd.writelines(contents)
fd.close()
|