Don't reference removed files in Makefile
[python/dscho.git] / Mac / Modules / dlg / dlgscan.py
blobd0cf1445a8783092c1399255ba2fa5774db93e28
1 # Scan an Apple header file, generating a Python file of generator calls.
3 from scantools import Scanner
5 LONG = "Dialogs"
6 SHORT = "dlg"
7 OBJECT = "DialogPtr"
9 def main():
10 input = LONG + ".h"
11 output = SHORT + "gen.py"
12 defsoutput = LONG + ".py"
13 scanner = MyScanner(input, output, defsoutput)
14 scanner.scan()
15 scanner.close()
16 print "=== Done scanning and generating, now importing the generated code... ==="
17 exec "import " + SHORT + "support"
18 print "=== Done. It's up to you to compile it now! ==="
20 class MyScanner(Scanner):
22 def destination(self, type, name, arglist):
23 classname = "Function"
24 listname = "functions"
25 if arglist:
26 t, n, m = arglist[0]
27 if t == "DialogPtr" and m == "InMode":
28 classname = "Method"
29 listname = "methods"
30 return classname, listname
32 def makeblacklistnames(self):
33 return [
34 'InitDialogs',
35 'ErrorSound',
36 # Dialogs are disposed when the object is deleted
37 'CloseDialog',
38 'DisposDialog',
39 'DisposeDialog',
40 'UpdtDialog',
41 'CouldAlert',
42 'FreeAlert',
43 'CouldDialog',
44 'FreeDialog',
47 def makeblacklisttypes(self):
48 return [
51 def makerepairinstructions(self):
52 return [
53 ([("Str255", "*", "InMode")],
54 [("*", "*", "OutMode")]),
56 ([("void_ptr", "*", "InMode"), ("long", "*", "InMode")],
57 [("InBuffer", "*", "*")]),
59 ([("void", "*", "OutMode"), ("long", "*", "InMode"),
60 ("long", "*", "OutMode")],
61 [("VarVarOutBuffer", "*", "InOutMode")]),
63 # NewDialog ETC.
64 ([("void", "*", "OutMode")],
65 [("NullStorage", "*", "InMode")]),
67 ([("DialogPtr", "*", "OutMode")],
68 [("ExistingDialogPtr", "*", "*")]),
71 if __name__ == "__main__":
72 main()