pyobjc-dev Mailing List for PyObjC (Page 37)
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: Ronald O. <ron...@ma...> - 2009-10-19 18:26:29
|
On 19 Oct, 2009, at 16:36, Jonathan Wight wrote: > What's the state of some of the non-mainline features of pyobjc these > days? Particularly: > > * Any particular reason why latest build of pyobjc can't be installed > via easy_install on Snow Leopard? I haven't gotten around doing a release of the current state yet. > > * What's the current state of 64-bit _AND_ Garbage Collection with > PyObjc on Snow Leopard? I have an app that is both - and PyObjc (at > least w/Snow Leopard's pre-installed PyObjc) can't even be linked in > (at least with GC). PyObjC does not support GC. The expand on that: * AFAIK Python is not build correctly to link into GC enabled applications * While I try to ensure that PyObjC's reference management is safe w.r.t. GC (using CFRetain/CFRelease rather than -retain/-release) I have never tested if this is sufficient. That means PyObjC is almost certainly unsafe w.r.t. GC. Ronald |
From: Jonathan W. <jwi...@to...> - 2009-10-19 15:04:08
|
What's the state of some of the non-mainline features of pyobjc these days? Particularly: * Any particular reason why latest build of pyobjc can't be installed via easy_install on Snow Leopard? * What's the current state of 64-bit _AND_ Garbage Collection with PyObjc on Snow Leopard? I have an app that is both - and PyObjc (at least w/Snow Leopard's pre-installed PyObjc) can't even be linked in (at least with GC). Jon. |
From: SourceForge.net <no...@so...> - 2009-10-19 11:59:16
|
Bugs item #2881682, was opened at 2009-10-19 13:59 Message generated for change (Tracker Item Submitted) made by kiilerix You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=2881682&group_id=14534 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: kiilerix (kiilerix) Assigned to: Nobody/Anonymous (nobody) Summary: License? Initial Comment: Could you please make a clear statement about the pyobjc license on http://pyobjc.sourceforge.net/ or about or something like that ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=2881682&group_id=14534 |
From: Nathan <nat...@gm...> - 2009-10-18 16:54:50
|
On Wed, Sep 30, 2009 at 3:12 PM, Ronald Oussoren <ron...@ma...> wrote: > Hi, > > Is anyone still interested in PyObjC on OSX 10.4? I haven't done any > development on 10.4 in a long time and while having 10.4 support would be > nice to have I don't think I'll ever get around to finishing 10.4 support in > PyObjC 2.x. We are not. We dropped PPC and Tiger support in 2008. ~ Nathan |
From: Ronald O. <ron...@ma...> - 2009-10-13 11:16:01
|
On 12 Oct, 2009, at 11:11, Ronald Oussoren wrote: > Vladimir, > > Pyobjc does support blocks and you should pass a function wherever the > obc side expects a block. > > Sadly enough blocks are not introspectable at runtime in the objc (or > blocks) runtime which means we have to provide additional custom > metadata. You seem to have found a method where we haven't done that > yet and I'll fix that for the next release. Guido's timemachine rules again... It turns out this was already fixed in the repository. Ronald > > Ronald > > > > On 12 okt 2009, at 09:08, Vladimir Pouzanov <far...@gm...> > wrote: > >> Hi all, >> >> Does PyObjC support selectors with block arguments? I'm trying to >> make >> use of NSOpenPanel's beginSheetModalForWindow_completionHandler_, but >> I'm somewhat unsure what to pass as the second argument. I've tried >> creating a callback function like this: >> >> def doneImport_(res): >> print "panel","returned",res >> >> But I'm getting <type 'exceptions.TypeError'>: Argument 3 is a block, >> but no signature available >> >> Wrapping the function with @objc.signature('vI') doesn't help >> either. Any hints? >> >> -- >> Sincerely, >> Vladimir "Farcaller" Pouzanov >> http://farcaller.net/ >> >> --- >> --- >> --- >> --------------------------------------------------------------------- >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart >> your >> developing skills, take BlackBerry mobile applications to market and >> stay >> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> http://p.sf.net/sfu/devconference >> _______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Ronald O. <ron...@ma...> - 2009-10-13 11:14:39
|
On 9 Oct, 2009, at 14:46, James R Eagan wrote: > > > > From what I can tell, the relevant code is in pyobc-core/Lib/objc/ > _convenience.py:88 : > > if sel in CONVENIENCE_METHODS: > v = CONVENIENCE_METHODS[sel] > for nm, value in v: > if nm in type_dict and isinstance(type_dict[nm], > selector): > > # Clone attributes of already existing version > > t = type_dict[nm] > v = selector(value, selector=t.selector, > signature=t.signature, > isClassMethod=t.isClassMethod) > > type_dict[nm] = v > else: > type_dict[nm] = value > > This seems to be a fairly core portion of the PyObjC, and I have not > explored the ramifications of modifying the inner if ... else block > to only add the convenience methods if the nm is not already in > type_dict. Should that else really be an "elif nm not in type_dict" ? Yes. I've just commited a patch that does that. The patch is not perfect though, if you override objectForKey: in a subclass that subclass will once again get the generic __getitem__ from pyobjc. Ronald > > Cheers! > James > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Ronald O. <ron...@ma...> - 2009-10-12 09:12:18
|
Vladimir, Pyobjc does support blocks and you should pass a function wherever the obc side expects a block. Sadly enough blocks are not introspectable at runtime in the objc (or blocks) runtime which means we have to provide additional custom metadata. You seem to have found a method where we haven't done that yet and I'll fix that for the next release. Ronald On 12 okt 2009, at 09:08, Vladimir Pouzanov <far...@gm...> wrote: > Hi all, > > Does PyObjC support selectors with block arguments? I'm trying to make > use of NSOpenPanel's beginSheetModalForWindow_completionHandler_, but > I'm somewhat unsure what to pass as the second argument. I've tried > creating a callback function like this: > > def doneImport_(res): > print "panel","returned",res > > But I'm getting <type 'exceptions.TypeError'>: Argument 3 is a block, > but no signature available > > Wrapping the function with @objc.signature('vI') doesn't help > either. Any hints? > > -- > Sincerely, > Vladimir "Farcaller" Pouzanov > http://farcaller.net/ > > --- > --- > --- > --------------------------------------------------------------------- > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Vladimir P. <far...@gm...> - 2009-10-12 07:08:49
|
Hi all, Does PyObjC support selectors with block arguments? I'm trying to make use of NSOpenPanel's beginSheetModalForWindow_completionHandler_, but I'm somewhat unsure what to pass as the second argument. I've tried creating a callback function like this: def doneImport_(res): print "panel","returned",res But I'm getting <type 'exceptions.TypeError'>: Argument 3 is a block, but no signature available Wrapping the function with @objc.signature('vI') doesn't help either. Any hints? -- Sincerely, Vladimir "Farcaller" Pouzanov http://farcaller.net/ |
From: Ronald O. <ron...@ma...> - 2009-10-11 19:49:08
|
On 11 Oct, 2009, at 17:54, Leonardo Santagada wrote: > > On Oct 11, 2009, at 8:03 AM, Ronald Oussoren wrote: > >> >> On 10 Oct, 2009, at 1:42, Jan-Hendrik Hanne wrote: >> >>> Hi Ronald, >>> >>> Ronald Oussoren schrieb: >>>> - how does it not work? >>>> - and on which os-release? >>> >>> I am using the Iphone, this might be the problem. >> >> I don't support PyObjC on iPhone and won't do so until there is a >> way to run python code on the iPhone without breaking the SDK rules. >> > > What sdk rules does it break? Aparently the no interpreter rule is > just for the download of code to be interpreted. Theres already a ton > of lua apps on the iphone. Last time I checked (around the 3.0 release) the SDK did not allow interpreted languages other than the ones supplied by Apple. Other than that I don't have the time to work on an official port of PyObjC to the iPhone, its hard enough to find enough time to seriously work on PyObjC for OSX. Ronald |
From: Leonardo S. <san...@gm...> - 2009-10-11 15:54:35
|
On Oct 11, 2009, at 8:03 AM, Ronald Oussoren wrote: > > On 10 Oct, 2009, at 1:42, Jan-Hendrik Hanne wrote: > >> Hi Ronald, >> >> Ronald Oussoren schrieb: >>> - how does it not work? >>> - and on which os-release? >> >> I am using the Iphone, this might be the problem. > > I don't support PyObjC on iPhone and won't do so until there is a > way to run python code on the iPhone without breaking the SDK rules. > What sdk rules does it break? Aparently the no interpreter rule is just for the download of code to be interpreted. Theres already a ton of lua apps on the iphone. -- Leonardo Santagada santagada at gmail.com |
From: Ronald O. <ron...@ma...> - 2009-10-11 11:04:11
|
On 10 Oct, 2009, at 1:42, Jan-Hendrik Hanne wrote: > Hi Ronald, > > Ronald Oussoren schrieb: >> - how does it not work? >> - and on which os-release? > > I am using the Iphone, this might be the problem. I don't support PyObjC on iPhone and won't do so until there is a way to run python code on the iPhone without breaking the SDK rules. > > This is my code: > > self.stream=NSOutputStream.alloc().initToFileAtPath_append_ > (self.pathToFile,YES) > self.stream.open() > > Works great so far. Empty file is created. > > stream.write_maxLength_("test",4) > App crashes here > This works fine with the current trunk on OSX 10.6: >>> from Foundation import NSOutputStream >>> s = NSOutputStream.alloc().initToFileAtPath_append_('/tmp/ log.txt', False) >>> s.open() >>> s.write_maxLength_('test', 4) 4 >>> s.close() The file then contains the bytes I wrote to it. >> - which version of pyobjc are you using? > > 1946-3 I have no idea what this version number means, this might be some internal version code for the iPhone port. Please ask the developer of the iPhone port to investigate, this seems to be a problem in that port. Ronald > > Jan > >> Ronald >> On 9 okt 2009, at 20:04, Jan-Hendrik Hanne <j-h...@tu...> >> wrote: >>> Hi! >>> >>> Ronald Oussoren wrote: >>>> On Friday, October 09, 2009, at 04:53PM, "Jan-Hendrik Hanne" <j-h...@tu... >>>> > wrote: >>>>> Hi! >>>>> >>>>> Maybe this question was answered before, but I couldn't find it >>>>> in the archive. >>>>> How can I use C data types in Python? >>>>> Concrete: I want to use >>>>> - (NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger) >>>>> length >>>>> of the NSOutputStream class. >>>>> How can I create the buffer? >>>> The buffer should be a python string, or another type that >>>> implements the buffer protocol (an array.array of bytes should >>>> therefore also work). >>>> That is: >>>> aStream.write_maxLength_("hello world", 10) >>> >>> Thank you for your fast answer. Unfortunately, it doesn't work >>> with a string. I decided to write the file in the python way. >>> Hopefully it is fast enough. >>> >>> Jan >>> >>>> Ronald >>>>> Thanks >>>>> Jan >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Come build with us! The BlackBerry(R) Developer Conference in >>>>> SF, CA >>>>> is the only developer event you need to attend this year. >>>>> Jumpstart your >>>>> developing skills, take BlackBerry mobile applications to market >>>>> and stay ahead of the curve. Join us from November 9 - 12, 2009. >>>>> Register now! >>>>> http://p.sf.net/sfu/devconference >>>>> _______________________________________________ >>>>> Pyobjc-dev mailing list >>>>> Pyo...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>> >>>>> >>> > > -- > Jan-Hendrik Hanne > Mittelweg 94 > 38106 Braunschweig > Tel: 0531/2889855 |
From: Jan-Hendrik H. <j-h...@tu...> - 2009-10-09 23:42:54
|
Hi Ronald, Ronald Oussoren schrieb: > - how does it not work? > - and on which os-release? I am using the Iphone, this might be the problem. This is my code: self.stream=NSOutputStream.alloc().initToFileAtPath_append_(self.pathToFile,YES) self.stream.open() Works great so far. Empty file is created. stream.write_maxLength_("test",4) App crashes here > - which version of pyobjc are you using? 1946-3 Jan > Ronald > > > > On 9 okt 2009, at 20:04, Jan-Hendrik Hanne <j-h...@tu...> wrote: > >> Hi! >> >> Ronald Oussoren wrote: >>> On Friday, October 09, 2009, at 04:53PM, "Jan-Hendrik Hanne" >>> <j-h...@tu...> wrote: >>>> Hi! >>>> >>>> Maybe this question was answered before, but I couldn't find it in >>>> the archive. >>>> How can I use C data types in Python? >>>> Concrete: I want to use >>>> - (NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length >>>> of the NSOutputStream class. >>>> How can I create the buffer? >>> The buffer should be a python string, or another type that implements >>> the buffer protocol (an array.array of bytes should therefore also >>> work). >>> That is: >>> aStream.write_maxLength_("hello world", 10) >> >> Thank you for your fast answer. Unfortunately, it doesn't work with a >> string. I decided to write the file in the python way. Hopefully it is >> fast enough. >> >> Jan >> >>> Ronald >>>> Thanks >>>> Jan >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >>>> is the only developer event you need to attend this year. Jumpstart >>>> your >>>> developing skills, take BlackBerry mobile applications to market and >>>> stay ahead of the curve. Join us from November 9 - 12, 2009. >>>> Register now! >>>> http://p.sf.net/sfu/devconference >>>> _______________________________________________ >>>> Pyobjc-dev mailing list >>>> Pyo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>> >>>> >> > -- Jan-Hendrik Hanne Mittelweg 94 38106 Braunschweig Tel: 0531/2889855 |
From: Ronald O. <ron...@ma...> - 2009-10-09 20:20:31
|
Jan, - how does it not work? - which version of pyobjc are you using? - and on which os-release? Ronald On 9 okt 2009, at 20:04, Jan-Hendrik Hanne <j-h...@tu...> wrote: > Hi! > > Ronald Oussoren wrote: >> On Friday, October 09, 2009, at 04:53PM, "Jan-Hendrik Hanne" <j-h...@tu... >> > wrote: >>> Hi! >>> >>> Maybe this question was answered before, but I couldn't find it in >>> the archive. >>> How can I use C data types in Python? >>> Concrete: I want to use >>> - (NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger) >>> length >>> of the NSOutputStream class. >>> How can I create the buffer? >> The buffer should be a python string, or another type that >> implements the buffer protocol (an array.array of bytes should >> therefore also work). >> That is: >> aStream.write_maxLength_("hello world", 10) > > Thank you for your fast answer. Unfortunately, it doesn't work with > a string. I decided to write the file in the python way. Hopefully > it is fast enough. > > Jan > >> Ronald >>> Thanks >>> Jan >>> >>> --- >>> --- >>> --- >>> --- >>> ------------------------------------------------------------------ >>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >>> is the only developer event you need to attend this year. >>> Jumpstart your >>> developing skills, take BlackBerry mobile applications to market >>> and stay ahead of the curve. Join us from November 9 - 12, 2009. >>> Register now! >>> http://p.sf.net/sfu/devconference >>> _______________________________________________ >>> Pyobjc-dev mailing list >>> Pyo...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>> >>> > |
From: Jan-Hendrik H. <j-h...@tu...> - 2009-10-09 18:04:23
|
Hi! Ronald Oussoren wrote: > > On Friday, October 09, 2009, at 04:53PM, "Jan-Hendrik Hanne" <j-h...@tu...> wrote: >> Hi! >> >> Maybe this question was answered before, but I couldn't find it in the >> archive. >> How can I use C data types in Python? >> Concrete: I want to use >> - (NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length >> of the NSOutputStream class. >> How can I create the buffer? > > The buffer should be a python string, or another type that implements the buffer protocol (an array.array of bytes should therefore also work). > > That is: > > aStream.write_maxLength_("hello world", 10) Thank you for your fast answer. Unfortunately, it doesn't work with a string. I decided to write the file in the python way. Hopefully it is fast enough. Jan > > Ronald >> Thanks >> Jan >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> http://p.sf.net/sfu/devconference >> _______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >> >> > |
From: Ronald O. <ron...@ma...> - 2009-10-09 15:15:55
|
On Friday, October 09, 2009, at 04:53PM, "Jan-Hendrik Hanne" <j-h...@tu...> wrote: >Hi! > >Maybe this question was answered before, but I couldn't find it in the >archive. >How can I use C data types in Python? >Concrete: I want to use >- (NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length >of the NSOutputStream class. >How can I create the buffer? The buffer should be a python string, or another type that implements the buffer protocol (an array.array of bytes should therefore also work). That is: aStream.write_maxLength_("hello world", 10) Ronald > >Thanks >Jan > >------------------------------------------------------------------------------ >Come build with us! The BlackBerry(R) Developer Conference in SF, CA >is the only developer event you need to attend this year. Jumpstart your >developing skills, take BlackBerry mobile applications to market and stay >ahead of the curve. Join us from November 9 - 12, 2009. Register now! >http://p.sf.net/sfu/devconference >_______________________________________________ >Pyobjc-dev mailing list >Pyo...@li... >https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > |
From: Jan-Hendrik H. <j-h...@tu...> - 2009-10-09 15:10:14
|
Hi! Maybe this question was answered before, but I couldn't find it in the archive. How can I use C data types in Python? Concrete: I want to use - (NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length of the NSOutputStream class. How can I create the buffer? Thanks Jan |
From: James R E. <Jam...@lr...> - 2009-10-09 14:59:55
|
On 9 oct. 2009, at 16:53, Ronald Oussoren wrote: > PyObjC currently blindly adds its own version of __getitem__ when it > detects that a Cocoa class implements objectForKey: or > objectAtIndex:. It should be easy enough to check that the Cocoa > class doesn't have its own version of __getitem__ before adding the > generic version. Is the method I suggested to do that appropriate, or does it look like it should have unforeseen consequences? > BTW. In the longer run (that is, post 2.2 final) I will remove this > logic and switch to class-based logic instead. That is, rather then > looking for objectForKey: I'll add a list of classes that will get a > __getitem__ implementation. Yikes. In that case, I'll uncomment my own __getitem__ handlers, even though it's currently a dead code path. I don't want that interface to suddenly break in a future PyObjC. Cheers! James -- James R. Eagan LRI — Bâtiment 490 Université de Paris-Sud XI email: Jam...@lr... 91405 Orsay Cedex — France web: http://www.lri.fr/~eaganj |
From: Ronald O. <ron...@ma...> - 2009-10-09 14:53:27
|
James, PyObjC currently blindly adds its own version of __getitem__ when it detects that a Cocoa class implements objectForKey: or objectAtIndex:. It should be easy enough to check that the Cocoa class doesn't have its own version of __getitem__ before adding the generic version. BTW. In the longer run (that is, post 2.2 final) I will remove this logic and switch to class-based logic instead. That is, rather then looking for objectForKey: I'll add a list of classes that will get a __getitem__ implementation. This is slightly less generic, but allows me to optimize method dispatch. Ronald On Friday, October 09, 2009, at 02:46PM, "James R Eagan" <Jam...@lr...> wrote: >Hi folks, > >I was trying to be smart in a class that provides both a Cocoa-style >and Pythonic interface (i.e. implementing both objectForKey_ and >__getitem__ and friends). It turns out that PyObjC already does that >for me (cool!), but in the process of debugging an unrelated fault in >my program, I noticed that the implementation in PyObjC will always >replace __getitem__ with __getitem__objectForKey_, meaning that it is >impossible to combine different lookup behaviors for the Objective-C >and Pythonic interfaces. (I'm haven't yet convinced myself that this >is necessarily a bad thing.) See the following example: > > >>> from Foundation import * > >>> import objc > >>> class Foo(NSObject): > ... def objectForKey_(self, key): > ... return 'object for key' > ... def __getitem__(self, key): > ... return 'getitem' > ... > >>> foo = Foo.alloc().init() > >>> foo.objectForKey_('foo') > 'object for key' > >>> foo['foo'] > 'object for key' > >>> foo.__getitem__ > <bound method Foo.__getitem__objectForKey_ of <Foo: 0x370e880>> > > > From what I can tell, the relevant code is in pyobc-core/Lib/objc/ >_convenience.py:88 : > > if sel in CONVENIENCE_METHODS: > v = CONVENIENCE_METHODS[sel] > for nm, value in v: > if nm in type_dict and isinstance(type_dict[nm], >selector): > > # Clone attributes of already existing version > > t = type_dict[nm] > v = selector(value, selector=t.selector, > signature=t.signature, >isClassMethod=t.isClassMethod) > > type_dict[nm] = v > else: > type_dict[nm] = value > >This seems to be a fairly core portion of the PyObjC, and I have not >explored the ramifications of modifying the inner if ... else block to >only add the convenience methods if the nm is not already in >type_dict. Should that else really be an "elif nm not in type_dict" ? > >Cheers! >James > > > >------------------------------------------------------------------------------ >Come build with us! The BlackBerry(R) Developer Conference in SF, CA >is the only developer event you need to attend this year. Jumpstart your >developing skills, take BlackBerry mobile applications to market and stay >ahead of the curve. Join us from November 9 - 12, 2009. Register now! >http://p.sf.net/sfu/devconference >_______________________________________________ >Pyobjc-dev mailing list >Pyo...@li... >https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > |
From: James R E. <Jam...@lr...> - 2009-10-09 12:47:03
|
Hi folks, I was trying to be smart in a class that provides both a Cocoa-style and Pythonic interface (i.e. implementing both objectForKey_ and __getitem__ and friends). It turns out that PyObjC already does that for me (cool!), but in the process of debugging an unrelated fault in my program, I noticed that the implementation in PyObjC will always replace __getitem__ with __getitem__objectForKey_, meaning that it is impossible to combine different lookup behaviors for the Objective-C and Pythonic interfaces. (I'm haven't yet convinced myself that this is necessarily a bad thing.) See the following example: >>> from Foundation import * >>> import objc >>> class Foo(NSObject): ... def objectForKey_(self, key): ... return 'object for key' ... def __getitem__(self, key): ... return 'getitem' ... >>> foo = Foo.alloc().init() >>> foo.objectForKey_('foo') 'object for key' >>> foo['foo'] 'object for key' >>> foo.__getitem__ <bound method Foo.__getitem__objectForKey_ of <Foo: 0x370e880>> From what I can tell, the relevant code is in pyobc-core/Lib/objc/ _convenience.py:88 : if sel in CONVENIENCE_METHODS: v = CONVENIENCE_METHODS[sel] for nm, value in v: if nm in type_dict and isinstance(type_dict[nm], selector): # Clone attributes of already existing version t = type_dict[nm] v = selector(value, selector=t.selector, signature=t.signature, isClassMethod=t.isClassMethod) type_dict[nm] = v else: type_dict[nm] = value This seems to be a fairly core portion of the PyObjC, and I have not explored the ramifications of modifying the inner if ... else block to only add the convenience methods if the nm is not already in type_dict. Should that else really be an "elif nm not in type_dict" ? Cheers! James |
From: Karsten W. <kar...@go...> - 2009-10-08 12:07:17
|
Hi, Am 30.09.2009 um 23:12 schrieb Ronald Oussoren: > Hi, > > Is anyone still interested in PyObjC on OSX 10.4? ... Yes. And unfortunately I'll have to for some time... and I gave up hopes for PyObjC 2.0 on Tiger a long time ago ;-) -karsten |
From: Andrea M. <am...@am...> - 2009-10-07 09:13:38
|
Hi to all! I'm a new member of this ML and I'm even a new coder in PyObjC. I've quite experience with python and I've started using Xcode for a little project we have here at work. I've read some documentation, expecially the great "An Epic Introduction to PyObjC and Cocoa" (http://lethain.com/entry/2008/aug/22/an-epic-introduction-to-pyobjc-and-cocoa/ ) and I've put up my application fast and clean. Great! On Leopard! Than I've upgraded to Snow Leopard and all Cocoa Bindings stopped working. More details: my application is very simple, it should show an array of dictionaries in a TableView. First I've put up an arrayObject linked to the TableView and every thing worked but it was too dirty, I had to "refill" the array linked to the TableView every time something changed in the original array. Than, reading the Epic Introduction I discovered the power of Cocoa Bindings. I've added an Array Controller to my xib file, put up all bindings and every thing went really smooth! That was great. Suddenly on Snow Leopard Cocoa Bindings seem to fail. I've put up a little test application at http://dl.getdropbox.com/u/683371/bind.zip . On Leopard it works and on Xcode console you see that the Array Controller is full, on Snow Leopard it remains empty. I know it is a bit confused, but I hope someone has suggestions :) TIA Andrea Mistrali |
From: David E. <dav...@gm...> - 2009-10-07 06:16:22
|
On Tue, Oct 6, 2009 at 11:10 PM, Ronald Oussoren <ron...@ma...> wrote: > > On 7 Oct, 2009, at 3:09, David Eppstein wrote: > >> Just a follow-up on all this. The fix to the way I was wrongly calling >> super.init worked and my app is happy again. Because it all works I >> haven't yet tested the code to tell objc to be more verbose when an >> exception hits the border, but I assume that works too >> >> The XCode version of the app is about 200k and the setup.py version is >> about 16Mb, I assume because the setup.py version includes its own >> copy of Python. I haven't yet decided which of these two build styles >> is preferable; under 10.4 and before I would have definitely wanted >> the one that included its own Python, because otherwise there was no >> way of counting on it working on anyone else's computer, but is that >> still necessary these days? > > The setup.py version is larger because py2app copies more stuff into the > application bundle. Are you using Apple's python or do you have a separate > python install? Apple's. |
From: Ronald O. <ron...@ma...> - 2009-10-07 06:10:32
|
On 7 Oct, 2009, at 3:09, David Eppstein wrote: > Just a follow-up on all this. The fix to the way I was wrongly calling > super.init worked and my app is happy again. Because it all works I > haven't yet tested the code to tell objc to be more verbose when an > exception hits the border, but I assume that works too > > The XCode version of the app is about 200k and the setup.py version is > about 16Mb, I assume because the setup.py version includes its own > copy of Python. I haven't yet decided which of these two build styles > is preferable; under 10.4 and before I would have definitely wanted > the one that included its own Python, because otherwise there was no > way of counting on it working on anyone else's computer, but is that > still necessary these days? The setup.py version is larger because py2app copies more stuff into the application bundle. Are you using Apple's python or do you have a separate python install? > > However, I still have one minor hangup that is causing the setup.py > version not to work: my source code has a .xib file inside > English.lproj which XCode helpfully translates to a .nib while > packaging up the app, but setup.py doesn't seem to know to do that > translation. If I manually move XCode's nib into the English.lproj of > the app created by setup.py, it all works, so I'm pretty sure that's > the only problem. Is there a way of doing the xib-to-nib conversion > outside of xcode under the control of setup.py? The most recent version of py2app has support for compiling .xib files. Ronald > > On Tue, Oct 6, 2009 at 8:46 AM, Ronald Oussoren <ron...@ma... > > wrote: >> >> On 6 Oct, 2009, at 17:42, David Eppstein wrote: >> >>> >>> """ >>> Script for building LaTeX Unicodifier >>> D. Eppstein, October 2009 >>> >>> Usage: >>> python setup.py py2app >>> """ >>> >>> from distutils.core import setup >>> import py2app >>> >>> plist = { >>> 'CFBundleDevelopmentRegion': 'English', >>> 'CFBundleExecutable': 'LaTeX Unicodifier', >>> 'CFBundleIconFile': 'LaTeX Unicodifier.icns', >>> } >>> >>> setup( >>> app = ['Latex.py', 'LaTeX_Unicodifier.py'], >> >> Use: >> app = ['main.py'], >>> >>> data_files = ['English.lproj', 'LaTeX Unicodifier.icns'], >>> options = { 'py2app': {'plist': plist} } >>> ) >> >> The interface design for py2app was copied from py2exe, which is >> why you can >> list several applications in the 'app' argument. Having more than one >> application in setup.py is not implemented, and is luckily also not >> what you >> need. >> >> Ronald >> >> >> >> |
From: David E. <dav...@gm...> - 2009-10-07 01:10:06
|
Just a follow-up on all this. The fix to the way I was wrongly calling super.init worked and my app is happy again. Because it all works I haven't yet tested the code to tell objc to be more verbose when an exception hits the border, but I assume that works too The XCode version of the app is about 200k and the setup.py version is about 16Mb, I assume because the setup.py version includes its own copy of Python. I haven't yet decided which of these two build styles is preferable; under 10.4 and before I would have definitely wanted the one that included its own Python, because otherwise there was no way of counting on it working on anyone else's computer, but is that still necessary these days? However, I still have one minor hangup that is causing the setup.py version not to work: my source code has a .xib file inside English.lproj which XCode helpfully translates to a .nib while packaging up the app, but setup.py doesn't seem to know to do that translation. If I manually move XCode's nib into the English.lproj of the app created by setup.py, it all works, so I'm pretty sure that's the only problem. Is there a way of doing the xib-to-nib conversion outside of xcode under the control of setup.py? On Tue, Oct 6, 2009 at 8:46 AM, Ronald Oussoren <ron...@ma...> wrote: > > On 6 Oct, 2009, at 17:42, David Eppstein wrote: > >> >> """ >> Script for building LaTeX Unicodifier >> D. Eppstein, October 2009 >> >> Usage: >> python setup.py py2app >> """ >> >> from distutils.core import setup >> import py2app >> >> plist = { >> 'CFBundleDevelopmentRegion': 'English', >> 'CFBundleExecutable': 'LaTeX Unicodifier', >> 'CFBundleIconFile': 'LaTeX Unicodifier.icns', >> } >> >> setup( >> app = ['Latex.py', 'LaTeX_Unicodifier.py'], > > Use: > app = ['main.py'], >> >> data_files = ['English.lproj', 'LaTeX Unicodifier.icns'], >> options = { 'py2app': {'plist': plist} } >> ) > > The interface design for py2app was copied from py2exe, which is why you can > list several applications in the 'app' argument. Having more than one > application in setup.py is not implemented, and is luckily also not what you > need. > > Ronald > > > > |
From: Ronald O. <ron...@ma...> - 2009-10-06 15:47:01
|
On 6 Oct, 2009, at 17:42, David Eppstein wrote: > > """ > Script for building LaTeX Unicodifier > D. Eppstein, October 2009 > > Usage: > python setup.py py2app > """ > > from distutils.core import setup > import py2app > > plist = { > 'CFBundleDevelopmentRegion': 'English', > 'CFBundleExecutable': 'LaTeX Unicodifier', > 'CFBundleIconFile': 'LaTeX Unicodifier.icns', > } > > setup( > app = ['Latex.py', 'LaTeX_Unicodifier.py'], Use: app = ['main.py'], > data_files = ['English.lproj', 'LaTeX Unicodifier.icns'], > options = { 'py2app': {'plist': plist} } > ) The interface design for py2app was copied from py2exe, which is why you can list several applications in the 'app' argument. Having more than one application in setup.py is not implemented, and is luckily also not what you need. Ronald |