Added ref to Misc/NEWS file; added hint to run regen script on Linux.
[python/dscho.git] / Mac / Modules / menu / menuscan.py
blob08a6a04b766b1ad49cb80789cfe70866ce393aed
1 # Scan <Menus.h>, generating menugen.py.
2 import addpack
3 addpack.addpack(':Tools:bgen:bgen')
5 from scantools import Scanner
7 def main():
8 input = "Menus.h"
9 output = "menugen.py"
10 defsoutput = "Menus.py"
11 scanner = MyScanner(input, output, defsoutput)
12 scanner.scan()
13 scanner.close()
14 print "=== Done scanning and generating, now doing 'import menusupport' ==="
15 import menusupport
16 print "=== Done. It's up to you to compile Menumodule.c ==="
18 class MyScanner(Scanner):
20 def destination(self, type, name, arglist):
21 classname = "Function"
22 listname = "functions"
23 if arglist:
24 t, n, m = arglist[0]
25 if t in ("MenuHandle", "MenuRef") and m == "InMode":
26 classname = "Method"
27 listname = "methods"
28 return classname, listname
30 def makeblacklistnames(self):
31 return [
34 def makeblacklisttypes(self):
35 return [
36 'MCTableHandle',
37 'MCEntryPtr',
38 'MCTablePtr',
41 def makerepairinstructions(self):
42 return [
43 ([("Str255", "itemString", "InMode")],
44 [("*", "*", "OutMode")]),
46 ([("void_ptr", "*", "InMode"), ("long", "*", "InMode")],
47 [("InBuffer", "*", "*")]),
49 ([("void", "*", "OutMode"), ("long", "*", "InMode"),
50 ("long", "*", "OutMode")],
51 [("VarVarOutBuffer", "*", "InOutMode")]),
54 if __name__ == "__main__":
55 main()