[Pythonmac-SIG] creating PyObjC wrapper for ObjC framework?
has
hengist.podd at virgin.net
Wed Jan 9 18:49:49 CET 2008
Hi all,
I'm trying to create a PyObjC wrapper for objc-appscript, and I'm
wondering how to wrap methods that have NSError** arguments, e.g.:
@interface AEMEvent : NSObject {
...
}
...
/*
* Send event.
* Parameters
*
* sendMode
* kAEWaitReply
*
* timeoutInTicks
* kAEDefaultTimeout
*
* error
* On return, an NSError object that describes an Apple Event
Manager or application
* error if one has occurred, otherwise nil. Pass nil if not
required.
*
* Return value
*
* The value returned by the application, or an NSNull instance if
no value was returned,
* or nil if an error occurred.
*
* Notes
*
* A single event can be sent more than once if desired.
*
*/
- (id)sendWithMode:(AESendMode)sendMode timeout:(long)timeoutInTicks
error:(NSError **)error;
...
@end
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)?
Thanks,
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
More information about the Pythonmac-SIG
mailing list