pyobjc-dev Mailing List for PyObjC (Page 206)
Brought to you by:
ronaldoussoren
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(30) |
May
(18) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2002 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
(3) |
Jul
(13) |
Aug
|
Sep
(23) |
Oct
(180) |
Nov
(291) |
Dec
(95) |
2003 |
Jan
(338) |
Feb
(352) |
Mar
(97) |
Apr
(46) |
May
(226) |
Jun
(184) |
Jul
(145) |
Aug
(141) |
Sep
(69) |
Oct
(161) |
Nov
(96) |
Dec
(90) |
2004 |
Jan
(66) |
Feb
(87) |
Mar
(98) |
Apr
(132) |
May
(115) |
Jun
(68) |
Jul
(150) |
Aug
(92) |
Sep
(59) |
Oct
(52) |
Nov
(17) |
Dec
(75) |
2005 |
Jan
(84) |
Feb
(191) |
Mar
(133) |
Apr
(114) |
May
(158) |
Jun
(185) |
Jul
(62) |
Aug
(28) |
Sep
(36) |
Oct
(88) |
Nov
(65) |
Dec
(43) |
2006 |
Jan
(85) |
Feb
(62) |
Mar
(92) |
Apr
(75) |
May
(68) |
Jun
(101) |
Jul
(73) |
Aug
(37) |
Sep
(91) |
Oct
(65) |
Nov
(30) |
Dec
(39) |
2007 |
Jan
(24) |
Feb
(28) |
Mar
(10) |
Apr
(2) |
May
(18) |
Jun
(16) |
Jul
(21) |
Aug
(6) |
Sep
(30) |
Oct
(31) |
Nov
(153) |
Dec
(31) |
2008 |
Jan
(63) |
Feb
(70) |
Mar
(47) |
Apr
(24) |
May
(59) |
Jun
(22) |
Jul
(12) |
Aug
(7) |
Sep
(14) |
Oct
(26) |
Nov
(5) |
Dec
(5) |
2009 |
Jan
(10) |
Feb
(41) |
Mar
(70) |
Apr
(88) |
May
(49) |
Jun
(62) |
Jul
(34) |
Aug
(15) |
Sep
(55) |
Oct
(40) |
Nov
(67) |
Dec
(21) |
2010 |
Jan
(60) |
Feb
(17) |
Mar
(26) |
Apr
(26) |
May
(29) |
Jun
(4) |
Jul
(21) |
Aug
(21) |
Sep
(10) |
Oct
(12) |
Nov
(3) |
Dec
(19) |
2011 |
Jan
(3) |
Feb
(13) |
Mar
(8) |
Apr
(8) |
May
(17) |
Jun
(20) |
Jul
(21) |
Aug
(7) |
Sep
|
Oct
|
Nov
(9) |
Dec
(11) |
2012 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
(4) |
Jun
(14) |
Jul
(5) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(23) |
Dec
(1) |
2013 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
(5) |
Jun
(1) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(12) |
Nov
(10) |
Dec
(3) |
2014 |
Jan
(7) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(2) |
Jun
(11) |
Jul
(10) |
Aug
(4) |
Sep
|
Oct
(8) |
Nov
(1) |
Dec
(2) |
2015 |
Jan
(9) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(7) |
Jun
|
Jul
(5) |
Aug
(6) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2016 |
Jan
(1) |
Feb
(1) |
Mar
(4) |
Apr
(2) |
May
(1) |
Jun
|
Jul
(6) |
Aug
(8) |
Sep
(21) |
Oct
(17) |
Nov
|
Dec
(36) |
2017 |
Jan
(6) |
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(6) |
2018 |
Jan
(2) |
Feb
(3) |
Mar
(3) |
Apr
(14) |
May
(2) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(6) |
Oct
(16) |
Nov
(1) |
Dec
(6) |
2019 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(1) |
2021 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2025 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dinu G. <gh...@da...> - 2003-11-18 17:14:30
|
for availability and delays... Dinu |
From: Ronald O. <ous...@ci...> - 2003-11-15 07:15:11
|
On 14 nov 2003, at 22:24, Bob Ippolito wrote: > > On Nov 14, 2003, at 4:06 PM, Ronald Oussoren wrote: > >> On 14 nov 2003, at 17:38, Bob Ippolito wrote: >> >>> In Python, four char codes are strings of length four. PyObjC sees >>> the signature of FourCharCode as an unsigned integer. This is bad, >>> AFAIK there is no "signature character" that we can use to specify a >>> length of four.. so basically I have some 30 or so, maybe more, >>> mappings to write just to provide FourCharCode to string of length >>> four compatibility. >>> >> >> I was going to suggest to use NSFileTypeForHFSTypeCode to do the >> conversion, but then noticed that this already uses PyMac_...OSType >> and therefore won't accept integers. >> >> How are you supposed to use 4 char codes in C? Given the way >> MacPython represents them I suppose you commonly represent them as >> "very wide characters" (e.g. 'flop'), instead as integers. > > C is VERY weakly typed, 'asdf' is a perfectly good unsigned int. Is it? GCC on my linux box warns about 'asdf': t.c:5:17: warning: multi-character character constant On the other hand, the C9X draft says that 'abcd' is indeed syntacticly correct, and mapped in some implmentation defined onto a multi-byte character (look for character-constant in http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.htm). I haven't checked if the document says anything about the range of values for character contants (specificaly if that range must be the same as the range of values for char). But, this is all pretty theoretical and not relevant to the discussion :-) > >> The introduction about HFSTypes in the Foundation reference talks >> about the attributes dictionary for files, such as with the >> changeFileAttributes:atPath: method. Those are even harder to handle >> than plain method arguments, for the latter we could devise some >> scheme to tell the bridge that some uint argument is a 4char code, >> doing this for random dictionaries is much harder. >>> >>> This is mostly a question for Ronald I guess, but how would this >>> best be done? Basically what needs to be done is a lot of >>> PyMac_GetOSType and PyMac_BuildOSType all over the place.. or else >>> people will have to struct.unpack('L', fourCharCode)[0] everywhere, >>> which is not fun. A potential solution to this would be to add a >>> signature character, or to allow length of 4 strings for any >>> uint32.. but I'd also like to see things come out of PyObjC as >>> length of four character strings. >> >> Allowing 4-character strings for unsigned int values is out, there's >> much more unsigned ints than just the 4-character codes. > > Yeah, but what's the worst that could happen if we accepted a 4 > character string as a valid input for an unsigned int out of context? With the additional support problems that that will give. Those problems will not come up very often, which means we'll have to think very hard when someone asks why his code fails for some values and not for others. > >> It is impossible to add new signature characters, the signature >> strings correspond directly with the signature strings that are used >> by the ObjC runtime. We override the signatures for some methods, but >> that's just to add additional information that could have been added >> by the compiler if the header files contained enough information >> (e.g. input/output argument information). > > The in/out/in-out specifiers are part of the ObjC runtime? Yes, it's part of the Distributed Objects stuff. If you define formal protocols in ObjC you can specify in/out/inout arguments to make sure that DO can correctly marshall the arguments. > >> One option would be to add an optional array of argument convertors >> to selector objects that would be used instead of the default >> convertor. I'm not sure if this would buy us much (e.g. if it is only >> usefull for the 30-something methods that use fourcharactercodes it >> is probably not worth the effort to implement such a scheme) > > Typing out wrappings for 30-something methods will make my hands tired > :) Another possible hack: In the PPC ABI types 'struct foo { long x }' and 'long' are equivalent. We could exploit this by recognizing the signature string '{_PyObjC_FourCharacterCode=I}' as a four character code and doing something special for that. > >>> Also, how can I transparently bridge AEDesc with >>> NSAppleEventDescriptor? They're basically the same thing. >> >> Basically the same or exactly the same? Is an AEDesc transparently >> bridged to NSAppleEventDescriptor in Objective-C? If it is, we can >> add a test to toll-free-bridging.m. > > No, it's not a transparent bridge. A NSAppleEventDescriptor > encapsulates an AEDesc. What I was asking really, is how can I pass a > Carbon.AE.AEDesc to an ObjC method that expects an > NSAppleEventDescriptor without doing > NSAppleEventDescriptor.alloc().initWithAEDescNoCopy_(somePythonAEDesc) > every time. I was referring to the mechanism that makes NSString and > Python unicode interchangable, not CoreFoundation<->Foundation toll > free bridging. NSString and Python unicode/str are explicitly bridged in objc_support.m. Automatic conversion between AEDesc and NSAppleEventDescriptor might be very convenient, but is it a good idea? Ronald |
From: Dethe E. <det...@bl...> - 2003-11-14 22:09:00
|
Thanks for the clarification, I guess this line in the docs threw me: "Carbon supports Find By Content, but note that it is not contained within the Carbon framework." I thought that meant it was part of Cocoa. I guess there are part of the api which are neither Carbon nor Cocoa. Silly me. On the other hand, I certainly don't need *all* of the Find By Content. I could probably write a command-line tool in C or ObjC and call it from Python or wrap it in Python. If I could get to it from PyObjC that would have been easier, but at least now I can rule that path out. Thanks again, --Dethe On 14-Nov-03, at 1:17 PM, Bob Ippolito wrote: > > On Nov 14, 2003, at 3:43 PM, Dethe Elza wrote: > >> I am trying to get started using PyObjC. What I'm interested in is >> creating a command-line search tool using the Find By Content API, >> which is in the ApplicationServices framework. But I haven't been >> able to figure out how to bootstrap far enough to find the API calls >> from Python. >> >> Is the ApplicationServices framework already exposed by PyObjC? >> >> If not, how do I wrap it? I've tried to follow the instructions here: > >> http://pyobjc.sourceforge.net/doc/wrapping.php, but haven't had luck >> with it. > > ApplicationServices is not an Objective C framework, it can not be > wrapped (directly) with PyObjC. > > As you can see by the documentation ( > http://developer.apple.com/documentation/Carbon/Reference/ > Find_By_Content/index.html ), it's part of Carbon. Carbon frameworks > are a lot more work to wrap. You'll want to use a tool like bgen, > Pyrex, or SWIG .. or just write the bindings by hand (see "Extending > and Embedding" and "Python/C API" at http://www.python.org/doc/current/ > > ). It's not very fun. There's also the option of writing an ObjC > framework that wraps the C functions, but that doesn't look like it > would make much sense in this case as the functions are not primarily > CoreFoundation based. In short, it's not possible to wrap any APi that > > was available in Mac OS before OS X (and even several new APIs that are > > not ObjC) using PyObjC (directly). > > Currently, the only part of the Find by Content API that is wrapped are > > the error codes ;) You're on your own here, properly wrapping about 50 > > functions and having them work correctly takes a good while even if you > > know the tools well. You may want to ask on pythonmac-sig if anyone > wants to volunteer to write it, or to help write it. > > -bob > "Computers are beyond dumb, they're mind-numbingly stupid. They're hostile, rigid, capricious, and unforgiving. They're impossibly demanding and they never learn anything." -- John R. Levine |
From: Bob I. <bo...@re...> - 2003-11-14 21:38:31
|
On Nov 14, 2003, at 4:32 PM, Pierce T. Wetter III wrote: > On Friday, November 14, 2003, at 02:17 PM, Bob Ippolito wrote: > >> On Nov 14, 2003, at 3:43 PM, Dethe Elza wrote: >> >>> I am trying to get started using PyObjC. What I'm interested in is >>> creating a command-line search tool using the Find By Content API, >>> which is in the ApplicationServices framework. But I haven't been >>> able to figure out how to bootstrap far enough to find the API calls >>> from Python. >>> >>> Is the ApplicationServices framework already exposed by PyObjC? >>> >>> If not, how do I wrap it? I've tried to follow the instructions >>> here: http://pyobjc.sourceforge.net/doc/wrapping.php, but haven't >>> had luck with it. >> >> ApplicationServices is not an Objective C framework, it can not be >> wrapped (directly) with PyObjC. >> >> As you can see by the documentation ( >> http://developer.apple.com/documentation/Carbon/Reference/ >> Find_By_Content/index.html ), it's part of Carbon. Carbon frameworks >> are a lot more work to wrap. You'll want to use a tool like bgen, >> Pyrex, or SWIG .. or just write the bindings by hand (see "Extending >> and Embedding" and "Python/C API" at >> http://www.python.org/doc/current/ ). It's not very fun. There's >> also the option of writing an ObjC framework that wraps the C >> functions, but that doesn't look like it would make much sense in >> this case as the functions are not primarily CoreFoundation based. >> In short, it's not possible to wrap any APi that was available in Mac >> OS before OS X (and even several new APIs that are not ObjC) using >> PyObjC (directly). >> >> Currently, the only part of the Find by Content API that is wrapped >> are the error codes ;) You're on your own here, properly wrapping >> about 50 functions and having them work correctly takes a good while >> even if you know the tools well. You may want to ask on >> pythonmac-sig if anyone wants to volunteer to write it, or to help >> write it. > > Actually, the easiest way to wrap a C framework for Python is to > write an Obj-C wrapper for it, IMHO. > > That's what I've been doing. > > Often you can find someone else who's done the work for you... It really depends. It was easy for me to wrap SystemConfiguration with ObjC, because SystemConfiguration was full of CoreFoundation types (as arguments and return values) that are transparently bridged to Foundation types. Something from Carbon would be much more of a pain in the ass to wrap with ObjC. -bob |
From: Pierce T. W. I. <pi...@tw...> - 2003-11-14 21:33:05
|
On Friday, November 14, 2003, at 02:17 PM, Bob Ippolito wrote: > > On Nov 14, 2003, at 3:43 PM, Dethe Elza wrote: > >> I am trying to get started using PyObjC. What I'm interested in is >> creating a command-line search tool using the Find By Content API, >> which is in the ApplicationServices framework. But I haven't been >> able to figure out how to bootstrap far enough to find the API calls >> from Python. >> >> Is the ApplicationServices framework already exposed by PyObjC? >> >> If not, how do I wrap it? I've tried to follow the instructions >> here: http://pyobjc.sourceforge.net/doc/wrapping.php, but haven't had >> luck with it. > > ApplicationServices is not an Objective C framework, it can not be > wrapped (directly) with PyObjC. > > As you can see by the documentation ( > http://developer.apple.com/documentation/Carbon/Reference/ > Find_By_Content/index.html ), it's part of Carbon. Carbon frameworks > are a lot more work to wrap. You'll want to use a tool like bgen, > Pyrex, or SWIG .. or just write the bindings by hand (see "Extending > and Embedding" and "Python/C API" at > http://www.python.org/doc/current/ ). It's not very fun. There's > also the option of writing an ObjC framework that wraps the C > functions, but that doesn't look like it would make much sense in this > case as the functions are not primarily CoreFoundation based. In > short, it's not possible to wrap any APi that was available in Mac OS > before OS X (and even several new APIs that are not ObjC) using PyObjC > (directly). > > Currently, the only part of the Find by Content API that is wrapped > are the error codes ;) You're on your own here, properly wrapping > about 50 functions and having them work correctly takes a good while > even if you know the tools well. You may want to ask on pythonmac-sig > if anyone wants to volunteer to write it, or to help write it. Actually, the easiest way to wrap a C framework for Python is to write an Obj-C wrapper for it, IMHO. That's what I've been doing. Often you can find someone else who's done the work for you... Pierce |
From: Bob I. <bo...@re...> - 2003-11-14 21:24:37
|
On Nov 14, 2003, at 4:06 PM, Ronald Oussoren wrote: > On 14 nov 2003, at 17:38, Bob Ippolito wrote: > >> In Python, four char codes are strings of length four. PyObjC sees >> the signature of FourCharCode as an unsigned integer. This is bad, >> AFAIK there is no "signature character" that we can use to specify a >> length of four.. so basically I have some 30 or so, maybe more, >> mappings to write just to provide FourCharCode to string of length >> four compatibility. >> > > I was going to suggest to use NSFileTypeForHFSTypeCode to do the > conversion, but then noticed that this already uses PyMac_...OSType > and therefore won't accept integers. > > How are you supposed to use 4 char codes in C? Given the way MacPython > represents them I suppose you commonly represent them as "very wide > characters" (e.g. 'flop'), instead as integers. C is VERY weakly typed, 'asdf' is a perfectly good unsigned int. > The introduction about HFSTypes in the Foundation reference talks > about the attributes dictionary for files, such as with the > changeFileAttributes:atPath: method. Those are even harder to handle > than plain method arguments, for the latter we could devise some > scheme to tell the bridge that some uint argument is a 4char code, > doing this for random dictionaries is much harder. >> >> This is mostly a question for Ronald I guess, but how would this best >> be done? Basically what needs to be done is a lot of PyMac_GetOSType >> and PyMac_BuildOSType all over the place.. or else people will have >> to struct.unpack('L', fourCharCode)[0] everywhere, which is not fun. >> A potential solution to this would be to add a signature character, >> or to allow length of 4 strings for any uint32.. but I'd also like to >> see things come out of PyObjC as length of four character strings. > > Allowing 4-character strings for unsigned int values is out, there's > much more unsigned ints than just the 4-character codes. Yeah, but what's the worst that could happen if we accepted a 4 character string as a valid input for an unsigned int out of context? > It is impossible to add new signature characters, the signature > strings correspond directly with the signature strings that are used > by the ObjC runtime. We override the signatures for some methods, but > that's just to add additional information that could have been added > by the compiler if the header files contained enough information (e.g. > input/output argument information). The in/out/in-out specifiers are part of the ObjC runtime? > One option would be to add an optional array of argument convertors to > selector objects that would be used instead of the default convertor. > I'm not sure if this would buy us much (e.g. if it is only usefull for > the 30-something methods that use fourcharactercodes it is probably > not worth the effort to implement such a scheme) Typing out wrappings for 30-something methods will make my hands tired :) >> Also, how can I transparently bridge AEDesc with >> NSAppleEventDescriptor? They're basically the same thing. > > Basically the same or exactly the same? Is an AEDesc transparently > bridged to NSAppleEventDescriptor in Objective-C? If it is, we can add > a test to toll-free-bridging.m. No, it's not a transparent bridge. A NSAppleEventDescriptor encapsulates an AEDesc. What I was asking really, is how can I pass a Carbon.AE.AEDesc to an ObjC method that expects an NSAppleEventDescriptor without doing NSAppleEventDescriptor.alloc().initWithAEDescNoCopy_(somePythonAEDesc) every time. I was referring to the mechanism that makes NSString and Python unicode interchangable, not CoreFoundation<->Foundation toll free bridging. -bob |
From: Bob I. <bo...@re...> - 2003-11-14 21:17:21
|
On Nov 14, 2003, at 3:43 PM, Dethe Elza wrote: > I am trying to get started using PyObjC. What I'm interested in is > creating a command-line search tool using the Find By Content API, > which is in the ApplicationServices framework. But I haven't been > able to figure out how to bootstrap far enough to find the API calls > from Python. > > Is the ApplicationServices framework already exposed by PyObjC? > > If not, how do I wrap it? I've tried to follow the instructions here: > http://pyobjc.sourceforge.net/doc/wrapping.php, but haven't had luck > with it. ApplicationServices is not an Objective C framework, it can not be wrapped (directly) with PyObjC. As you can see by the documentation ( http://developer.apple.com/documentation/Carbon/Reference/ Find_By_Content/index.html ), it's part of Carbon. Carbon frameworks are a lot more work to wrap. You'll want to use a tool like bgen, Pyrex, or SWIG .. or just write the bindings by hand (see "Extending and Embedding" and "Python/C API" at http://www.python.org/doc/current/ ). It's not very fun. There's also the option of writing an ObjC framework that wraps the C functions, but that doesn't look like it would make much sense in this case as the functions are not primarily CoreFoundation based. In short, it's not possible to wrap any APi that was available in Mac OS before OS X (and even several new APIs that are not ObjC) using PyObjC (directly). Currently, the only part of the Find by Content API that is wrapped are the error codes ;) You're on your own here, properly wrapping about 50 functions and having them work correctly takes a good while even if you know the tools well. You may want to ask on pythonmac-sig if anyone wants to volunteer to write it, or to help write it. -bob |
From: Ronald O. <ous...@ci...> - 2003-11-14 21:10:47
|
On 14 nov 2003, at 17:46, Bob Ippolito wrote: > I've noticed that it's rather frequent for both a class and instance > method to have a near identical signature and a near identical > mapping.. for example, initWithBytes:length: vs dataWithBytes:length: > > The only difference is really in one line of code.. the class method > will say: > PyObjC_InitSuperCls(&super, > PyObjCSelector_GetClass(method), > PyObjCClass_GetClass(self)); > > and the instance method will say: > PyObjC_InitSuper(&super, > PyObjCSelector_GetClass(method), > PyObjCObject_GetObject(self)); > > There has to be a better way than this, so that we don't have all this > cut+paste code to maintain. Ideas? good point. For this specific example we can detect ``method`` is a class method or not and call the right InitSuper variant. The IMP variant of that code is probably completely the same already! Ronald |
From: Ronald O. <ous...@ci...> - 2003-11-14 21:06:39
|
On 14 nov 2003, at 17:38, Bob Ippolito wrote: > In Python, four char codes are strings of length four. PyObjC sees > the signature of FourCharCode as an unsigned integer. This is bad, > AFAIK there is no "signature character" that we can use to specify a > length of four.. so basically I have some 30 or so, maybe more, > mappings to write just to provide FourCharCode to string of length > four compatibility. > I was going to suggest to use NSFileTypeForHFSTypeCode to do the conversion, but then noticed that this already uses PyMac_...OSType and therefore won't accept integers. How are you supposed to use 4 char codes in C? Given the way MacPython represents them I suppose you commonly represent them as "very wide characters" (e.g. 'flop'), instead as integers. The introduction about HFSTypes in the Foundation reference talks about the attributes dictionary for files, such as with the changeFileAttributes:atPath: method. Those are even harder to handle than plain method arguments, for the latter we could devise some scheme to tell the bridge that some uint argument is a 4char code, doing this for random dictionaries is much harder. > > This is mostly a question for Ronald I guess, but how would this best > be done? Basically what needs to be done is a lot of PyMac_GetOSType > and PyMac_BuildOSType all over the place.. or else people will have to > struct.unpack('L', fourCharCode)[0] everywhere, which is not fun. A > potential solution to this would be to add a signature character, or > to allow length of 4 strings for any uint32.. but I'd also like to see > things come out of PyObjC as length of four character strings. Allowing 4-character strings for unsigned int values is out, there's much more unsigned ints than just the 4-character codes. It is impossible to add new signature characters, the signature strings correspond directly with the signature strings that are used by the ObjC runtime. We override the signatures for some methods, but that's just to add additional information that could have been added by the compiler if the header files contained enough information (e.g. input/output argument information). One option would be to add an optional array of argument convertors to selector objects that would be used instead of the default convertor. I'm not sure if this would buy us much (e.g. if it is only usefull for the 30-something methods that use fourcharactercodes it is probably not worth the effort to implement such a scheme) > > Also, how can I transparently bridge AEDesc with > NSAppleEventDescriptor? They're basically the same thing. Basically the same or exactly the same? Is an AEDesc transparently bridged to NSAppleEventDescriptor in Objective-C? If it is, we can add a test to toll-free-bridging.m. Ronald |
From: Dethe E. <det...@bl...> - 2003-11-14 20:43:28
|
Hi all, I am trying to get started using PyObjC. What I'm interested in is creating a command-line search tool using the Find By Content API, which is in the ApplicationServices framework. But I haven't been able to figure out how to bootstrap far enough to find the API calls from Python. Is the ApplicationServices framework already exposed by PyObjC? If not, how do I wrap it? I've tried to follow the instructions here: http://pyobjc.sourceforge.net/doc/wrapping.php, but haven't had luck with it. TIA --Dethe "the city carries such a cargo of pathos and longing that daily life there vaccinates us against revelation" -- Pain Not Bread, The Rise and Fall of Human Breath |
From: Bob I. <bo...@re...> - 2003-11-14 16:46:06
|
I've noticed that it's rather frequent for both a class and instance method to have a near identical signature and a near identical mapping.. for example, initWithBytes:length: vs dataWithBytes:length: The only difference is really in one line of code.. the class method will say: PyObjC_InitSuperCls(&super, PyObjCSelector_GetClass(method), PyObjCClass_GetClass(self)); and the instance method will say: PyObjC_InitSuper(&super, PyObjCSelector_GetClass(method), PyObjCObject_GetObject(self)); There has to be a better way than this, so that we don't have all this cut+paste code to maintain. Ideas? -bob |
From: Bob I. <bo...@re...> - 2003-11-14 16:38:13
|
In Python, four char codes are strings of length four. PyObjC sees the signature of FourCharCode as an unsigned integer. This is bad, AFAIK there is no "signature character" that we can use to specify a length of four.. so basically I have some 30 or so, maybe more, mappings to write just to provide FourCharCode to string of length four compatibility. This is mostly a question for Ronald I guess, but how would this best be done? Basically what needs to be done is a lot of PyMac_GetOSType and PyMac_BuildOSType all over the place.. or else people will have to struct.unpack('L', fourCharCode)[0] everywhere, which is not fun. A potential solution to this would be to add a signature character, or to allow length of 4 strings for any uint32.. but I'd also like to see things come out of PyObjC as length of four character strings. Also, how can I transparently bridge AEDesc with NSAppleEventDescriptor? They're basically the same thing. -bob |
From: Angel M. <0p...@ya...> - 2003-11-14 06:26:02
|
American Stock Market - Press Release... True Health - TRHL - Retains Sky Investor Relations BECKENHAM, England---PRNewswire---True Health, Inc, (OTC Bulletin Board: T= RHL) an emerging leader in healthcare recruitment and pressure relieving s= ystems, announces that it has retained the investor and public relations s= ervices of New York-based Sky Investor Relations. Read the entire news release: http://biz.yahoo.com/prnews/031112/lnw017_1.= html oeespy fzcmnz da vum ttzj twhg yuaubznaubwqhxzkl |
From: <s....@jo...> - 2003-11-13 17:56:49
|
Hi, I am trying as an exercise to write a smallish irc client. Now I have four NSTableViews, 2 or 3 seem to work flawlessly, but the fourth one which contains the chat lines doesn't update properly, the console trace indicate otherwise. what happens is that all of my entries are displayed as what i last sent, but other users' messages are in the proper order!? Am I missing something? Tey are all linked to the same class controller and have I think all the proper datasource functions and I do reloadData() : tableView_objectValueForTableColumn_row_ tableView_setObjectValue_forTableColumn_row_ numberOfRowsInTableView_ I set the windows delegate as self and the target also. Any hint on what's going on? Also is it possible to have the rows resize to fit the lenght of the message? I used a NSTableView instead of a text view for the formating I am open to sugestion as to do otherwise. REgards Sephane |
From: Dinu G. <gh...@da...> - 2003-11-13 12:45:59
|
Ronald Oussoren: > PyObjCTools.pluginbuilder should be useable here, but would be > overkill if both the main program and the plugins are Python-based. > You could use the approach used by those plugin modules: > > - Load the bundle using NSBundle > - Look for the main python file (either hardcode a name, or use a key > in the Info.plist) > - Create a new module object, set __path__ to the resources directory > of the bundle, and > execute the main python file in that module > - Now look for the main class using NSBundle.principleClass > > Setting the __path__ is important, this way the resources directory is > treated like a package which makes it possible to use the same module > names in two plugins. I've tried lots of different approaches, none of which yielded the expected success, though... I've also tried an AppKit category, adding loadNibNamed_owner_(nibName, owner) to NSBundle, but also in vain. Therefore, I've compiled a sample module of an app trying to load a plugin, which illustrates the issues. I'd be happy if someone could have a look at this. To run it you must make a symbolic link of the plugin folder to your desktop, then run the app itself. You can find it here, any help sorting this out is much appreci- ated! http://python.net/~gherman/tmp/PluginApp.tar.gz Thanks, Dinu -- Dinu C. Gherman - http://python.net/~gherman ...................................................................... "The best way to predict the future is to invent it." (Alan Kay) |
From: Bob I. <bo...@re...> - 2003-11-13 08:13:15
|
is there a selector signature for a 4 char code? Right now OSType and friends come across as integers.. all the pymactoolbox methods take four char codes. Ideas? -bob |
From: SourceForge.net <no...@so...> - 2003-11-13 06:17:58
|
Bugs item #841234, was opened at 2003-11-13 17:17 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=841234&group_id=14534 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tobias Sargeant (tobiasjs) Assigned to: Nobody/Anonymous (nobody) Summary: printing an NSView hangs. Initial Comment: If an NSView subclass has a knowsPageRange: method, attempting to print it causes a hang. The printing process never gets as far as calling the method, as far as I can tell. gdb isn't too helpful, as it seems to cause a segfault that isn't otherwise seen. This is the traceback at the fault, however: Program received signal EXC_BAD_ACCESS, Could not access memory. 0x9083122c in objc_msgSend () (gdb) where #0 0x9083122c in objc_msgSend () #1 0x00284df4 in pythonify_c_value (type=0xbfffbbd0 "", datum=0xbfffbbb0) at Modules/objc/objc_support.m:681 #2 0x002965c4 in method_stub (cif=0xbfffbbd0, resp=0xbfffbb80, args=0xbfffbaa0, userdata=0xa0001304) at Modules/objc/libffi_support.m:388 #3 0x00297a44 in ffi_closure_helper_DARWIN (closure=0x3b5480, rvalue=0xbfffbb80, pgr=0x40, pfr=0xa0001304) at /Users/toby/Desktop/pyobjc-1.0/libffi- src/src/powerpc/ffi_darwin.c:696 #4 0x00297dd4 in ffi_closure_ASM () #5 0x92f89354 in -[NSView(NSPrinting) _knowsPagesFirst:last:] () #6 0x92f89070 in -[NSView(NSPrinting) _setUpOperation: helpedBy:] () #7 0x92f88bc0 in -[NSView(NSPrinting) _realPrintPSCode: helpedBy:] () #8 0x92f88b18 in -[NSConcretePrintOperation _doActualViewPrinting] () #9 0x930cf1c0 in -[NSConcretePrintOperation runOperation] () #10 0x00297d0c in ffi_call_DARWIN () ... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=841234&group_id=14534 |
From: SourceForge.net <no...@so...> - 2003-11-13 04:57:59
|
Bugs item #841191, was opened at 2003-11-13 15:57 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=841191&group_id=14534 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tobias Sargeant (tobiasjs) Assigned to: Nobody/Anonymous (nobody) Summary: printing an NSView hangs. Initial Comment: If an NSView subclass has a knowsPageRange: method, attempting to print it causes a hang. The printing process never gets as far as calling the method, as far as I can tell. gdb isn't too helpful, as it seems to cause a segfault that isn't otherwise seen. This is the traceback at the fault, however: Program received signal EXC_BAD_ACCESS, Could not access memory. 0x9083122c in objc_msgSend () (gdb) where #0 0x9083122c in objc_msgSend () #1 0x00284df4 in pythonify_c_value (type=0xbfffbbd0 "", datum=0xbfffbbb0) at Modules/objc/objc_support.m:681 #2 0x002965c4 in method_stub (cif=0xbfffbbd0, resp=0xbfffbb80, args=0xbfffbaa0, userdata=0xa0001304) at Modules/objc/libffi_support.m:388 #3 0x00297a44 in ffi_closure_helper_DARWIN (closure=0x3b5480, rvalue=0xbfffbb80, pgr=0x40, pfr=0xa0001304) at /Users/toby/Desktop/pyobjc-1.0/libffi- src/src/powerpc/ffi_darwin.c:696 #4 0x00297dd4 in ffi_closure_ASM () #5 0x92f89354 in -[NSView(NSPrinting) _knowsPagesFirst:last:] () #6 0x92f89070 in -[NSView(NSPrinting) _setUpOperation: helpedBy:] () #7 0x92f88bc0 in -[NSView(NSPrinting) _realPrintPSCode: helpedBy:] () #8 0x92f88b18 in -[NSConcretePrintOperation _doActualViewPrinting] () #9 0x930cf1c0 in -[NSConcretePrintOperation runOperation] () #10 0x00297d0c in ffi_call_DARWIN () ... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=841191&group_id=14534 |
From: Donovan P. <ds...@ma...> - 2003-11-12 14:58:16
|
On Nov 12, 2003, at 2:31 AM, Ronald Oussoren wrote: > > On 11 nov 2003, at 23:59, Bob Ippolito wrote: > >> When it works, we can distribute a --semi-standalone version w/ >> Twisted, [...] > > BTW. a --semi-standalone version of any GUI for PackMan introduces > interesting problems, because some of the packages it uses will be > included in the .app bundle, but not in the system. We currently check > if a package is installed by trying to import it, this will give some > false positives (e.g. Twisted and PyObjC for your version and wxPython > for Kevin's version). Bob has plans for improving PackMan's package checking code by doing it in a child process, which will improve stability and responsiveness, and also solve this problem. It has the advantage of giving the checking-process a clean environment and a sandbox in case there's something fishy going on with one of the modules. dp |
From: Bob I. <bo...@re...> - 2003-11-12 14:55:32
|
On Nov 12, 2003, at 2:31 AM, Ronald Oussoren wrote: > On 11 nov 2003, at 23:59, Bob Ippolito wrote: > >> When it works, we can distribute a --semi-standalone version w/ >> Twisted, [...] > > BTW. a --semi-standalone version of any GUI for PackMan introduces > interesting problems, because some of the packages it uses will be > included in the .app bundle, but not in the system. We currently check > if a package is installed by trying to import it, this will give some > false positives (e.g. Twisted and PyObjC for your version and wxPython > for Kevin's version). The solution to this problem is to spawn a plain interpreter and get it to execute this code, and that's what I intend to implement. This also prevents the "if a module crashes on import I can't use PackageManager anymore" problem, and the "oh, so I have to restart PackageManager to see if my package upgrade worked?" problem. -bob |
From: Ronald O. <ous...@ci...> - 2003-11-12 07:32:10
|
On 11 nov 2003, at 23:59, Bob Ippolito wrote: > When it works, we can distribute a --semi-standalone version w/ > Twisted, [...] BTW. a --semi-standalone version of any GUI for PackMan introduces interesting problems, because some of the packages it uses will be included in the .app bundle, but not in the system. We currently check if a package is installed by trying to import it, this will give some false positives (e.g. Twisted and PyObjC for your version and wxPython for Kevin's version). Ronald |
From: Donovan P. <ds...@ma...> - 2003-11-11 23:15:49
|
On Nov 11, 2003, at 5:45 PM, Ronald Oussoren wrote: > Just to give some useless feedback... Your implementation of packman > uses Twisted, but I wonder if this is the right thing to do. I fully agree with everything you said. The only reason this code depends on Twisted is that I know it really well, and it helped me get a working gui that loaded packages off the network in less than an hour. This project was really just meant as a "learn how to use interface builder and pyobjc better" bootstrap project for me, and I only checked it in because Bob wanted to be able to work on it with me. I fully intend to develop in such a way that swapping out the network layer should be possible. But at this early stage of implementation, having something that works with the least amount of code rather than something that works with the least amount of dependencies is more important to me at the moment, since I'm doing this in my incredibly limited spare time :-) Jack chewed me out for the same reason... I knew I would get some sort of flack for checking this in ;-) dp |
From: Bob I. <bo...@re...> - 2003-11-11 22:59:40
|
We're aware of that, and have discussed it at length with Jack in the MacPython channel. Basically the deal is that it's using Twisted right now, because that's what's easiest, but will be refactored to be pluggable later once it works. When it works, we can distribute a --semi-standalone version w/ Twisted, then begin work on a version that can live in MacPython 2.4 that would use whichever mechanisms are appropriate and available. -bob On Nov 11, 2003, at 5:45 PM, Ronald Oussoren wrote: > Just to give some useless feedback... Your implementation of packman > uses Twisted, but I wonder if this is the right thing to do. > > A new version of PackMan should one day be part of MacPython, and > therefore the core python distribution. I don't think Twisted will be > in by then. Would it not be better to move the downloading of files to > a platform/gui-kit dependent layer? E.g. at initialisation the GUI > asks the pimp module for the URL of the (default) database, downloads > that and initialises the pimp module with that. At installation time > it queries the package for URL's that should be downloaded, downloads > those files and passes them to the module. > > You could then use NSUrl with Cocoa on MacOSX, whatever is used by > wxWindows when using that GUI , Twisted when that is available and > urllib2 when nothing better is available (or when you don't care, I > don't care if the cmd-line tool blocks during the download of > archives). > > Ronald > > P.S. That doesn't mean that I don't like twisted at all, I intend to > use it sometime soon, I just don't think it is the right tool for this > problem. > > On 11 nov 2003, at 23:00, Bob Ippolito wrote: > >> Update of /cvsroot/pyobjc/pyobjc/Examples/Twisted/PackMan >> In directory sc8-pr-cvs1:/tmp/cvs-serv11329 >> >> Modified Files: >> PackMan.py buildapp.py newclient.py >> Added Files: >> newpimp.py >> Log Message: >> move plist parse/download to "newpimp" module, make client non-noisy >> >> >> --- NEW FILE: newpimp.py --- >> """Package Install Manager for Python. >> >> This is currently a MacOSX-only strawman implementation. >> Despite other rumours the name stands for "Packman IMPlementation". >> >> Tools to allow easy installation of packages. The idea is that there >> is >> an online XML database per (platform, python-version) containing >> packages >> known to work with that combination. This module contains tools for >> getting >> and parsing the database, testing whether packages are installed, >> computing >> dependencies and installing packages. >> >> There is a minimal main program that works as a command line tool, >> but the >> intention is that the end user will use this through a GUI. >> """ >> import sys >> import os >> import popen2 >> import urllib >> import urllib2 >> [...1021 lines suppressed...] >> # If the end-user updates pimp through pimp the new version >> # will be called pimp_update and live in site-packages >> # or somewhere similar >> if __name__ != 'pimp_update': >> try: >> import pimp_update >> except ImportError: >> pass >> else: >> if pimp_update.PIMP_VERSION <= PIMP_VERSION: >> import warnings >> warnings.warn("pimp_update is version %s, not newer than >> pimp version %s" % >> (pimp_update.PIMP_VERSION, PIMP_VERSION)) >> else: >> from pimp_update import * >> >> if __name__ == '__main__': >> main() >> >> >> >> Index: PackMan.py >> =================================================================== >> RCS file: /cvsroot/pyobjc/pyobjc/Examples/Twisted/PackMan/PackMan.py,v >> retrieving revision 1.2 >> retrieving revision 1.3 >> diff -C2 -d -r1.2 -r1.3 >> *** PackMan.py 11 Nov 2003 17:15:02 -0000 1.2 >> --- PackMan.py 11 Nov 2003 22:00:16 -0000 1.3 >> *************** >> *** 6,9 **** >> --- 6,11 ---- >> reactor = twisted.internet.cfreactor.install() >> >> + from twisted.internet import error >> + >> ## New HTTP client in Twisted/sandbox/moshez >> import newclient >> *************** >> *** 17,20 **** >> --- 19,31 ---- >> import plistlib >> >> + import newpimp >> + >> + # DEBUG >> + import sys >> + from twisted.python import log >> + log.startLogging(sys.stdout) >> + >> + # the test-multidatabase >> + DATABASE = 'http://undefined.org/python/pimp/panther.plist' >> >> NibClassBuilder.extractClasses("MainMenu") >> *************** >> *** 53,58 **** >> >> class PackageController(NibClassBuilder.AutoBaseClass): >> ! packages = [] >> ! _allPackages = [] >> >> def applicationDidFinishLaunching_(self, aNotification): >> --- 64,69 ---- >> >> class PackageController(NibClassBuilder.AutoBaseClass): >> ! packages = () >> ! _allPackages = () >> >> def applicationDidFinishLaunching_(self, aNotification): >> *************** >> *** 60,72 **** >> NSIndexSet.indexSetWithIndex_(0), NO >> ) >> ! >> self.openDatabase('http://undefined.org/python/pimp/darwin-7.0.0- >> Power_Macintosh.plist') >> reactor.run() >> >> def openDatabase(self, url): >> ! o = newclient.opener() >> ! d = o.open( >> ! newclient.Request(str(url)) >> ! ).addCallback( >> ! newclient.read >> ).addCallback( >> self.gotPlist >> --- 71,80 ---- >> NSIndexSet.indexSetWithIndex_(0), NO >> ) >> ! self.openDatabase(DATABASE) >> reactor.run() >> >> def openDatabase(self, url): >> ! log.msg('Opening database: %s' % (url,)) >> ! return newpimp.downloadPackmanDatabase(url.encode('utf8') >> ).addCallback( >> self.gotPlist >> *************** >> *** 75,83 **** >> ) >> >> ! def gotPlist(self, pliststring): >> ! fl = StringIO(pliststring) >> ! plist = plistlib.Plist.fromFile(fl) >> packages = plist['Packages'] >> ! packages.sort(lambda x, y: cmp(x['Name'].lower(), >> y['Name'].lower())) >> self._allPackagesIncludingHidden = packages >> self._allPackages = self.packages = [x for x in packages if >> x.get('Version', None)] >> --- 83,99 ---- >> ) >> >> ! def gotPlist(self, plist): >> ! log.msg('received plist') >> packages = plist['Packages'] >> ! # >> ! # XXX - Flavors and Version should be condensed into one >> row? >> ! # >> ! # default sort is >> ! # Name, Version, Flavor >> ! # >> ! packages.sort(lambda a,b:( >> ! cmp(a['Name'].lower(), b['Name'].lower()) or >> ! cmp(a.get('Version'), b.get('Version')) or >> ! cmp(a.get('Flavor'), b.get('Flavor')))) >> self._allPackagesIncludingHidden = packages >> self._allPackages = self.packages = [x for x in packages if >> x.get('Version', None)] >> >> Index: buildapp.py >> =================================================================== >> RCS file: >> /cvsroot/pyobjc/pyobjc/Examples/Twisted/PackMan/buildapp.py,v >> retrieving revision 1.1 >> retrieving revision 1.2 >> diff -C2 -d -r1.1 -r1.2 >> *** buildapp.py 11 Nov 2003 04:23:34 -0000 1.1 >> --- buildapp.py 11 Nov 2003 22:00:18 -0000 1.2 >> *************** >> *** 4,9 **** >> mainprogram = "PackMan.py", >> resources = ["MainMenu.nib"], >> ! includeModules=['newclient'], >> symlink = True, >> nibname = "MainMenu" >> ! ) >> \ No newline at end of file >> --- 4,9 ---- >> mainprogram = "PackMan.py", >> resources = ["MainMenu.nib"], >> ! includeModules=['newclient', 'newpimp'], >> symlink = True, >> nibname = "MainMenu" >> ! ) >> >> Index: newclient.py >> =================================================================== >> RCS file: >> /cvsroot/pyobjc/pyobjc/Examples/Twisted/PackMan/newclient.py,v >> retrieving revision 1.2 >> retrieving revision 1.3 >> diff -C2 -d -r1.2 -r1.3 >> *** newclient.py 11 Nov 2003 17:15:02 -0000 1.2 >> --- newclient.py 11 Nov 2003 22:00:19 -0000 1.3 >> *************** >> *** 51,54 **** >> --- 51,55 ---- >> class HTTPClient(http.HTTPClient): >> >> + response = None >> def connectionMade(self): >> self.factory.connection.callback(self) >> *************** >> *** 78,85 **** >> def handleResponseEnd(self): >> self.done = 1 >> ! self.response.dataDone() >> >> class ClientFactory(protocol.ClientFactory): >> protocol = HTTPClient >> def __init__(self): >> self.connection = defer.Deferred() >> --- 79,88 ---- >> def handleResponseEnd(self): >> self.done = 1 >> ! if self.response is not None: >> ! self.response.dataDone() >> >> class ClientFactory(protocol.ClientFactory): >> protocol = HTTPClient >> + noisy = None and "FOR GOD'S SAKE NOISY CLIENT FACTORIES SUCK" >> def __init__(self): >> self.connection = defer.Deferred() >> >> >> >> ------------------------------------------------------- >> This SF.Net email sponsored by: ApacheCon 2003, >> 16-19 November in Las Vegas. Learn firsthand the latest >> developments in Apache, PHP, Perl, XML, Java, MySQL, >> WebDAV, and more! http://www.apachecon.com/ >> _______________________________________________ >> pyobjc-checkins mailing list >> pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-checkins >> > > > > ------------------------------------------------------- > This SF.Net email sponsored by: ApacheCon 2003, > 16-19 November in Las Vegas. Learn firsthand the latest > developments in Apache, PHP, Perl, XML, Java, MySQL, > WebDAV, and more! http://www.apachecon.com/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Ronald O. <ous...@ci...> - 2003-11-11 22:45:28
|
Just to give some useless feedback... Your implementation of packman uses Twisted, but I wonder if this is the right thing to do. A new version of PackMan should one day be part of MacPython, and therefore the core python distribution. I don't think Twisted will be in by then. Would it not be better to move the downloading of files to a platform/gui-kit dependent layer? E.g. at initialisation the GUI asks the pimp module for the URL of the (default) database, downloads that and initialises the pimp module with that. At installation time it queries the package for URL's that should be downloaded, downloads those files and passes them to the module. You could then use NSUrl with Cocoa on MacOSX, whatever is used by wxWindows when using that GUI , Twisted when that is available and urllib2 when nothing better is available (or when you don't care, I don't care if the cmd-line tool blocks during the download of archives). Ronald P.S. That doesn't mean that I don't like twisted at all, I intend to use it sometime soon, I just don't think it is the right tool for this problem. On 11 nov 2003, at 23:00, Bob Ippolito wrote: > Update of /cvsroot/pyobjc/pyobjc/Examples/Twisted/PackMan > In directory sc8-pr-cvs1:/tmp/cvs-serv11329 > > Modified Files: > PackMan.py buildapp.py newclient.py > Added Files: > newpimp.py > Log Message: > move plist parse/download to "newpimp" module, make client non-noisy > > > --- NEW FILE: newpimp.py --- > """Package Install Manager for Python. > > This is currently a MacOSX-only strawman implementation. > Despite other rumours the name stands for "Packman IMPlementation". > > Tools to allow easy installation of packages. The idea is that there is > an online XML database per (platform, python-version) containing > packages > known to work with that combination. This module contains tools for > getting > and parsing the database, testing whether packages are installed, > computing > dependencies and installing packages. > > There is a minimal main program that works as a command line tool, but > the > intention is that the end user will use this through a GUI. > """ > import sys > import os > import popen2 > import urllib > import urllib2 > [...1021 lines suppressed...] > # If the end-user updates pimp through pimp the new version > # will be called pimp_update and live in site-packages > # or somewhere similar > if __name__ != 'pimp_update': > try: > import pimp_update > except ImportError: > pass > else: > if pimp_update.PIMP_VERSION <= PIMP_VERSION: > import warnings > warnings.warn("pimp_update is version %s, not newer than > pimp version %s" % > (pimp_update.PIMP_VERSION, PIMP_VERSION)) > else: > from pimp_update import * > > if __name__ == '__main__': > main() > > > > Index: PackMan.py > =================================================================== > RCS file: /cvsroot/pyobjc/pyobjc/Examples/Twisted/PackMan/PackMan.py,v > retrieving revision 1.2 > retrieving revision 1.3 > diff -C2 -d -r1.2 -r1.3 > *** PackMan.py 11 Nov 2003 17:15:02 -0000 1.2 > --- PackMan.py 11 Nov 2003 22:00:16 -0000 1.3 > *************** > *** 6,9 **** > --- 6,11 ---- > reactor = twisted.internet.cfreactor.install() > > + from twisted.internet import error > + > ## New HTTP client in Twisted/sandbox/moshez > import newclient > *************** > *** 17,20 **** > --- 19,31 ---- > import plistlib > > + import newpimp > + > + # DEBUG > + import sys > + from twisted.python import log > + log.startLogging(sys.stdout) > + > + # the test-multidatabase > + DATABASE = 'http://undefined.org/python/pimp/panther.plist' > > NibClassBuilder.extractClasses("MainMenu") > *************** > *** 53,58 **** > > class PackageController(NibClassBuilder.AutoBaseClass): > ! packages = [] > ! _allPackages = [] > > def applicationDidFinishLaunching_(self, aNotification): > --- 64,69 ---- > > class PackageController(NibClassBuilder.AutoBaseClass): > ! packages = () > ! _allPackages = () > > def applicationDidFinishLaunching_(self, aNotification): > *************** > *** 60,72 **** > NSIndexSet.indexSetWithIndex_(0), NO > ) > ! > self.openDatabase('http://undefined.org/python/pimp/darwin-7.0.0- > Power_Macintosh.plist') > reactor.run() > > def openDatabase(self, url): > ! o = newclient.opener() > ! d = o.open( > ! newclient.Request(str(url)) > ! ).addCallback( > ! newclient.read > ).addCallback( > self.gotPlist > --- 71,80 ---- > NSIndexSet.indexSetWithIndex_(0), NO > ) > ! self.openDatabase(DATABASE) > reactor.run() > > def openDatabase(self, url): > ! log.msg('Opening database: %s' % (url,)) > ! return newpimp.downloadPackmanDatabase(url.encode('utf8') > ).addCallback( > self.gotPlist > *************** > *** 75,83 **** > ) > > ! def gotPlist(self, pliststring): > ! fl = StringIO(pliststring) > ! plist = plistlib.Plist.fromFile(fl) > packages = plist['Packages'] > ! packages.sort(lambda x, y: cmp(x['Name'].lower(), > y['Name'].lower())) > self._allPackagesIncludingHidden = packages > self._allPackages = self.packages = [x for x in packages if > x.get('Version', None)] > --- 83,99 ---- > ) > > ! def gotPlist(self, plist): > ! log.msg('received plist') > packages = plist['Packages'] > ! # > ! # XXX - Flavors and Version should be condensed into one row? > ! # > ! # default sort is > ! # Name, Version, Flavor > ! # > ! packages.sort(lambda a,b:( > ! cmp(a['Name'].lower(), b['Name'].lower()) or > ! cmp(a.get('Version'), b.get('Version')) or > ! cmp(a.get('Flavor'), b.get('Flavor')))) > self._allPackagesIncludingHidden = packages > self._allPackages = self.packages = [x for x in packages if > x.get('Version', None)] > > Index: buildapp.py > =================================================================== > RCS file: /cvsroot/pyobjc/pyobjc/Examples/Twisted/PackMan/buildapp.py,v > retrieving revision 1.1 > retrieving revision 1.2 > diff -C2 -d -r1.1 -r1.2 > *** buildapp.py 11 Nov 2003 04:23:34 -0000 1.1 > --- buildapp.py 11 Nov 2003 22:00:18 -0000 1.2 > *************** > *** 4,9 **** > mainprogram = "PackMan.py", > resources = ["MainMenu.nib"], > ! includeModules=['newclient'], > symlink = True, > nibname = "MainMenu" > ! ) > \ No newline at end of file > --- 4,9 ---- > mainprogram = "PackMan.py", > resources = ["MainMenu.nib"], > ! includeModules=['newclient', 'newpimp'], > symlink = True, > nibname = "MainMenu" > ! ) > > Index: newclient.py > =================================================================== > RCS file: > /cvsroot/pyobjc/pyobjc/Examples/Twisted/PackMan/newclient.py,v > retrieving revision 1.2 > retrieving revision 1.3 > diff -C2 -d -r1.2 -r1.3 > *** newclient.py 11 Nov 2003 17:15:02 -0000 1.2 > --- newclient.py 11 Nov 2003 22:00:19 -0000 1.3 > *************** > *** 51,54 **** > --- 51,55 ---- > class HTTPClient(http.HTTPClient): > > + response = None > def connectionMade(self): > self.factory.connection.callback(self) > *************** > *** 78,85 **** > def handleResponseEnd(self): > self.done = 1 > ! self.response.dataDone() > > class ClientFactory(protocol.ClientFactory): > protocol = HTTPClient > def __init__(self): > self.connection = defer.Deferred() > --- 79,88 ---- > def handleResponseEnd(self): > self.done = 1 > ! if self.response is not None: > ! self.response.dataDone() > > class ClientFactory(protocol.ClientFactory): > protocol = HTTPClient > + noisy = None and "FOR GOD'S SAKE NOISY CLIENT FACTORIES SUCK" > def __init__(self): > self.connection = defer.Deferred() > > > > ------------------------------------------------------- > This SF.Net email sponsored by: ApacheCon 2003, > 16-19 November in Las Vegas. Learn firsthand the latest > developments in Apache, PHP, Perl, XML, Java, MySQL, > WebDAV, and more! http://www.apachecon.com/ > _______________________________________________ > pyobjc-checkins mailing list > pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-checkins > |
未承諾広告*2億、3億、5億9千万円収入者が続出しています。 <配信者> はじめまして、KJH保証協会会長 山中梅子と申します。 保証の悲劇防止の全信協「顧問・代行店を在宅で、余暇活用で、 個人で、3億円収入目的と社会には保証証券で保証の悲劇防止 の保証事業を一人で、在宅兼業で、経営(顧問・会長)しています。 配信停止は go...@ho...に 配信解除と □ メールアドレス □ を ◎ ご記入して◎ お願い申し上げます。返信、他の方法は配信 停止されませんので大変恐縮ですが宜しくお願い申し上げます。 あなた様も、よろしければ、顧問代行店の経営は在宅で、ネットで、余暇活用で 出来ます。(成人以上の男女・都道府県単位に私と同じ地位の顧問 代行店経営者数が法律により制限されています。審査合否あります) 真剣に3千万円から5億9千万円と 保証の悲劇者撲滅に ご関心のある方々に希少なチャンスです。 *==*==*==*====**==* ご挨拶 *==*==*==*====*==*==*==*==* 謹啓、時下益々ご健勝のこととお察し申し上げます。 突然の配信、切にご容赦お願い申し上げます。 3千万円、1億円、是非あった方がとの方々にお役に立つ在宅ビジネスです。 2億、3億、5億9千万円収入者が続出しています。 しかし、証拠がなければ誰でも信用しません。 □━━主たる物的証拠━━見せます━━何事も論より証拠━━□ 東京高等裁判所の判決書・2億、3億、5億9千万円収入の 銀行印有振込み書・福祉事務所よりの保証証券使用依頼書・他 □━━━━━━━━━━━━━━━━━━━━━━━━━━□ ◆多くの方が望む【5千万円、2億円・・保証人になる保証証券】の入手方 法は大変お得な情報です。 ■ よろしければHPをご覧願います。お役に立ちます。■ ☆〜〜〜〜〜〜☆〜〜〜〜〜☆★ 2億・3億・5億9千万円収入者続出ー事実証拠確認歓迎 成人男女・副業在宅高額ネット収入目的に最適 ※ 資料ご請求は http://www.hosyou.org から・・3億円へ!一歩! 【証拠ご覧下さい。証拠が高額収入の案内人です】論より証拠です。 |