/[ascend]/trunk/tcltk98/generic/interface/fixmissing.py
ViewVC logotype

Contents of /trunk/tcltk98/generic/interface/fixmissing.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 523 - (show annotations) (download) (as text)
Fri Apr 21 07:25:02 2006 UTC (16 years, 1 month ago) by johnpye
File MIME type: text/x-python
File size: 636 byte(s)
This was the script used to add missing symbols to the library. Maybe it will be useful again sometime.
1
2 missing = file('missing.txt').read().strip().split('\n')
3 print "FIXING",len(missing),"SYMBOL DECLARATIONS"
4
5 import re
6 pattern = '^extern (.*)\\b('+"|".join(missing)+')\\b'
7 #pattern = '^extern (.*) (BitListEmpty)\('
8 patt = re.compile(pattern, re.M)
9
10
11 print "PATTERN =",pattern
12
13 import glob
14 import os.path
15
16 files = [os.path.normpath(p) for p in glob.glob("../../../base/generic/*/*.h")]
17 #files = ['testfile.h']
18
19 import fileinput
20
21 n=0
22 for f in files:
23 s = file(f).read()
24 if patt.search(s):
25 print "MATCHED IN",f
26 s = patt.sub('ASC_DLLSPEC(\\1) \\2',s)
27 n += 1
28 fp = open(f,'w')
29 fp.write(s)
30 fp.close()
31
32 print "MATCHED",n,"FILES"

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22