On 9 Jan, 2008, at 18:49, has wrote:

Hi all,

I'm trying to create a PyObjC wrapper for objc-appscript,

Why?

and I'm
wondering how to wrap methods that have NSError** arguments, e.g.:

The easiest way is to mark the arguments as 'out' in the Objective-C prototype (and then recompile), that way PyObjC will pick up the right metadata from the ObjC runtime and you won't need the bridgesupport file.

(that is someMethod:(out NSError**)error).

Alternatively you can use the annotation 'type_modifier="o"' in an exception file for the bridgesupport tool. To be honest I have no idea how to do that with the system implementation of the bridgesupport tool, I tend to use my own implementation from the pyobjc repository (long story).


The logical thing would be to convert a returned NSError into a Python
exception, but BridgeSupport's gen_bridge_metadata tool doesn't seem
to provide any help here, simply flagging the argument as 'opaque'.
Any advice on how to proceed (with or without using BS)?

Don't try to convert the NSError to an exception, that would make your wrapper complete different from other wrappers and hence more likely to cause confusion for users.

Ronald

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to