Re: [Pyobjc-dev] Supporting (NSString **) API (and the like)
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2002-11-27 06:44:44
|
Sorry for the late reply, I didn't have e-mail connectivity yesterday. There is no need to add (Objective-)C code for this method, or any method that has pass-by-reference type arguments. I've just checked in a missing definition that allows you to just call NSWorkspace.getInfoForFile_application_type_(fname). I'll work on some documentation for this feature. Ronald On Wednesday, Nov 27, 2002, at 00:48 Europe/Amsterdam, bb...@ma... wrote: > Definitely an improvement, but raises another question.... what to do > if the method returns BOOL, but we want it to return a tuple like > thing. > > For example, consider: > > >>> app, docType = > NSWorkspace.sharedWorkspace().pyobjcGetInfoForFile_("/tmp/ > opt5_faq.pdf") > >>> print app > /Applications/Preview.app > >>> print docType > pdf > > But: > > >>> app, docType = > NSWorkspace.sharedWorkspace().pyobjcGetInfoForFile_("/tmp/something > that isn't there") > 2002-11-26 18:47:05.074 python[23743] LSGetApplicationForURL() > returned -43 for file /tmp/something that isn't there. > Traceback (most recent call last): > File "<stdin>", line 1, in ? > TypeError: unpack non-sequence > > This is because the current implementation returns nil -- not (nil, > nil). There isn't really a way for it to return (nil, nil). > > A possible answer is to raise FileError -- but this fairly radically > changes the behavior of the underlying API. > > Are there examples from within the python library of things that > return a tuple vs. None?? > > Hmmm..... > > b.bum > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Get the new Palm Tungsten > Thandheld. Power & Color in a compact > size!http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |