Move setting of ioready 'wait' earlier in call chain, to
[python/dscho.git] / Mac / Modules / htmlrender / htmlscan.py
blob81f107c2b1b2d46e79e2680f236ea318f0329d7b
1 # Scan an Apple header file, generating a Python file of generator calls.
3 import sys
4 import os
5 from bgenlocations import TOOLBOXDIR, BGENDIR
6 sys.path.append(BGENDIR)
8 from scantools import Scanner
10 LONG = "HtmlRendering"
11 SHORT = "html"
12 OBJECT = "HRReference"
14 def main():
15 ## input = LONG + ".h"
16 input = "Macintosh HD:ufs:jack:SWdev:Universal:Interfaces:CIncludes:HTMLRendering.h"
17 output = SHORT + "gen.py"
18 defsoutput = TOOLBOXDIR + LONG + ".py"
19 scanner = MyScanner(input, output, defsoutput)
20 scanner.scan()
21 scanner.close()
22 print "=== Testing definitions output code ==="
23 execfile(defsoutput, {}, {})
24 print "=== Done scanning and generating, now importing the generated code... ==="
25 exec "import " + SHORT + "support"
26 print "=== Done. It's up to you to compile it now! ==="
28 class MyScanner(Scanner):
30 def destination(self, type, name, arglist):
31 classname = "Function"
32 listname = "functions"
33 if arglist:
34 t, n, m = arglist[0]
35 if t == OBJECT and m == "InMode":
36 classname = "Method"
37 listname = "methods"
38 return classname, listname
40 def makeblacklistnames(self):
41 return [
42 "HRDisposeReference",
45 def makeblacklisttypes(self):
46 return [
47 "HRNewURLUPP",
48 "HRURLToFSSpecUPP",
49 "HRWasURLVisitedUPP",
52 def makerepairinstructions(self):
53 return [
54 ([('char', '*', 'OutMode'), ('UInt32', '*', 'InMode')],
55 [('InBuffer', '*', 'InMode')]),
58 def writeinitialdefs(self):
59 self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
62 if __name__ == "__main__":
63 main()