diff options
Diffstat (limited to 'Mac/Modules/osa/osasupport.py')
-rw-r--r-- | Mac/Modules/osa/osasupport.py | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/Mac/Modules/osa/osasupport.py b/Mac/Modules/osa/osasupport.py index b0e7f4c..8369932 100644 --- a/Mac/Modules/osa/osasupport.py +++ b/Mac/Modules/osa/osasupport.py @@ -6,14 +6,14 @@ import string # Declarations that change for each manager -MACHEADERFILE = 'OSA.h' # The Apple header file -MODNAME = '_OSA' # The name of the module +MACHEADERFILE = 'OSA.h' # The Apple header file +MODNAME = '_OSA' # The name of the module # The following is *usually* unchanged but may still require tuning -MODPREFIX = 'OSA' # The prefix for module-wide routines -OBJECTPREFIX = 'OSAObj' # The prefix for object methods +MODPREFIX = 'OSA' # The prefix for module-wide routines +OBJECTPREFIX = 'OSAObj' # The prefix for object methods INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner -OUTPUTFILE = MODNAME + "module.c" # The file generated by this program +OUTPUTFILE = MODNAME + "module.c" # The file generated by this program from macsupport import * @@ -36,8 +36,8 @@ extern int _OSAObj_Convert(PyObject *, ComponentInstance *); initstuff = initstuff + """ /* - PyMac_INIT_TOOLBOX_OBJECT_NEW(ComponentInstance, OSAObj_New); - PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ComponentInstance, OSAObj_Convert); + PyMac_INIT_TOOLBOX_OBJECT_NEW(ComponentInstance, OSAObj_New); + PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ComponentInstance, OSAObj_Convert); */ """ @@ -63,24 +63,24 @@ AppleEvent_ptr = OpaqueType('AppleEvent', 'AEDesc') # NOTE: at the moment OSA.ComponentInstance is not a subclass # of Cm.ComponentInstance. If this is a problem it can be fixed. class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition): - def outputCheckNewArg(self): - Output("""if (itself == NULL) { - PyErr_SetString(OSA_Error,"NULL ComponentInstance"); - return NULL; - }""") - - def outputCheckConvertArg(self): - Output(""" - if (CmpInstObj_Convert(v, p_itself)) - return 1; - PyErr_Clear(); - """) - + def outputCheckNewArg(self): + Output("""if (itself == NULL) { + PyErr_SetString(OSA_Error,"NULL ComponentInstance"); + return NULL; + }""") + + def outputCheckConvertArg(self): + Output(""" + if (CmpInstObj_Convert(v, p_itself)) + return 1; + PyErr_Clear(); + """) + # Create the generator groups and link them module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff) object = MyObjectDefinition('OSAComponentInstance', OBJECTPREFIX, - 'ComponentInstance') + 'ComponentInstance') module.addobject(object) # Create the generator classes used to populate the lists @@ -103,4 +103,3 @@ for f in methods: object.add(f) # generate output (open the output file as late as possible) SetOutputFileName(OUTPUTFILE) module.generate() - |