pyobjc-dev Mailing List for PyObjC (Page 52)
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: Ronald O. <ron...@ma...> - 2009-03-29 14:41:41
|
There are two things that I'd really like to change in PyObjC, and
preferably both at the same time because this will probably involve
backward-incompatible changes.
The easy one is properties: I'd love to use "someObject.size = 5"
instead of "someObject.setSize_(5)". This is fairly easy to implement,
although defining custom read-accessors makes live slightly more
interesting (you cannot have a property named "foo" and a method named
"foo" in the same class in PyObjC). The largest blob of work for
this is generating the right metadata for PyObjC.
The other change I'd like to make is to get rid of the extremely long
and ugly method names in Python that are caused by segmented method
names in Objective-C.
"someObject.loadResource_withType_inDirectory_error_(.........)" is
ugly and often results in code that is too wide for a reasonably sized
window. This is were I need help, at the moment I don't know how to
get to a nicer API without changing the Python language (which I don't
want to do).
There are a number of requirements for a solution to this problem:
* Must not require manual mapping files
Manually maintained mapping files are bad because they are
maintained by persons, which make keeping up with Apple even
harder than it is at the moment.
* Should tackle both calling methods as well as defining methods
* Should have a simple description
Options I have though of and don't like:
* Define a __call__ method on NSObject that deduces the ObjC method
name from keyword arguments:
someObject(loadResource=1, inDirectory=2, error=None)
This could work for calling methods, but offers no clear path for
cleaning up method definitions. There are also
possible issues with calculating the method name, there's no
guarantee that there's a unique mapping from
keyword arguments to a selector (e.g. -addX:y:z: vs. addX:z:y:),
although that's probably not an issue in
practice.
A more significant issue is that this won't work for methods
without arguments (not all of which can be modelled
as properties).
* Use method-call chaining:
someObject.loadResource_(1).inDirectory_(2).error_(None)
This is ugly, has the same problems as the first option and as an
additonal problem it is unclear if this can
be made to work at all because some ObjC selectors are prefixes of
other selectors.
Ronald |
|
From: Ronald O. <ron...@ma...> - 2009-03-29 14:27:33
|
That's correct. Apple reserves names starting with underscores for
their own usage. I do sometimes use underscores in my own code, but
that code could get broken on future versions of OSX.
BTW. PyObjC code and regular python code cannot follow exactly the
same coding conventions for other reasons as well, PEP8 style nameing
for methods ("do_something" instead of "doSomething") causes problems
with PyObjC's automatic deduction of the ObjC method name.
Ronald
On 28 Mar, 2009, at 18:32, Petr Mifek wrote:
> Hi,
>
> I made some more digging into this matter and the only thing I found
> so
> far is this one (sorry, a long one):
>
> http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html#/
> /apple_ref/doc/uid/20001282-1003829-BCIBDJCA
>
> and some good insights here:
>
> http://www.cocoadev.com/index.pl?CodingGuidelines
>
> So unless anybody knows and posts more profound answer, I suggest that
> the paragraph in the PyObjC intro stating """...instance variables
> prefixed with underscores are reserved by the Objective-C
> runtime..."""
> was put there based on the Apple's recommendation of not using such
> variables.
>
> Cheers,
> Petr
>
> Orestis Markou wrote:
>> Hello all,
>>
>> I want to clarify a bit the advice of the documentation to *not* use
>> the Python conventions of not using leading underscores for "private"
>> instance attributes.
>>
>> Is it the danger of accidentally overwriting some other Obj-C
>> attribute if there's a name clash? What about methods with leading
>> underscores?
>>
>> I fully understand that in order a method to be accessible from Obj-C
>> code it has to follow the methodWithArg_andArg_(self, arg1, arg2)
>> convention. In my case, these are "private" methods that I have no
>> desire to expose to anyone.
>>
>> The class in question is just a delegate that implements a custom
>> init
>> method and the delegate method. These are the only things that use
>> the
>> obj-c convention. The rest of the code is using the Python
>> convention,
>> with leading underscores in attributes and methosd, property
>> decorators and so on.
>>
>> Testing indicates that things are working perfectly fine, I'm just
>> worried that there may some stability issues that may not visible at
>> this point. I've heard rumours of hard crashes that may have been
>> related to this, so I'm a bit worried.
>>
>> Thanks,
>> Orestis
>> --
>> or...@or...
>> http://orestis.gr/
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Pyobjc-dev mailing list
>> Pyo...@li...
>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|
|
From: Ronald O. <ron...@ma...> - 2009-03-29 14:01:38
|
Hi, The following blogpost hints on how IB communicates with Xcode to automaticly read IBAction and IBOutlet definitions from your source code: http://cocoawithlove.com/2009/02/interprocess-communication-snooping.html With some hacking on pyobjc-core I have a script that seems to implement the right interface, but sadly enough this doesn't actually work: IB says it has problems communicating with the script: 2009-03-29 08:45:17.238 Interface Builder[32180:10b] ERROR: PBXProjectWatcherServer: DO error while unregistering target watcher. 2009-03-29 08:45:17.239 Interface Builder[32180:10b] ERROR: PBXProjectWatcherServer: DO error while unregistering file watcher. 2009-03-29 08:45:17.240 Interface Builder[32180:10b] ERROR: PBXProjectWatcherServer: DO error while unregistering project file watcher. 2009-03-29 08:45:17.242 Interface Builder[32180:10b] ERROR: PBXProjectWatcherServer: DO error while unregistering target file watcher. 2009-03-29 08:45:17.243 Interface Builder[32180:10b] ERROR: PBXProjectWatcherServer: DO error while requesting project info. 2009-03-29 08:45:17.413 Interface Builder[32180:10b] ERROR: PBXProjectWatcherServer: DO error while requesting project info. 2009-03-29 08:45:17.914 Interface Builder[32180:10b] ERROR: PBXProjectWatcherServer: DO error while requesting project info. Attached are two files: ib_interface.py tries to implement the DO interface that Xcode implements for the communication with IB, read.py uses the same interface to communicate with Xcode. The read.py script works fine, both with Xcode and my script, but IB doesn't like my script (as noted above). This is just a quick hack between sessions at PyCon, but I'd love to have a working version of the script to be able to hack on simple Cocoa scripts without having to start Xcode (because I do most of code writing in vim and Xcode is basically just unwanted overhead for most of my code). Does anyone have tips on how to debug the problems I'm running into? Ronald P.S. This is obviously a very crude hack, using undocumented interfaces that could chance without notice. |
|
From: Petr M. <pet...@an...> - 2009-03-28 23:32:56
|
Hi, I made some more digging into this matter and the only thing I found so far is this one (sorry, a long one): http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html#//apple_ref/doc/uid/20001282-1003829-BCIBDJCA and some good insights here: http://www.cocoadev.com/index.pl?CodingGuidelines So unless anybody knows and posts more profound answer, I suggest that the paragraph in the PyObjC intro stating """...instance variables prefixed with underscores are reserved by the Objective-C runtime...""" was put there based on the Apple's recommendation of not using such variables. Cheers, Petr Orestis Markou wrote: > Hello all, > > I want to clarify a bit the advice of the documentation to *not* use > the Python conventions of not using leading underscores for "private" > instance attributes. > > Is it the danger of accidentally overwriting some other Obj-C > attribute if there's a name clash? What about methods with leading > underscores? > > I fully understand that in order a method to be accessible from Obj-C > code it has to follow the methodWithArg_andArg_(self, arg1, arg2) > convention. In my case, these are "private" methods that I have no > desire to expose to anyone. > > The class in question is just a delegate that implements a custom init > method and the delegate method. These are the only things that use the > obj-c convention. The rest of the code is using the Python convention, > with leading underscores in attributes and methosd, property > decorators and so on. > > Testing indicates that things are working perfectly fine, I'm just > worried that there may some stability issues that may not visible at > this point. I've heard rumours of hard crashes that may have been > related to this, so I'm a bit worried. > > Thanks, > Orestis > -- > or...@or... > http://orestis.gr/ > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Ronald O. <ron...@ma...> - 2009-03-28 22:37:07
|
I knew I had forgotten to ask something: which version of PyObjC and Python are you using? Ronald |
|
From: Ronald O. <ron...@ma...> - 2009-03-28 21:29:20
|
On 28 Mar, 2009, at 16:19, Daniel Ashbrook wrote: > > >> I have a note for the archives: don't use pyprocessing, it's basicly >> dead at the moment (at least according to Jesse Noller, who wrote >> multiprocessing). > > I thought R Oudkerk wrote py/multiprocessing? But yes, it appears that > multiprocessing is included in 2.6 and 3.0, and is available as a > backport to 2.4/5 (http://code.google.com/p/python-multiprocessing/). Jesse is definitely the maintainer of multiprocessing, I'm not sure if he wrote it from scratch or borrowed the pyprocessing code for it. > >> W.r.t. hanging processes: can you reproduce that in a standalone >> program? I'm at Pycon at the moment and might be able to get access >> to Jesse Noller to help research the issue. > > Unlikely that I could before you leave; this is happening in my > massive thesis project, and trying to pull out the parts that break > would be a pretty heavy undertaking, I'm afraid. Doing that would be worthwhile in the long run though, if only to be able to document which restrictions exist and why they exist. Ronald |
|
From: Daniel A. <an...@cc...> - 2009-03-28 21:20:09
|
On Mar 28, 2009, at 4:25p, Ronald Oussoren wrote:
> As you noticed NSThreads are bound by the GIL, just as regular
> Python threads (as long as you try to run Python code obviously). I
> haven't tried using the multiprocessing library yet, I'd consider
> hanging processes a bug in either PyObjC or multiprocessing until
> proven otherwise. I know there are issues when using the fork
> system call without exec in a process using Apple frameworks, that's
> a limitation in those frameworks and not caused by Python/PyObjC.
My guess is that it's a PyObjc bug; in multiprocessing I added a bunch
of comments, and here's the hanging point:
def run(self):
'''
Method to be run in sub-process; can be overridden in sub-class
'''
self.debug('in run') # <--- THIS PRINTS
self.debug('about to run target %s' % self._target) # <---
THIS DOESN'T
if self._target:
self._target(*self._args, **self._kwargs)
So apparently trying to access the _target function (which is just the
PyObjc selector; when it runs properly it prints thing such as "about
to run target <selector findGesture: of <EGL: mainEGL>>") is causing
the freeze.
> One option you could try is to spawn of a background program that
> does the actual calculation and have that use multiprocessing to
> make use of multiple processes.
That's what I've been working on all afternoon. Too bad, because my
prior solution was semi-elegant... but at least this way I'm learning
all about posix_ipc and mmaps. I can read in 19MB of pickled data in .
12s that way, so it shouldn't impact my life too badly.
> I have a note for the archives: don't use pyprocessing, it's basicly
> dead at the moment (at least according to Jesse Noller, who wrote
> multiprocessing).
I thought R Oudkerk wrote py/multiprocessing? But yes, it appears that
multiprocessing is included in 2.6 and 3.0, and is available as a
backport to 2.4/5 (http://code.google.com/p/python-multiprocessing/).
> W.r.t. hanging processes: can you reproduce that in a standalone
> program? I'm at Pycon at the moment and might be able to get access
> to Jesse Noller to help research the issue.
Unlikely that I could before you leave; this is happening in my
massive thesis project, and trying to pull out the parts that break
would be a pretty heavy undertaking, I'm afraid.
Thanks,
dan
|
|
From: Ronald O. <ron...@ma...> - 2009-03-28 20:28:39
|
On 28 Mar, 2009, at 13:43, Daniel Ashbrook wrote: > What's the recommended way to do parallel processing under PyObjc? I > assume that NSThreads are bound by the same GIL limitation that > prevents parallel processing under standard python. W.r.t. the GIL limitation: have a look at "unloaden swallow". This is a project from Google that intends to speed CPython 5x by the end of the year and has GIL-removal on their roadmap. I'm definitely keeping an eye on this project and will support PyObjC on it when they get around to remove the GIL (and I shouldn't have to do anything before that) Ronald |
|
From: Ronald O. <ron...@ma...> - 2009-03-28 20:25:38
|
On 28 Mar, 2009, at 13:43, Daniel Ashbrook wrote: > What's the recommended way to do parallel processing under PyObjc? I > assume that NSThreads are bound by the same GIL limitation that > prevents parallel processing under standard python. > > I've been trying the processing/multiprocessing (depending on the > verision) and almost have had good success; however, sometimes one or > two of the processes will hang on trying to callback the function, > presumably due to some weird interaction between the bridge and > fork()ed processes. > > What else should I try? As you noticed NSThreads are bound by the GIL, just as regular Python threads (as long as you try to run Python code obviously). I haven't tried using the multiprocessing library yet, I'd consider hanging processes a bug in either PyObjC or multiprocessing until proven otherwise. I know there are issues when using the fork system call without exec in a process using Apple frameworks, that's a limitation in those frameworks and not caused by Python/PyObjC. One option you could try is to spawn of a background program that does the actual calculation and have that use multiprocessing to make use of multiple processes. I have a note for the archives: don't use pyprocessing, it's basicly dead at the moment (at least according to Jesse Noller, who wrote multiprocessing). W.r.t. hanging processes: can you reproduce that in a standalone program? I'm at Pycon at the moment and might be able to get access to Jesse Noller to help research the issue. Ronald > > Thanks, > > > dan > > ------------------------------------------------------------------------------ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Daniel A. <an...@cc...> - 2009-03-28 19:03:45
|
What's the recommended way to do parallel processing under PyObjc? I assume that NSThreads are bound by the same GIL limitation that prevents parallel processing under standard python. I've been trying the processing/multiprocessing (depending on the verision) and almost have had good success; however, sometimes one or two of the processes will hang on trying to callback the function, presumably due to some weird interaction between the bridge and fork()ed processes. What else should I try? Thanks, dan |
|
From: Koen B. <ko...@ma...> - 2009-03-27 20:21:46
|
No problems here... On 27 mrt 2009, at 20:52, Ronald Oussoren wrote: > > On 27 Mar, 2009, at 14:49, Bill Bumgarner wrote: > >> On Mar 27, 2009, at 11:11 AM, Ronald Oussoren wrote: >>> Is anyone actually using objc.inject? Once upon a time is was >>> pretty cool to be able to inject python code into arbitrary Cocoa >>> programs, but IMHO this functionality doesn't actually belong in >>> pyobjc-core. Furthermore the injection code doesn't support 64- >>> bit targets, and unless someone donates that code it will probably >>> never do so. >>> >>> I'm therefore seriously contemplating the removal of objc.inject, >>> either completely or by moving it to another distutils project. Is >>> anyone actually using this functionality, and if so: what for? >> >> I'd vote for breaking it out into a separate project. Or simply >> axe it from PyObjC and, if someone is motivated, they can pick it >> up and run with it in a separate repository. > > Unless someone actually uses this feature beyond demos I'll remove > it from PyObjC without creating a separate project. > > Ronald > > ------------------------------------------------------------------------------ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
|
From: Ronald O. <ron...@ma...> - 2009-03-27 19:52:44
|
On 27 Mar, 2009, at 14:49, Bill Bumgarner wrote: > On Mar 27, 2009, at 11:11 AM, Ronald Oussoren wrote: >> Is anyone actually using objc.inject? Once upon a time is was >> pretty cool to be able to inject python code into arbitrary Cocoa >> programs, but IMHO this functionality doesn't actually belong in >> pyobjc-core. Furthermore the injection code doesn't support 64-bit >> targets, and unless someone donates that code it will probably >> never do so. >> >> I'm therefore seriously contemplating the removal of objc.inject, >> either completely or by moving it to another distutils project. Is >> anyone actually using this functionality, and if so: what for? > > I'd vote for breaking it out into a separate project. Or simply axe > it from PyObjC and, if someone is motivated, they can pick it up and > run with it in a separate repository. Unless someone actually uses this feature beyond demos I'll remove it from PyObjC without creating a separate project. Ronald |
|
From: Bill B. <bb...@ma...> - 2009-03-27 19:49:24
|
On Mar 27, 2009, at 11:11 AM, Ronald Oussoren wrote: > Is anyone actually using objc.inject? Once upon a time is was pretty > cool to be able to inject python code into arbitrary Cocoa programs, > but IMHO this functionality doesn't actually belong in pyobjc-core. > Furthermore the injection code doesn't support 64-bit targets, and > unless someone donates that code it will probably never do so. > > I'm therefore seriously contemplating the removal of objc.inject, > either completely or by moving it to another distutils project. Is > anyone actually using this functionality, and if so: what for? I'd vote for breaking it out into a separate project. Or simply axe it from PyObjC and, if someone is motivated, they can pick it up and run with it in a separate repository. b.bum |
|
From: Ronald O. <ron...@ma...> - 2009-03-27 18:11:24
|
Hi, Is anyone actually using objc.inject? Once upon a time is was pretty cool to be able to inject python code into arbitrary Cocoa programs, but IMHO this functionality doesn't actually belong in pyobjc-core. Furthermore the injection code doesn't support 64-bit targets, and unless someone donates that code it will probably never do so. I'm therefore seriously contemplating the removal of objc.inject, either completely or by moving it to another distutils project. Is anyone actually using this functionality, and if so: what for? Ronald |
|
From: Orestis M. <or...@or...> - 2009-03-27 14:46:14
|
Hello all, I want to clarify a bit the advice of the documentation to *not* use the Python conventions of not using leading underscores for "private" instance attributes. Is it the danger of accidentally overwriting some other Obj-C attribute if there's a name clash? What about methods with leading underscores? I fully understand that in order a method to be accessible from Obj-C code it has to follow the methodWithArg_andArg_(self, arg1, arg2) convention. In my case, these are "private" methods that I have no desire to expose to anyone. The class in question is just a delegate that implements a custom init method and the delegate method. These are the only things that use the obj-c convention. The rest of the code is using the Python convention, with leading underscores in attributes and methosd, property decorators and so on. Testing indicates that things are working perfectly fine, I'm just worried that there may some stability issues that may not visible at this point. I've heard rumours of hard crashes that may have been related to this, so I'm a bit worried. Thanks, Orestis -- or...@or... http://orestis.gr/ |
|
From: Ronald O. <ron...@ma...> - 2009-03-24 15:31:03
|
In theorie an array.array of kind 'I' should work, although I haven't
checked if the metadata is entirely correct for this method. You'll
have the largest chance for success with a recent checkout of pyobjc-
core and pyobjc-framework-Cocoa.
Time to write a unittest for this specific case...
Ronald
On 24 Mar, 2009, at 15:13, Orestis Markou wrote:
> Hello,
>
> I'm trying to call NSBitmapImageRep getPixel:atX:y:. The issue is that
> the signature is like this:
> - (void)getPixel:(NSUInteger[])pixelData atX:(NSInteger)x y:
> (NSInteger)y
>
> And expects a pointer to an array, which is variable in length as it
> depends on the type of the bitmap representation. Here's the things
> I've tried:
>
> * Passing None: exceptions.TypeError: Need explict buffer for
> variable-length array argument
> * Passing objc.NULL: works but doesn't return anything :/
> * Passing lists/strings: exceptions.ValueError: argument 0 must be
> None or objc.NULL
> * Passing an array.array('i'): exceptions.ValueError: type mismatch
> between array.array of i and and C array of I8i12i16
> * Passing an array.array('I'): bus error
> * Passing an array.array('I'), but initialised to size 100 with
> zeroes: exceptions.SystemError: NULL result without error in
> PyObject_Call
>
> I've run out of things to try. So far as I can trace the code, I need
> to pass something that is accepted by PyObject_AsWriteBuffer, and can
> also be converted to this complex c array by PyObjC_PythonToCArray.
> Any pointers on how I can do that?
>
> Thanks,
> Orestis
> --
> or...@or...
> http://orestis.gr/
>
>
>
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM)
> are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly
> and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based
> development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|
|
From: Orestis M. <or...@or...> - 2009-03-24 14:13:55
|
Hello,
I'm trying to call NSBitmapImageRep getPixel:atX:y:. The issue is that
the signature is like this:
- (void)getPixel:(NSUInteger[])pixelData atX:(NSInteger)x y:(NSInteger)y
And expects a pointer to an array, which is variable in length as it
depends on the type of the bitmap representation. Here's the things
I've tried:
* Passing None: exceptions.TypeError: Need explict buffer for
variable-length array argument
* Passing objc.NULL: works but doesn't return anything :/
* Passing lists/strings: exceptions.ValueError: argument 0 must be
None or objc.NULL
* Passing an array.array('i'): exceptions.ValueError: type mismatch
between array.array of i and and C array of I8i12i16
* Passing an array.array('I'): bus error
* Passing an array.array('I'), but initialised to size 100 with
zeroes: exceptions.SystemError: NULL result without error in
PyObject_Call
I've run out of things to try. So far as I can trace the code, I need
to pass something that is accepted by PyObject_AsWriteBuffer, and can
also be converted to this complex c array by PyObjC_PythonToCArray.
Any pointers on how I can do that?
Thanks,
Orestis
--
or...@or...
http://orestis.gr/
|
|
From: Vijayendra B. <vij...@xo...> - 2009-03-23 07:30:30
|
Yaa, I have tried kqueue/kevent. But it does not give me the granularity as FSEvents i.e I am not able to detect which file is modified/added/deleted inside the marked directory. So finally, I will have to use polling. :-( Thanks for your help. - Vijayendra On 3/23/09 12:13 PM, "Ronald Oussoren" <ron...@ma...> wrote: > > On 23 Mar, 2009, at 4:58, Vijayendra Bapte wrote: > >> Hi Ronald, >> >> Thanks for your reply. >> >> I want to develop a directory watcher on Mac so that I can get the >> notification as soon as any file added//modified/deleted from the marked >> directory. Is there any alternate way detecting File System Events on Tiger? > > Not really. Spotlight uses a private API to look for changes on Tiger. It > might be possible to emulate the behaviour using kevent/kqueue, although I've > never tried doing that. The other alternative is polling for changes. > > Ronald > >> >> Thanks, >> Vijayendra. >> >> >> On 3/22/09 11:30 PM, "Ronald Oussoren" <ron...@ma...> wrote: >> >> >>> >>> On 20 Mar, 2009, at 12:59, Vijayendra Bapte wrote: >>> >>> >>>> Hi, >>>> >>>> I am getting an gcc compilation error while installing >>>> pyobjc-framework-FSEvents-2.2b1 >>>> on my Mac (OS X 10.4.11, Intel Core Duo 32 bit processor, Python2.6.1, >>>> gcc: i686-apple- >>>> darwin8-gcc-4.0.1) >>>> >>>> >>> >>> I'll have to find a way to disable this framework wrapper on Tiger systems, >>> it wraps some API's that aren't available on Tiger systems. >>> >>> Ronald >>> >>> >>> >> >> >> > > |
|
From: Ronald O. <ron...@ma...> - 2009-03-23 06:43:48
|
On 23 Mar, 2009, at 4:58, Vijayendra Bapte wrote: > Hi Ronald, > > Thanks for your reply. > > I want to develop a directory watcher on Mac so that I can get the > notification as soon as any file added//modified/deleted from the > marked directory. Is there any alternate way detecting File System > Events on Tiger? Not really. Spotlight uses a private API to look for changes on Tiger. It might be possible to emulate the behaviour using kevent/ kqueue, although I've never tried doing that. The other alternative is polling for changes. Ronald > > Thanks, > Vijayendra. > > > On 3/22/09 11:30 PM, "Ronald Oussoren" <ron...@ma...> wrote: > >> >> On 20 Mar, 2009, at 12:59, Vijayendra Bapte wrote: >> >>> Hi, >>> >>> I am getting an gcc compilation error while installing pyobjc- >>> framework-FSEvents-2.2b1 >>> on my Mac (OS X 10.4.11, Intel Core Duo 32 bit processor, >>> Python2.6.1, gcc: i686-apple- >>> darwin8-gcc-4.0.1) >>> >> >> I'll have to find a way to disable this framework wrapper on Tiger >> systems, it wraps some API's that aren't available on Tiger systems. >> >> Ronald >> >> > |
|
From: Vijayendra B. <vij...@xo...> - 2009-03-23 03:59:13
|
Hi Ronald, Thanks for your reply. I want to develop a directory watcher on Mac so that I can get the notification as soon as any file added//modified/deleted from the marked directory. Is there any alternate way detecting File System Events on Tiger? Thanks, Vijayendra. On 3/22/09 11:30 PM, "Ronald Oussoren" <ron...@ma...> wrote: > > On 20 Mar, 2009, at 12:59, Vijayendra Bapte wrote: > >> Hi, >> >> I am getting an gcc compilation error while installing >> pyobjc-framework-FSEvents-2.2b1 >> on my Mac (OS X 10.4.11, Intel Core Duo 32 bit processor, Python2.6.1, gcc: >> i686-apple- >> darwin8-gcc-4.0.1) >> > > I'll have to find a way to disable this framework wrapper on Tiger systems, it > wraps some API's that aren't available on Tiger systems. > > Ronald > > |
|
From: Ronald O. <ron...@ma...> - 2009-03-22 18:01:10
|
On 20 Mar, 2009, at 12:59, Vijayendra Bapte wrote: > Hi, > > I am getting an gcc compilation error while installing pyobjc- > framework-FSEvents-2.2b1 > on my Mac (OS X 10.4.11, Intel Core Duo 32 bit processor, > Python2.6.1, gcc: i686-apple- > darwin8-gcc-4.0.1) > I'll have to find a way to disable this framework wrapper on Tiger systems, it wraps some API's that aren't available on Tiger systems. Ronald |
|
From: Ronald O. <ron...@ma...> - 2009-03-22 17:58:48
|
On 19 Mar, 2009, at 12:39, Rodrigo Guerra wrote: > Hi, > > I noticed that in the original Apple configuration certain > CoreGraphics functions are available not only inside > Quartz.CoreGraphics but also directly at the Quartz module, but when I > tried to compile and install PyObjC from svn sources it is not the > case. See the sessions below: That's a bug in the repository. I've just commited a fix (r2117). The longer version: I disabled some code when debugging an issue with PyObjC and forgot to reenble that code during a commit :-( Ronald |
|
From: Vijayendra B. <vij...@Xo...> - 2009-03-20 12:12:05
|
Hi, I am getting an gcc compilation error while installing pyobjc-framework-FSEvents-2.2b1 on my Mac (OS X 10.4.11, Intel Core Duo 32 bit processor, Python2.6.1, gcc: i686-apple- darwin8-gcc-4.0.1) Here is the error log. $python setup.py install running install_lib running build_py running build_ext building 'FSEvents._callbacks' extension gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I/Library/ Frameworks/Python.framework/Versions/2.6/include/python2.6 -c Modules/ _callbacks.m -o build/temp.macosx-10.3-i386-2.6/Modules/_callbacks.o - O0 Modules/_callbacks.m:60: error: parse error before 'm_python_context_template' Modules/_callbacks.m:62: warning: excess elements in scalar initializer Modules/_callbacks.m:62: warning: (near initialization for 'm_python_context_template') Modules/_callbacks.m:63: warning: excess elements in scalar initializer . . . . (Error ending with) Modules/_callbacks.m:133: error: previous definition of 'result' was here Modules/_callbacks.m:353: error: parse error before 'FSEventStreamRef' lipo: can't figure out the architecture type of: /var/tmp// cco6kalc.out error: command 'gcc' failed with exit status 1 Could someone help me in solving this compilation error? Regards, Vijayendra |
|
From: Rodrigo G. <tio...@gm...> - 2009-03-19 12:39:23
|
Hi, I recently upgraded from the bundled Python 2.5.1 to ActivePython 2.6.1.1 and installed PyObjC manually from sources. I use Leopard and I'm developing a Cocoa application in Xcode and since the upgrade my main window loads and the application runs but it seems I can't draw anything on the window anymore. On the console I see a lot of these messages: (snippet) Thu Mar 19 21:20:42 mac.local pysim[79947] <Error>: CGContextSetRGBFillColor: invalid context Thu Mar 19 21:20:42 mac.local pysim[79947] <Error>: CGContextSetLineWidth: invalid context Thu Mar 19 21:20:42 mac.local pysim[79947] <Error>: CGContextSetRGBStrokeColor: invalid context Thu Mar 19 21:20:42 mac.local pysim[79947] <Error>: CGContextAddRect: invalid context Thu Mar 19 21:20:42 mac.local pysim[79947] <Error>: CGContextDrawPath: invalid context (snippet) I tried to search for this over the web, but I could not really find good directions. I hope some of you might know something -- perhaps I need to configure something else in Xcode after upgrading PyObjC? Cheers, Guerra |
|
From: Rodrigo G. <tio...@gm...> - 2009-03-19 11:39:40
|
Hi, I noticed that in the original Apple configuration certain CoreGraphics functions are available not only inside Quartz.CoreGraphics but also directly at the Quartz module, but when I tried to compile and install PyObjC from svn sources it is not the case. See the sessions below: Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Quartz >>> import Quartz.CoreGraphics >>> Quartz.CoreGraphics.CGContextSetRGBFillColor <objc.function object at 0x7d4380> >>> Quartz.CGContextSetRGBFillColor <objc.function object at 0x7d4380> ActivePython 2.6.1.1 (ActiveState Software Inc.) based on Python 2.6.1 (r261:67515, Dec 5 2008, 12:21:29) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Quartz >>> import Quartz.CoreGraphics >>> Quartz.CoreGraphics.CGContextSetRGBFillColor <objc.function 'CGContextSetRGBFillColor' at 0x3c2ada0> >>> Quartz.CGContextSetRGBFillColor Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'CGContextSetRGBFillColor' Is this expected to happen? Cheers, Guerra |