pyobjc-dev Mailing List for PyObjC (Page 67)
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
(1) |
Nov
|
Dec
|
|
From: scott h. <sc...@ya...> - 2008-01-31 16:55:13
|
I'm working with PyObjC version 2.0 per the Leopard distribution.
QTTrack.quickTimeMovie and QTMedia.quickTimeMovie both return
PyObjCPointers. For example, suppose movie is a QTMovie:
>>> track = movie.tracks()[0]
track = movie.tracks()[0]
>>> media = track.media()
media = track.media()
>>> pprint((movie, track, media))
pprint((movie, track, media))
(<QTMovie: 0x1a6bc30 time scale = 600, duration = 52049, rate =
0.000000, tracks = { 0x1bf0c30 0x1bf0ec0 }>,
<QTTrack: 0x1bf0c30 Size = { 240, 320 }, QTMedia = 0x1f97a00>,
<QTMedia: 0x1f97a00 type = 'vide', time scale = 1500, duration =
130000>)
>>> qtm = media.quickTimeMedia()
qtm = media.quickTimeMedia()
2008-01-31 11:19:37.248 Python[7943:613] PyObjCPointer created: at
0xcbef4 of type ^{MediaType}
>>> qtm
qtm
<PyObjCPointer object at 0x27601c0>
>>>
FWIW there are other indications that QTKit is not completely wrapped.
For example, none of the QTMovie.movieWith... class methods appear to
be available in PyObjC (e.g. movieWithFile, movieWithURL). Instance
methods like initWithFile are available, so the absence of class
methods is not a showstopper.
I'm targeting 10.5 and beyond. QTKit doesn't yet let me get at the
media bits in ways that I need in my application. AudioUnits may be
applicable, but I haven't had a chance to come up to speed with them.
Thanks,
Scott
On Jan 31, 2008, at 4:33 AM, Ronald Oussoren wrote:
>
> On 30 Jan, 2008, at 23:33, Scott Herzinger wrote:
>
>> I'm looking for an idiom by which I can use a given PyObjCPointer,
>> that I get back from some Cocoa API, as a Carbon object (or pointer
>> thereto). My specific requirement currently is to take a
>> PyObjCPointer that I get back from a QTKit API, and use its
>> referent as a Carbon.Qt.Media object.
>
> PyObjCPointer objects are an indication of an incomplete wrapping of
> a framework. Which method returns a PyObjCPointer and in which
> version of PyObjC?
>
> In PyObjC2 a PyObjCPointer has an "pointerAsInteger" atrribute that
> returns the numeric value of the pointer, I don't remember if
> PyObjC1 has the same attribute. With that value and ctypes you can
> contruct a Carbon.QT object.
>
> BTW. What OS release are you targetting? Apple is clearly stearing
> away from the Carbon QuickTime API's in favour of QTKit (no 64-bit
> support in the Carbon API, no new development as well).
>
> Ronald
|
|
From: Ronald O. <ron...@ma...> - 2008-01-31 09:43:14
|
On 31 Jan, 2008, at 7:19, John Stoner wrote:
> in WiiRemoteDiscovery.h;
>
> @interface NSObject( WiiRemoteDiscoveryDelegate )
>
> - (void) WiiRemoteDiscovered:(WiiRemote*)wiimote;
> - (void) WiiRemoteDiscoveryError:(int)code;
>
> @end;
> in python;
>
> wd = WiiRemoteDiscovery.new()
> class wii_remote_discovery_delegate(WiiRemoteDiscoveryDelegate):
> def wiiRemoteDiscovered_(self, wiiRemote):
> self.wiiRemote=wiiRemote
> print "discovered"
> def WiiRemoteDiscoveryError_(self, returnCode):
> print "not discovered"
> x=wii_remote_discovery_delegate()
> wd.setDelegate_(x)
> wd.start()
>
> Traceback (most recent call last):
> File "/Users/jstoner/Documents/projects/boogiepants/wii.py", line
> 29, in <module>
> class wii_remote_discovery_delegate(WiiRemoteDiscoveryDelegate):
> NameError: name 'WiiRemoteDiscoveryDelegate' is not defined
> >>>
>
> Do I need to do a stub implementation of WiiRemoteDiscoveryDelegate
> or does PyObjC have a way to handle this?
WiiRemoteDiscoveryDelegate is not a class, but a category (which is
the ObjC way of adding new methods to an existingclass). You have to
define an objc.informal_protocol that defines which methods are
present in the WiiRemoteDiscoveryDelegate informal protocol (the
category in the header file). You can then define your delegate as a
subclass of NSObject, PyObjC will automaticly detect that you're
implementing an informal protocol and use the right type information
for your methods.
This is a sample protocol definition from the Foundation wrappers in
PyObjC 1.4:
NSArchiverCallback = _objc.informal_protocol(
"NSArchiverCallback",
[
# (Class)classForArchiver
_objc.selector(
None,
selector='classForArchiver',
signature='#@:',
isRequired=0,
),
# (id)replacementObjectForArchiver:(NSArchiver *)archiver
_objc.selector(
None,
selector='replacementObjectForArchiver:',
signature='@@:@',
isRequired=0,
),
]
)
The hardest part is defining the 'signature' strings, Apple's ADC
website contains an Objective-C runtime manual that explains how to
construct these strings.
Ronald
>
> --
> blog:
> http://www.generosity.org/stoner/
> 'In knowledge is power, in wisdom, humility.'
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|
|
From: Ronald O. <ron...@ma...> - 2008-01-31 09:33:06
|
On 30 Jan, 2008, at 23:33, Scott Herzinger wrote: > I'm looking for an idiom by which I can use a given PyObjCPointer, > that I get back from some Cocoa API, as a Carbon object (or pointer > thereto). My specific requirement currently is to take a > PyObjCPointer that I get back from a QTKit API, and use its referent > as a Carbon.Qt.Media object. PyObjCPointer objects are an indication of an incomplete wrapping of a framework. Which method returns a PyObjCPointer and in which version of PyObjC? In PyObjC2 a PyObjCPointer has an "pointerAsInteger" atrribute that returns the numeric value of the pointer, I don't remember if PyObjC1 has the same attribute. With that value and ctypes you can contruct a Carbon.QT object. BTW. What OS release are you targetting? Apple is clearly stearing away from the Carbon QuickTime API's in favour of QTKit (no 64-bit support in the Carbon API, no new development as well). Ronald |
|
From: Bob V. <pyo...@bo...> - 2008-01-31 08:32:07
|
WiiRemoteDiscoveryDelegate is the name of an informal protocol,
declared here as a category, not an Objective-C class. You can't
instantiate an instance of a category as you can a class.
To implement this protocol, simply define a class that implements the
instance methods declared in the protocol interface, like so:
from Foundation import *
class WiiRemoteDiscoveryDelegate(NSObject):
def wiiRemoteDiscovered_(self, wiiRemote):
self.wiiRemote = wiiRemote
print "discovered"
def WiiRemoteDiscoveryError_(self, returnCode):
print "not discovered"
See http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_6_section_7.html
for more information.
Ciao,
Bob
On Jan 30, 2008, at 10:19 PM, John Stoner wrote:
> in WiiRemoteDiscovery.h;
>
> @interface NSObject( WiiRemoteDiscoveryDelegate )
>
> - (void) WiiRemoteDiscovered:(WiiRemote*)wiimote;
> - (void) WiiRemoteDiscoveryError:(int)code;
>
> @end;
> in python;
>
> wd = WiiRemoteDiscovery.new()
> class wii_remote_discovery_delegate(WiiRemoteDiscoveryDelegate):
> def wiiRemoteDiscovered_(self, wiiRemote):
> self.wiiRemote=wiiRemote
> print "discovered"
> def WiiRemoteDiscoveryError_(self, returnCode):
> print "not discovered"
> x=wii_remote_discovery_delegate()
> wd.setDelegate_(x)
> wd.start()
>
> Traceback (most recent call last):
> File "/Users/jstoner/Documents/projects/boogiepants/wii.py", line
> 29, in <module>
> class wii_remote_discovery_delegate(WiiRemoteDiscoveryDelegate):
> NameError: name 'WiiRemoteDiscoveryDelegate' is not defined
> >>>
>
> Do I need to do a stub implementation of WiiRemoteDiscoveryDelegate
> or does PyObjC have a way to handle this?
> --
> blog:
> http://www.generosity.org/stoner/
> 'In knowledge is power, in wisdom, humility.'
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|
|
From: John S. <joh...@gm...> - 2008-01-31 06:19:34
|
in WiiRemoteDiscovery.h;
@interface NSObject( WiiRemoteDiscoveryDelegate )
- (void) WiiRemoteDiscovered:(WiiRemote*)wiimote;
- (void) WiiRemoteDiscoveryError:(int)code;
@end;
in python;
wd = WiiRemoteDiscovery.new()
class wii_remote_discovery_delegate(WiiRemoteDiscoveryDelegate):
def wiiRemoteDiscovered_(self, wiiRemote):
self.wiiRemote=wiiRemote
print "discovered"
def WiiRemoteDiscoveryError_(self, returnCode):
print "not discovered"
x=wii_remote_discovery_delegate()
wd.setDelegate_(x)
wd.start()
Traceback (most recent call last):
File "/Users/jstoner/Documents/projects/boogiepants/wii.py", line 29, in
<module>
class wii_remote_discovery_delegate(WiiRemoteDiscoveryDelegate):
NameError: name 'WiiRemoteDiscoveryDelegate' is not defined
>>>
Do I need to do a stub implementation of WiiRemoteDiscoveryDelegate or does
PyObjC have a way to handle this?
--
blog:
http://www.generosity.org/stoner/
'In knowledge is power, in wisdom, humility.'
|
|
From: Bruce L. <lic...@gm...> - 2008-01-31 04:47:15
|
Ronald, Thanks for the response. It seems I am still not able to avoid getting the _class_addIvar is missing error when attempting to run my program on Tiger. Is this method called by the objc.ivar() method? Is there a way to compile or otherwise force this _class_addIvar method into the final standalone application? It would seem this would be a common problem, no? Is there something I am not doing? Thanks, Bruce |
|
From: Scott H. <sc...@ya...> - 2008-01-30 22:33:52
|
I'm looking for an idiom by which I can use a given PyObjCPointer, that I get back from some Cocoa API, as a Carbon object (or pointer thereto). My specific requirement currently is to take a PyObjCPointer that I get back from a QTKit API, and use its referent as a Carbon.Qt.Media object. For example, I have a QTMedia object qtkMedia for which I need direct access to the media samples. In ObjC, [qtkMedia quickTimeMedia] produces a pointer to a QuickTime MediaType struct. In PyObjC, qtkMedia.quickTimeMedia() produces a PyObjCPointer. I would like to use the value of that pointer in using methods defined for class Carbon.Qt.Media. The naive thing is to say something like the following: qtkMedia = QTKit.QTMedia.alloc().initSomething() qtMedia = qtkMedia.quickTimeMedia() qtMedia.GetMediaSample But that raises an AttributeError: 'PyObjCPointer' object has no attribute 'GetMediaSample', whereas if qtMedia were a Carbon.Qt.Media object, I get something like "<built-in method GetMediaSample of _Qt.Media object at 0x26eb120>" Can I "cast" a PyObjCPointer like this to an instance of some Python class like Carbon.Qt.Media? As always, thanks in advance, Scott |
|
From: Barry W. <bar...@gm...> - 2008-01-30 19:57:28
|
On Jan 30, 2008 11:45 AM, Ronald Oussoren <ron...@ma...> wrote:
>
> On 29 Jan, 2008, at 20:17, Michael McCracken wrote:
>
> > I was trying to init an NSGradient with the system PyObjC 2.0 in 10.5,
> > like this:
> >
> > aGradient =
> > NSGradient.alloc().initWithColorsAndLocations_(NSColor.blackColor(),
> > 0.0, NSColor.whiteColor(), 1.0, None)
> >
> > just a straight translation from ObjC. It didn't work:
> >
> > File "/Users/mmccrack/Products/Debug/Incoming.app/Contents/
> > Resources/INAnimActionView.py",
> > line 199, in drawRect_
> > aGradient.initWithColorsAndLocations_(NSColor.blackColor(), 0.0,
> > NSColor.whiteColor(), 1.0, None)
> > TypeError: Variadic functions/methods are not supported
>
> That's annoying, this is supposed to work. I'll have to look more
> closely to see what's going on, but my first guess is broken metadata.
>
Broken metadata for the initWithColorsAndLocations: seems likely to me
too. This does work:
In [2]: NSArray.arrayWithObjects_('abc',2,None)
Out[2]:
(
abc,
2
)
barry
|
|
From: Ronald O. <ron...@ma...> - 2008-01-30 19:52:21
|
On 30 Jan, 2008, at 4:24, Bruce Lichtenstein wrote:
> Sorry to flood the list with my comments...
>
>
> I fixed the sh /usr/bin/nidump problem for installing via a binary
> package by re-downloading the source code for the bdist_mpkg package
> and modifying the tools.py code as follows:
"easy_install bdist_mpkg==dev" should also work. Bob commited a fix
for this a while back, I commited a better fix more recently (using
the 'grp' module instead of running a commandline tool).
Ronald
>
>
> in the get_gid method
>
> replace:
> for line in os.popen('/usr/bin/nidump group .'):
> fields = line.split(':')
> if len(fields) >= 3:
> _cache[fields[0]] = int(fields[2])
>
>
>
> with:
>
> for line in os.popen('dscl . -list /Groups PrimaryGroupID'):
> fields = (line.split(' ',1))
> fields[0].strip()
> fields[1].strip()
> if len(fields) == 2:
> _cache[fields[0]] = int(fields[1])
>
> i am not sure if this fix is already out there...
>
> I still haven't been able to get a fully self-contained program, so
> any help will still be appreciated...
>
>
> Thanks,
>
> Bruce
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|
|
From: Ronald O. <ron...@ma...> - 2008-01-30 19:50:16
|
On 29 Jan, 2008, at 22:18, Luc Heinrich wrote: > Hey Ronald, > > Do you have a rough estimate of when PyObjC 2 might become usable on > OS X 10.4 ? I'm currently stuck on OS X 10.4.10 and I can't even > upgrade to 10.4.11 because PyObjC 1.4 is incompatible with Safari 3. > I'm soon going to upgrade my main dev machine to a new MacPro which > will obviously run Leopard, so eventhough I will be able to tweak my > build scripts to use the system PyObjC 2, I will still have to use a > separate build machine/partition running OS X 10.4 and PyObjC 1.4. > Using two different version of PyObjC for dev and for release builds > makes me slightly uncomfortable :) > > So any idea ? The version of pyobjc-core that's in the repository builds on Tiger and passes most tests there (IIRC most if not all failures are expected failures). I have to do three things to get a release that's usable on 10.4: 1) Generate "bridgesupport" metadata that can be shipped with PyObjC (as that metadata won't be present on 10.4) 2) Make sure manual bindings for functions that we introduced in Leopard use weak linking and/or conditional compilation 3) Test, test, test. I have no idea when I'll actually do those. I live in Leopard these days and don't need Tiger support myself, but would like to support Tiger anyway. Ronald > > > Please ? :) > > > PS: by the way, is PyObjC compatible with Python 2.4 ? PyObjC should work just fine with Python 2.4 > > > -- > Luc Heinrich > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Ronald O. <ron...@ma...> - 2008-01-30 19:45:19
|
On 29 Jan, 2008, at 20:17, Michael McCracken wrote: > I was trying to init an NSGradient with the system PyObjC 2.0 in 10.5, > like this: > > aGradient = > NSGradient.alloc().initWithColorsAndLocations_(NSColor.blackColor(), > 0.0, NSColor.whiteColor(), 1.0, None) > > just a straight translation from ObjC. It didn't work: > > File "/Users/mmccrack/Products/Debug/Incoming.app/Contents/ > Resources/INAnimActionView.py", > line 199, in drawRect_ > aGradient.initWithColorsAndLocations_(NSColor.blackColor(), 0.0, > NSColor.whiteColor(), 1.0, None) > TypeError: Variadic functions/methods are not supported That's annoying, this is supposed to work. I'll have to look more closely to see what's going on, but my first guess is broken metadata. Ronald |
|
From: Bruce L. <lic...@gm...> - 2008-01-30 04:14:28
|
Sorry to flood the list with my comments...
I fixed the sh /usr/bin/nidump problem for installing via a binary
package by re-downloading the source code for the bdist_mpkg package
and modifying the tools.py code as follows:
in the get_gid method
replace:
for line in os.popen('/usr/bin/nidump group .'):
fields = line.split(':')
if len(fields) >= 3:
_cache[fields[0]] = int(fields[2])
with:
for line in os.popen('dscl . -list /Groups PrimaryGroupID'):
fields = (line.split(' ',1))
fields[0].strip()
fields[1].strip()
if len(fields) == 2:
_cache[fields[0]] = int(fields[1])
i am not sure if this fix is already out there...
I still haven't been able to get a fully self-contained program, so
any help will still be appreciated...
Thanks,
Bruce
|
|
From: Bruce L. <lic...@gm...> - 2008-01-30 00:31:17
|
I would like to clarify... The error from attempting to use the package building command is actually due to the fact that there is no longer a /usr/bin/nidump (sh cannot find it). On Jan 29, 2008 5:02 PM, Bruce Lichtenstein <lic...@gm...> wrote: > Hello, > I have written a simple program which has been a pain to compile properly; > that is to say, when using x-code it compiles to a small (500 kB) not > self-contained application that crashes on opening on every system that does > not have pyobjc installed. I have gotten it to work stably on two systems > running Leopard and pyobjc, and figured out how to get a setup-file to > create what should be a universal binary (now ~12 MB). Unfortunately, it > fails to open on 10.4 systems, raising an error about _class_addIvar being > missing after being called by _objc.so (dynamically). > > The only reference I have found for the _class_addIvar related to 10.4 and > pyobjc is the objc-runtime-compat.h file. I don't know how to either force > this file to be compiled with the program or properly change my objc > function calls. I tried the recommendation in the header, but unfortunately, > for some reason, this brings up an error related to the undefined nature of > PyObjC_ functions. > > I suspect that my pyobjc installation is incomplete (particularly since I > have no PyObjC folder created after the installation ends -- attempting to > use the python setup.py bdist_mpkg --open command brings up the same > 'ValueError: group admin not found' on both of my computers before it > terminates. The sh install file seems to work (with large numbers of errors > (on an Intel iMac) or failures (on a PowerBook)) and has gotten me this > far... > > Any and all help will be appreciated, > > Bruce Lichtenstein > |
|
From: Bruce L. <lic...@gm...> - 2008-01-29 22:02:01
|
Hello, I have written a simple program which has been a pain to compile properly; that is to say, when using x-code it compiles to a small (500 kB) not self-contained application that crashes on opening on every system that does not have pyobjc installed. I have gotten it to work stably on two systems running Leopard and pyobjc, and figured out how to get a setup-file to create what should be a universal binary (now ~12 MB). Unfortunately, it fails to open on 10.4 systems, raising an error about _class_addIvar being missing after being called by _objc.so (dynamically). The only reference I have found for the _class_addIvar related to 10.4 and pyobjc is the objc-runtime-compat.h file. I don't know how to either force this file to be compiled with the program or properly change my objc function calls. I tried the recommendation in the header, but unfortunately, for some reason, this brings up an error related to the undefined nature of PyObjC_ functions. I suspect that my pyobjc installation is incomplete (particularly since I have no PyObjC folder created after the installation ends -- attempting to use the python setup.py bdist_mpkg --open command brings up the same 'ValueError: group admin not found' on both of my computers before it terminates. The sh install file seems to work (with large numbers of errors (on an Intel iMac) or failures (on a PowerBook)) and has gotten me this far... Any and all help will be appreciated, Bruce Lichtenstein |
|
From: Luc H. <lu...@ho...> - 2008-01-29 21:18:29
|
Hey Ronald, Do you have a rough estimate of when PyObjC 2 might become usable on OS X 10.4 ? I'm currently stuck on OS X 10.4.10 and I can't even upgrade to 10.4.11 because PyObjC 1.4 is incompatible with Safari 3. I'm soon going to upgrade my main dev machine to a new MacPro which will obviously run Leopard, so eventhough I will be able to tweak my build scripts to use the system PyObjC 2, I will still have to use a separate build machine/partition running OS X 10.4 and PyObjC 1.4. Using two different version of PyObjC for dev and for release builds makes me slightly uncomfortable :) So any idea ? Please ? :) PS: by the way, is PyObjC compatible with Python 2.4 ? -- Luc Heinrich |
|
From: Michael M. <mic...@gm...> - 2008-01-29 19:17:25
|
I was trying to init an NSGradient with the system PyObjC 2.0 in 10.5,
like this:
aGradient = NSGradient.alloc().initWithColorsAndLocations_(NSColor.blackColor(),
0.0, NSColor.whiteColor(), 1.0, None)
just a straight translation from ObjC. It didn't work:
File "/Users/mmccrack/Products/Debug/Incoming.app/Contents/Resources/INAnimActionView.py",
line 199, in drawRect_
aGradient.initWithColorsAndLocations_(NSColor.blackColor(), 0.0,
NSColor.whiteColor(), 1.0, None)
TypeError: Variadic functions/methods are not supported
I looked at the SVN trunk, and it seems to have support for arguments
passed as null terminated C arrays. I found, eg.,
'PyObjC_kNullTerminatedArray' being handled in a couple of places. Is
this new since the 10.5 release, or am I not triggering that code for
some reason?
As a workaround for NSGradient, this other method works just fine:
import array
aGradient = NSGradient.alloc().initWithColors_atLocations_colorSpace_([NSColor.blackColor(),
NSColor.whiteColor(), NSColor.blackColor()],
array.array('f', [0.0, 0.5, 1.0]),
NSColorSpace.deviceRGBColorSpace())
Mostly I'm just curious.
Thanks,
-mike
--
Michael McCracken
UCSD CSE PhD Candidate
research: http://www.cse.ucsd.edu/~mmccrack/
misc: http://michael-mccracken.net/wp/
|
|
From: Ronald O. <ron...@ma...> - 2008-01-29 07:23:25
|
On 27 Jan, 2008, at 5:01, Ian Johnson wrote:
> I am trying to use a framework with some delegate functions that
> pass structs in the call:
>
> - (void) buttonChanged:(WiiButtonType) type isPressed:(BOOL)
> isPressed;
>
> when I try to make this python function:
> def buttonChanged_isPressed_(self, type, isPressed):
> I get an error around pythonify_c_value
>
> if I change it to:
> def buttonChanged_isPressed_(self, *posargs, **kwdargs):
> print posargs
> print kwdargs
>
> the output is () and {}
>
> Does pyobjc not support structs in function calls?
PyObjC supports structs in method and function calls just fine, but
someone has to tell it that a struct is involved. You're actually
lucky that you didn't get a crash :-).
You have to define your callback like this:
def buttonChanged_isPressed_(self, type, isPressed):
pass
buttonChanged_isPressed_ = objc.selector(buttonChanged_isPressed_,
type="v@:ic")
That is, you have to tell the bridge the types of your argument
because the bridge has no information that tells it that the type
isn't "NSObject*".
If you plan to use this library more you can create a wrapper module
that allows you to just "import WiiRemote", you can then define an
objc.informal_protocol in that module that contains the method names
and signatures for the delegate callbacks.
Ronald
>
>
> here is my code in case anyone is interested:
> http://enja.org/enj/enjapen/enjapenAppDelegate.py
>
> and here is the library I am trying to use:
> http://darwiin-remote.svn.sourceforge.net/viewvc/darwiin-remote/WiiRemoteFramework/trunk/WiiRemote.h?view=markup
>
> --
> Ian Johnson
>
> Ignorance is Piss.
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|
|
From: Bill B. <bb...@ma...> - 2008-01-28 23:40:41
|
On Jan 28, 2008, at 10:38 AM, Olivier Fedrigo wrote: > have anyone resolved this problem yet? > I experience exactly the same issue. I've tried to reinstall xCode > after removing the older python and it did not work (but maybe I > forgot to delete some other aliases?) > any suggestions? 1. test python on command line; what is its path? 2. import objc from that version; what is its path? 3. add a bit of code to your main.py before the 'import objc' that dumps the python path b.bum |
|
From: Olivier F. <ofe...@du...> - 2008-01-28 18:38:19
|
have anyone resolved this problem yet? I experience exactly the same issue. I've tried to reinstall xCode =20 after removing the older python and it did not work (but maybe I =20 forgot to delete some other aliases?) any suggestions? Thanks, Olivier On Jan 26, 2008, at 10:13 PM, ka...@ma... wrote: > I did the experiment of santosh (importing sys and printing version =20= > in main.py), and I had a correct answer: > > [Session started at 2008-01-27 09:04:46 +0600.] > 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) > [GCC 4.0.1 (Apple Computer, Inc. build 5367)] > Traceback (most recent call last): > File "/Users/tdarrigrand/Documents/Python/Tutorial PyObjC/Tut/In =20 > Control/build/Debug/In Control.app/Contents/Resources/main.py", line =20= > 13, in <module> > import objc > ImportError: No module named objc > > It seems I get the correct version of python, but Xcode still =20 > doesn't find the module objc. :( > > Le 27 janv. 08 =E0 01:43, John Skidgel a =E9crit : > >> I had a similar problem when I upgraded from Tiger to Leopard. =20 >> fine. Not sure if this helps, but this is what I recall: >> I had an older install of Python and when I upgraded, an alias to =20 >> the older custom install of Python was still in /Developer/Library/=20= >> Frameworks (I think that was the path). I removed the alias and the =20= >> _older_ Python, ran the unistall for developer tools, re-installed =20= >> the developer tools, and then everything worked ok. >> >> On Jan 26, 2008, at 11:32 AM, santosh wrote: >> >>> I put in the following lines in main.py >>> >>> import sys >>> print sys.version >>> >>> The debugger console now shows: >>> >>> [Session started at 2008-01-26 11:17:03 -0800.] >>> 2.4.4 (#1, Oct 18 2006, 10:34:39) >>> [GCC 4.0.1 (Apple Computer, Inc. build 5341)] >>> Traceback (most recent call last): >>> File "/Users/oompag/Documents/coolshadow/MacGUI/test/aatest/=20 >>> build/Debug/aatest.app/Contents/Resources/main.py", line 12, in ? >>> import objc >>> ImportError: No module named objc >>> >>> hmmm ... >>> it is running python 2.4.4 from Xcode. >>> >>> typing python at the terminal I get: >>> Python 2.5.1 (r251:54863, Oct 9 2007, 20:39:46) >>> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin >>> >>> Santosh >>> >>> >>> >>> On Jan 25, 2008, at 11:04 PM, Bill Bumgarner wrote: >>> >>>> On Jan 25, 2008, at 9:10 PM, ka...@ma... wrote: >>>>> Following my previous message "Terminating app due to uncaught =20 >>>>> exception" , I read the experience of santosh (2008-01-23), and =20= >>>>> I guess mine is similar. More precisely, after Building and =20 >>>>> running the application, the Xcode window says "GDB program =20 >>>>> loaded" in the lower bar status. And in the Debugger window =20 >>>>> appears the message "Terminating app due to uncaught exception". =20= >>>>> Looking at the Debugger Console window, it looks like : >>>>> >>>>> Traceback (most recent call last): >>>>> File "~/Documents/Python/MySimpleClass/build/Release/=20 >>>>> MySimpleClass.app/Contents/Resources/main.py", line 10, in =20 >>>>> <module> >>>>> import objc >>>>> ImportError: No module named objc >>>>> >>>>> Is there a problem in installing PyObjC ? The module objc seems =20= >>>>> not to be available to the application. What can I do ? >>>> >>>> Do you have a custom install of Python floating around? Or a =20 >>>> custom install of PyObjC? >>>> >>>> b.bum >>>> = ------------------------------------------------------------------------- >>>> This SF.net email is sponsored by: Microsoft >>>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>>> = http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/___________________= ____________________________ >>>> Pyobjc-dev mailing list >>>> Pyo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>> >>> = ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Microsoft >>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>> = http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/___________________= ____________________________ >>> Pyobjc-dev mailing list >>> Pyo...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >> > > = ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > = http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/___________________= ____________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev Olivier Fedrigo, Ph.D. Biology Dpt. and Institute for Genome Sciences & Policy Duke University 4235 French Family Science Durham, NC 27708-0338 T. 919.668.7634 F. 919.660.7293 www.acpub.duke.edu/~ofedrigo/ |
|
From: Ronald O. <ron...@ma...> - 2008-01-28 13:23:47
|
On Monday, January 28, 2008, at 01:04PM, "Koen Bok" <ko...@ma...> wrote:
>I guess I have to do it that way. Could you supply me with some hints/
>directions how to start this?
>
>Thanks a lot,
Something like this should do the trick:
class NSObject (objc.Category(NSObject)):
def _pyobjc_performOnThread_(self, callinfo):
try:
sel, arg = callinfo
m = self.methodForSelector_(sel)
m(arg)
except: import traceback
traceback.print_exc()
_pyobjc_performOnThread = _objc.selector(_pyobjc_performOnThread,
sel="_pyobjc_performOnThread:")
def pyobjc_performSelector_onThread_withObject_waitUntilDone_(
self, aSelector, thread, arg, wait):
"""
A version of performSelector:onThread:withObject:waitUntilDone: that
will log exceptions in the called method (instead of aborting the
NSRunLoop on the other thread).
"""
self.performSelector_onThread_withObject_waitUntilDone_(
'pyobjc_performOnThread:', thread, (aSelector, arg), wait)
This is completely untested, but should do the trick, you can then use pyobjc_performSelector_onThread_withObject_waitUntilDone_ instead of the version without pyobjc_ prefix.
This would be a good addition for PyObjC 2.1 (at least when the other variants of performSelector are added as well).
Ronald
>
>Koen
>
>
>On 27 jan 2008, at 18:21, Ronald Oussoren wrote:
>
>> There's not much you can do about this, the cleanest way to avoid
>> stopping your application is to add you're own method for executing
>> code on the main loop and have that catch all exceptions. This can
>> easily be build on top of the NSObject version.
>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2008.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>_______________________________________________
>Pyobjc-dev mailing list
>Pyo...@li...
>https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>
>
|
|
From: Koen B. <ko...@ma...> - 2008-01-28 12:04:31
|
I guess I have to do it that way. Could you supply me with some hints/ directions how to start this? Thanks a lot, Koen On 27 jan 2008, at 18:21, Ronald Oussoren wrote: > There's not much you can do about this, the cleanest way to avoid > stopping your application is to add you're own method for executing > code on the main loop and have that catch all exceptions. This can > easily be build on top of the NSObject version. |
|
From: Ronald O. <ron...@ma...> - 2008-01-27 17:21:16
|
On 27 Jan, 2008, at 0:52, Koen Bok wrote: > Hi everyone, > > I have a (python) background thread running in our app. Whenever I get > an exception the app now crashes with a bus error without giving a > nice traceback. Is there any way to kill the thread if the main loop > gets an exception? This sounds a bit like a problem that's fixed in Python 2.6 and will have a workaround in PyObjC 2.1. In PyObjC 2.0 you'll get a hard crash in the following situation: a second thread calls one of the NSObject methods for executing a method on the main loop and there is an uncaught exception in that method. If you use Python 2.6 (which is in alpha) the program will terminate unexpectedly instead (that is, the exception will stop the runloop on the main thread and your program will therefore terminate). There's not much you can do about this, the cleanest way to avoid stopping your application is to add you're own method for executing code on the main loop and have that catch all exceptions. This can easily be build on top of the NSObject version. Ronald > > > Kindest regards, > > Koen Bok > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Ian J. <enj...@gm...> - 2008-01-27 04:02:45
|
I am trying to use a framework with some delegate functions that pass
structs in the call:
- (void) buttonChanged:(WiiButtonType) type isPressed:(BOOL) isPressed;
when I try to make this python function:
def buttonChanged_isPressed_(self, type, isPressed):
I get an error around pythonify_c_value
if I change it to:
def buttonChanged_isPressed_(self, *posargs, **kwdargs):
print posargs
print kwdargs
the output is () and {}
Does pyobjc not support structs in function calls?
here is my code in case anyone is interested:
http://enja.org/enj/enjapen/enjapenAppDelegate.py
and here is the library I am trying to use:
http://darwiin-remote.svn.sourceforge.net/viewvc/darwiin-remote/WiiRemoteFramework/trunk/WiiRemote.h?view=markup
--
Ian Johnson
Ignorance is Piss.
|
|
From: <ka...@ma...> - 2008-01-27 03:13:35
|
I did the experiment of santosh (importing sys and printing version in =20=
main.py), and I had a correct answer:
[Session started at 2008-01-27 09:04:46 +0600.]
2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)]
Traceback (most recent call last):
File "/Users/tdarrigrand/Documents/Python/Tutorial PyObjC/Tut/In =20
Control/build/Debug/In Control.app/Contents/Resources/main.py", line =20
13, in <module>
import objc
ImportError: No module named objc
It seems I get the correct version of python, but Xcode still doesn't =20=
find the module objc. :(
Le 27 janv. 08 =E0 01:43, John Skidgel a =E9crit :
> I had a similar problem when I upgraded from Tiger to Leopard. =20
> fine. Not sure if this helps, but this is what I recall:
> I had an older install of Python and when I upgraded, an alias to =20
> the older custom install of Python was still in /Developer/Library/=20
> Frameworks (I think that was the path). I removed the alias and the =20=
> _older_ Python, ran the unistall for developer tools, re-installed =20
> the developer tools, and then everything worked ok.
>
> On Jan 26, 2008, at 11:32 AM, santosh wrote:
>
>> I put in the following lines in main.py
>>
>> import sys
>> print sys.version
>>
>> The debugger console now shows:
>>
>> [Session started at 2008-01-26 11:17:03 -0800.]
>> 2.4.4 (#1, Oct 18 2006, 10:34:39)
>> [GCC 4.0.1 (Apple Computer, Inc. build 5341)]
>> Traceback (most recent call last):
>> File "/Users/oompag/Documents/coolshadow/MacGUI/test/aatest/build/=20=
>> Debug/aatest.app/Contents/Resources/main.py", line 12, in ?
>> import objc
>> ImportError: No module named objc
>>
>> hmmm ...
>> it is running python 2.4.4 from Xcode.
>>
>> typing python at the terminal I get:
>> Python 2.5.1 (r251:54863, Oct 9 2007, 20:39:46)
>> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
>>
>> Santosh
>>
>>
>>
>> On Jan 25, 2008, at 11:04 PM, Bill Bumgarner wrote:
>>
>>> On Jan 25, 2008, at 9:10 PM, ka...@ma... wrote:
>>>> Following my previous message "Terminating app due to uncaught =20
>>>> exception" , I read the experience of santosh (2008-01-23), and I =20=
>>>> guess mine is similar. More precisely, after Building and running =20=
>>>> the application, the Xcode window says "GDB program loaded" in =20
>>>> the lower bar status. And in the Debugger window appears the =20
>>>> message "Terminating app due to uncaught exception". Looking at =20
>>>> the Debugger Console window, it looks like :
>>>>
>>>> Traceback (most recent call last):
>>>> File "~/Documents/Python/MySimpleClass/build/Release/=20
>>>> MySimpleClass.app/Contents/Resources/main.py", line 10, in <module>
>>>> import objc
>>>> ImportError: No module named objc
>>>>
>>>> Is there a problem in installing PyObjC ? The module objc seems =20
>>>> not to be available to the application. What can I do ?
>>>
>>> Do you have a custom install of Python floating around? Or a =20
>>> custom install of PyObjC?
>>>
>>> b.bum
>>> =
-------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> =
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/___________________=
____________________________
>>> Pyobjc-dev mailing list
>>> Pyo...@li...
>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>>
>> =
-------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> =
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/___________________=
____________________________
>> Pyobjc-dev mailing list
>> Pyo...@li...
>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>
|
|
From: Koen B. <ko...@ma...> - 2008-01-26 23:53:00
|
Hi everyone, I have a (python) background thread running in our app. Whenever I get an exception the app now crashes with a bus error without giving a nice traceback. Is there any way to kill the thread if the main loop gets an exception? Kindest regards, Koen Bok |