blob: 472fb27f207b981fb4417bfce1e42ca1103a0d0b (
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
32
33
34
|
#!/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('.'):
try:
dirs.remove('.svn')
except:
pass
# 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()
|