AddressList.__str__(): Get rid of useless, and broken method. Closes
[python/dscho.git] / Mac / Modules / folder / foldersupport.py
blob92003e8396f65fee0a745f472ae3159188c167ca
1 # This script generates a Python interface for an Apple Macintosh Manager.
2 # It uses the "bgen" package to generate C code.
3 # The function specifications are generated by scanning the mamager's header file,
4 # using the "scantools" package (customized for this particular manager).
6 import string
8 # Declarations that change for each manager
9 MACHEADERFILE = 'Folders.h' # The Apple header file
10 MODNAME = '_Folder' # The name of the module
12 # The following is *usually* unchanged but may still require tuning
13 MODPREFIX = 'Folder' # The prefix for module-wide routines
14 INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner
15 OUTPUTFILE = MODNAME + "module.c" # The file generated by this program
17 from macsupport import *
19 # Create the type objects
20 ConstStrFileNameParam = ConstStr255Param
21 StrFileName = Str255
22 FolderClass = OSTypeType("FolderClass")
23 # FolderDesc
24 FolderDescFlags = Type("FolderDescFlags", "l")
25 FolderLocation = OSTypeType("FolderLocation")
26 # FolderRouting
27 FolderType = OSTypeType("FolderType")
28 RoutingFlags = Type("RoutingFlags", "l")
31 includestuff = includestuff + """
32 #ifdef WITHOUT_FRAMEWORKS
33 #include <Folders.h>
34 #else
35 #include <Carbon/Carbon.h>
36 #endif
38 """
40 execfile(string.lower(MODPREFIX) + 'typetest.py')
42 # From here on it's basically all boiler plate...
44 # Create the generator groups and link them
45 module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
47 # Create the generator classes used to populate the lists
48 Function = OSErrFunctionGenerator
50 # Create and populate the lists
51 functions = []
52 execfile(INPUTFILE)
54 # add the populated lists to the generator groups
55 # (in a different wordl the scan program would generate this)
56 for f in functions: module.add(f)
58 # generate output (open the output file as late as possible)
59 SetOutputFileName(OUTPUTFILE)
60 module.generate()