Apparently the code to forestall Tk eating events was too aggressive (Tk user input...
[python/dscho.git] / Mac / Modules / htmlrender / htmlscan.py
blobdb6285869d0a4cf84b41d833109c937e628f65ce
1 # Scan an Apple header file, generating a Python file of generator calls.
3 import sys
4 import os
5 BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen')
6 sys.path.append(BGENDIR)
8 from scantools import Scanner
9 from bgenlocations import TOOLBOXDIR
11 LONG = "HtmlRendering"
12 SHORT = "html"
13 OBJECT = "HRReference"
15 def main():
16 ## input = LONG + ".h"
17 input = "Macintosh HD:ufs:jack:SWdev:Universal:Interfaces:CIncludes:HTMLRendering.h"
18 output = SHORT + "gen.py"
19 defsoutput = TOOLBOXDIR + LONG + ".py"
20 scanner = MyScanner(input, output, defsoutput)
21 scanner.scan()
22 scanner.close()
23 print "=== Done scanning and generating, now importing the generated code... ==="
24 exec "import " + SHORT + "support"
25 print "=== Done. It's up to you to compile it now! ==="
27 class MyScanner(Scanner):
29 def destination(self, type, name, arglist):
30 classname = "Function"
31 listname = "functions"
32 if arglist:
33 t, n, m = arglist[0]
34 if t == OBJECT and m == "InMode":
35 classname = "Method"
36 listname = "methods"
37 return classname, listname
39 def makeblacklistnames(self):
40 return [
41 "HRDisposeReference",
44 def makeblacklisttypes(self):
45 return [
46 "HRNewURLUPP",
47 "HRURLToFSSpecUPP",
48 "HRWasURLVisitedUPP",
51 def makerepairinstructions(self):
52 return [
53 ([('char', '*', 'OutMode'), ('UInt32', '*', 'InMode')],
54 [('InBuffer', '*', 'InMode')]),
57 def writeinitialdefs(self):
58 self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
61 if __name__ == "__main__":
62 main()