pyobjc-dev Mailing List for PyObjC (Page 28)
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: Aahz <aa...@py...> - 2010-05-10 21:05:17
|
On Mon, May 10, 2010, Luc Heinrich wrote: > > The reason why it fails miserably is because py2app doesn't seem to > know how to deal (or fail to deal correctly) with compressed Python > eggs. The solution (at least for me :)) is to force PyObjC and any > other library to be installed as non-compressed eggs. Ah, yes, compressed eggs, the bane of both py2app and py2exe. They both rely on modulefinder, which is the real root of the problem. Thanks for posting an update! -- Aahz (aa...@py...) <*> http://www.pythoncraft.com/ f u cn rd ths, u cn gt a gd jb n nx prgrmmng. |
From: Luc H. <lu...@ho...> - 2010-05-10 19:46:49
|
On 10 mai 2010, at 00:37, Luc Heinrich wrote: > Traceback (most recent call last): > File "/Users/luc/Desktop/Miro.app/Contents/Resources/__boot__.py", line 31, in <module> _run('Miro.py') > File "/Users/luc/Desktop/Miro.app/Contents/Resources/__boot__.py", line 28, in _runexecfile(path, globals(), globals()) > File "/Users/luc/Desktop/Miro.app/Contents/Resources/Miro.py", line 42, in <module> import Foundation > File "build/bdist.macosx-10.5-fat/egg/Foundation/__init__.py", line 10, in <module> > File "build/bdist.macosx-10.5-fat/egg/CoreFoundation/__init__.py", line 19, in <module> > File "objc/_bridgesupport.pyo", line 156, in initFrameworkWrapper > File "objc/_bridgesupport.pyo", line 58, in _parseBridgeSupport > ValueError: Don't know CF type for typestr '^{__CFAllocator=}', cannot create special wrapper I was able to make it all work. For the record my problem was, as Aahz said in his detailed report of the issue [1], related to py2app and not PyObjC itself. I did build everything from sources so I was expecting everything to work, but it didn't. The clue was in the stack trace, where you can see "normal" pathnames, like this one... > File "/Users/luc/Desktop/Miro.app/Contents/Resources/Miro.py", line 42, in <module> import Foundation ...and weird ones, like the four last ones: > File "build/bdist.macosx-10.5-fat/egg/Foundation/__init__.py", line 10, in <module> > File "build/bdist.macosx-10.5-fat/egg/CoreFoundation/__init__.py", line 19, in <module> > File "objc/_bridgesupport.pyo", line 156, in initFrameworkWrapper > File "objc/_bridgesupport.pyo", line 58, in _parseBridgeSupport The reason why it fails miserably is because py2app doesn't seem to know how to deal (or fail to deal correctly) with compressed Python eggs. The solution (at least for me :)) is to force PyObjC and any other library to be installed as non-compressed eggs. I personnally did it by patching all the setup.cfg files with an additional easy_install section, like this: [easy_install] zip_ok = 0 [1] http://sourceforge.net/mailarchive/message.php?msg_name=20100304190050.GA17310%40panix.com -- Luc Heinrich - lu...@ho... |
From: Luc H. <lu...@ho...> - 2010-05-09 22:37:27
|
On 7 mai 2010, at 02:27, Aahz wrote: > You need to use PyObjC 2.2 built on 10.5 IME -- see archives. Right. Ok. So I'm now using a built-from-sources Python 2.6.5, PyObjC 2.2 and py2app 0.4.3, all on OS X 10.5. Building the application and then running it on OS X 10.6 now gives this: Traceback (most recent call last): File "/Users/luc/Desktop/Miro.app/Contents/Resources/__boot__.py", line 31, in <module> _run('Miro.py') File "/Users/luc/Desktop/Miro.app/Contents/Resources/__boot__.py", line 28, in _runexecfile(path, globals(), globals()) File "/Users/luc/Desktop/Miro.app/Contents/Resources/Miro.py", line 42, in <module> import Foundation File "build/bdist.macosx-10.5-fat/egg/Foundation/__init__.py", line 10, in <module> File "build/bdist.macosx-10.5-fat/egg/CoreFoundation/__init__.py", line 19, in <module> File "objc/_bridgesupport.pyo", line 156, in initFrameworkWrapper File "objc/_bridgesupport.pyo", line 58, in _parseBridgeSupport ValueError: Don't know CF type for typestr '^{__CFAllocator=}', cannot create special wrapper I've looked at the list archive and it seems that you had the *exact* same error not so long ago: <http://sourceforge.net/mailarchive/forum.php?thread_name=20100223010249.GA3923%40panix.com&forum_name=pyobjc-dev> Did you manage to make it work? -- Luc Heinrich - lu...@ho... |
From: Aahz <aa...@py...> - 2010-05-07 00:28:29
|
On Fri, May 07, 2010, Luc Heinrich wrote: > > Maintaining Miro on 10.4, 10.5 and 10.6 has become a real pain lately > and since we are introducing several dependencies which only work on > 10.5 and upward, we are finally ditching 10.4 support. Yay for PyObjC > 2 instead of PyObjC 1.4, yay for Python 2.5 or 2.6 instead of 2.4, > etc. However, producing a PyObjC application which runs on both 10.5 > and 10.6 seems to cause an equal amount of problems, which I frankly > wasn't expecting. You need to use PyObjC 2.2 built on 10.5 IME -- see archives. -- Aahz (aa...@py...) <*> http://www.pythoncraft.com/ "It is easier to optimize correct code than to correct optimized code." --Bill Harlan |
From: Mani G. <ma...@tu...> - 2010-05-05 15:25:38
|
On Tue, May 4, 2010 at 3:14 PM, Ronald Oussoren <ron...@ma...> wrote: >> >> >> It looks like this is relatively easy to enhance the unittests of _pycoder to test with classic coders, my first result is a collection of failed tests: >> >> ====================================================================== >> ERROR: test_structseq (__main__.TestArchivePlainPython) >> ---------------------------------------------------------------------- >> Traceback (most recent call last): >> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/test/pickletester.py", line 583, in test_structseq >> s = self.dumps(t, proto) >> File "test_archive_python.py", line 436, in dumps >> return NSArchiver.archivedDataWithRootObject_(arg) >> ValueError: NSInvalidArgumentException - *** -encodeInt:forKey: only defined for abstract class. Define -[NSArchiver encodeInt:forKey:]! >> >> Fixing the tests is more work, but should be relatively straightforward. >> >> Ronald > > Sadly enough it wasn't possible to implement this without changes to C code. I've committed an initial patch for this in r2465, but that's a partial commit from my workspace and I'm not 100% sure that I added everything to the commit. > > Anyway, the trunk is not compatible enough with 2.2 to just rebuild pyobjc-core, you'd have to rebuild all of PyObjC and I'm not quite ready to do a release. > > Ronald > > Hello Ronald, I will go ahead with your suggested workaround to use NSNull.null() instead of None, and will let you know if it solves the bug for our users. Thanks very much for your hard work! PyObjC is a great project and we really appreciate your supporting it. Regards, Mani |
From: Ronald O. <ron...@ma...> - 2010-05-04 19:14:33
|
> > > It looks like this is relatively easy to enhance the unittests of _pycoder to test with classic coders, my first result is a collection of failed tests: > > ====================================================================== > ERROR: test_structseq (__main__.TestArchivePlainPython) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/test/pickletester.py", line 583, in test_structseq > s = self.dumps(t, proto) > File "test_archive_python.py", line 436, in dumps > return NSArchiver.archivedDataWithRootObject_(arg) > ValueError: NSInvalidArgumentException - *** -encodeInt:forKey: only defined for abstract class. Define -[NSArchiver encodeInt:forKey:]! > > Fixing the tests is more work, but should be relatively straightforward. > > Ronald Sadly enough it wasn't possible to implement this without changes to C code. I've committed an initial patch for this in r2465, but that's a partial commit from my workspace and I'm not 100% sure that I added everything to the commit. Anyway, the trunk is not compatible enough with 2.2 to just rebuild pyobjc-core, you'd have to rebuild all of PyObjC and I'm not quite ready to do a release. Ronald |
From: Ronald O. <ron...@ma...> - 2010-05-04 16:05:20
|
On 4 May, 2010, at 17:44, Mani Ghasemlou wrote: > On Fri, Apr 30, 2010 at 1:40 AM, Ronald Oussoren <ron...@ma...> wrote: >> >> On 29 Apr, 2010, at 17:57, Mani Ghasemlou wrote: >> >>> On Thu, Apr 29, 2010 at 11:45 AM, Aahz <aa...@py...> wrote: >>>> On Thu, Apr 29, 2010, Mani Ghasemlou wrote: >>>>> >>>>> Users of my app have been complaining of the following error: >>>>> >>>>> ValueError: NSInvalidArgumentException - *** -encodeInt:forKey: only >>>>> defined for abstract class. Define -[NSArchiver encodeInt:forKey:]! >>>>> >>>>> It occurs in the following line of code: >>>>> >>>>> session.prepareToPullChangesForEntityNames_beforeDate_(entityNames, >>>>> NSDate.distantFuture()) >>>>> >>>>> Where "session" is an ISyncSession object >>>>> (http://developer.apple.com/mac/library/documentation/cocoa/Reference/SyncServicesFramework/Classes/ISyncSession_Class/Reference/Reference.html#//apple_ref/occ/cl/ISyncSession), >>>>> and "entityNames" is a Python list of strings. >>>> >>>> What versions of Python, PyObjC, and OSX are you using? What's the full >>>> traceback? What is the value of entityNames? How do you create session? >>> >>> Hi Aahz! >>> >>> I'm building my app on a 10.5.8 system, with standard versions of >>> Python and PyObjC (2.5, and 2.0 respectively). I have not determined >>> if the errors occur on specific versions of OSX, but we QA the >>> application on both Leopard and Snow Leopard and internally we cannot >>> reproduce the problem (yet). >>> >>> The error posted is the full traceback. There is nothing else. >>> >>> The value of entityNames is *always* the following: >>> >>> entityNames = ['com.apple.contacts.Contact', >>> 'com.apple.contacts.Email Address', >>> 'com.apple.calendars.Calendar', >>> 'com.apple.calendars.Event', >>> 'com.apple.calendars.Recurrence', >>> 'com.apple.calendars.Attendee'] >>> >>> The session is created using >>> "ISyncSession.beginSessionWithClient_entityNames_beforeDate_". The >>> prepareToPullChanges... code would not be invoked if creating the >>> session returns a nil/None session object, or if it raises any >>> exception. >> >> I haven't used SyncServices for anything serious yet, which means I could be completely wrong with my assumptions. >> >> IIUC prepareToPullChanges... ends the phase where you push updates to SyncServices and starts the phase where SyncServices pushes changes to you. What kind of objects do you push to SyncServices? Are those pure Objective-C, instances of PyObjC subclasses or pure Python? >> >> The exception could occur when you push Python objects to SyncServices and SyncServices tries to serialize them using NSArchiver that doesn't support keyed coding, the code in Lib/objc/_pycoder.py assumes all archivers support keyed coding. >> >> Ronald > > Hello Ronald, > > The data pushed is a Python list of Python dicts. The dicts' keys are > always strings, and the values are a mix of: > > - Python strings > - Python ints > - Python lists of Python strings & lists of Python ints > - None objects > - NSDatetime objects, created using > NSCalendarDate.dateWithTimeIntervalSince1970_(python_int) > - Python lists of NSDatetime objects (created same way as above) > > Your suggestion that the error could be caused by one or more of the > records I am pushing helps me. I will try running tests with Calendar > events (the main type of data I am syncing) that make use of all the > above types and see if any of them trigger the error. > > I will be posting again with my findings sometime this week, but > please let me know if there is something specific from the above that > I should test for. You could try a sync action with 'objc.setVerbose(1)', that will print exception traces when translating exceptions to ObjC and tends to be helpful when an exception is raised in Python code and then transitions through an ObjC layer. If this traceback contains references to objc._pycoder my hypothesis is correct, and that means that that module should be enhanced to support both keyed coding and classic non-keyed coding. BTW. All values you mention except 'None' should encode just fine using a "classic" coder, replacing 'None' by NSNull.null() before encoding might be the quickest solution to your problem. It looks like this is relatively easy to enhance the unittests of _pycoder to test with classic coders, my first result is a collection of failed tests: ====================================================================== ERROR: test_structseq (__main__.TestArchivePlainPython) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/test/pickletester.py", line 583, in test_structseq s = self.dumps(t, proto) File "test_archive_python.py", line 436, in dumps return NSArchiver.archivedDataWithRootObject_(arg) ValueError: NSInvalidArgumentException - *** -encodeInt:forKey: only defined for abstract class. Define -[NSArchiver encodeInt:forKey:]! Fixing the tests is more work, but should be relatively straightforward. Ronald > > Thanks! > Mani |
From: Mani G. <ma...@tu...> - 2010-05-04 15:44:10
|
On Fri, Apr 30, 2010 at 1:40 AM, Ronald Oussoren <ron...@ma...> wrote: > > On 29 Apr, 2010, at 17:57, Mani Ghasemlou wrote: > >> On Thu, Apr 29, 2010 at 11:45 AM, Aahz <aa...@py...> wrote: >>> On Thu, Apr 29, 2010, Mani Ghasemlou wrote: >>>> >>>> Users of my app have been complaining of the following error: >>>> >>>> ValueError: NSInvalidArgumentException - *** -encodeInt:forKey: only >>>> defined for abstract class. Define -[NSArchiver encodeInt:forKey:]! >>>> >>>> It occurs in the following line of code: >>>> >>>> session.prepareToPullChangesForEntityNames_beforeDate_(entityNames, >>>> NSDate.distantFuture()) >>>> >>>> Where "session" is an ISyncSession object >>>> (http://developer.apple.com/mac/library/documentation/cocoa/Reference/SyncServicesFramework/Classes/ISyncSession_Class/Reference/Reference.html#//apple_ref/occ/cl/ISyncSession), >>>> and "entityNames" is a Python list of strings. >>> >>> What versions of Python, PyObjC, and OSX are you using? What's the full >>> traceback? What is the value of entityNames? How do you create session? >> >> Hi Aahz! >> >> I'm building my app on a 10.5.8 system, with standard versions of >> Python and PyObjC (2.5, and 2.0 respectively). I have not determined >> if the errors occur on specific versions of OSX, but we QA the >> application on both Leopard and Snow Leopard and internally we cannot >> reproduce the problem (yet). >> >> The error posted is the full traceback. There is nothing else. >> >> The value of entityNames is *always* the following: >> >> entityNames = ['com.apple.contacts.Contact', >> 'com.apple.contacts.Email Address', >> 'com.apple.calendars.Calendar', >> 'com.apple.calendars.Event', >> 'com.apple.calendars.Recurrence', >> 'com.apple.calendars.Attendee'] >> >> The session is created using >> "ISyncSession.beginSessionWithClient_entityNames_beforeDate_". The >> prepareToPullChanges... code would not be invoked if creating the >> session returns a nil/None session object, or if it raises any >> exception. > > I haven't used SyncServices for anything serious yet, which means I could be completely wrong with my assumptions. > > IIUC prepareToPullChanges... ends the phase where you push updates to SyncServices and starts the phase where SyncServices pushes changes to you. What kind of objects do you push to SyncServices? Are those pure Objective-C, instances of PyObjC subclasses or pure Python? > > The exception could occur when you push Python objects to SyncServices and SyncServices tries to serialize them using NSArchiver that doesn't support keyed coding, the code in Lib/objc/_pycoder.py assumes all archivers support keyed coding. > > Ronald Hello Ronald, The data pushed is a Python list of Python dicts. The dicts' keys are always strings, and the values are a mix of: - Python strings - Python ints - Python lists of Python strings & lists of Python ints - None objects - NSDatetime objects, created using NSCalendarDate.dateWithTimeIntervalSince1970_(python_int) - Python lists of NSDatetime objects (created same way as above) Your suggestion that the error could be caused by one or more of the records I am pushing helps me. I will try running tests with Calendar events (the main type of data I am syncing) that make use of all the above types and see if any of them trigger the error. I will be posting again with my findings sometime this week, but please let me know if there is something specific from the above that I should test for. Thanks! Mani |
From: Ronald O. <ron...@ma...> - 2010-04-30 05:40:31
|
On 29 Apr, 2010, at 17:57, Mani Ghasemlou wrote: > On Thu, Apr 29, 2010 at 11:45 AM, Aahz <aa...@py...> wrote: >> On Thu, Apr 29, 2010, Mani Ghasemlou wrote: >>> >>> Users of my app have been complaining of the following error: >>> >>> ValueError: NSInvalidArgumentException - *** -encodeInt:forKey: only >>> defined for abstract class. Define -[NSArchiver encodeInt:forKey:]! >>> >>> It occurs in the following line of code: >>> >>> session.prepareToPullChangesForEntityNames_beforeDate_(entityNames, >>> NSDate.distantFuture()) >>> >>> Where "session" is an ISyncSession object >>> (http://developer.apple.com/mac/library/documentation/cocoa/Reference/SyncServicesFramework/Classes/ISyncSession_Class/Reference/Reference.html#//apple_ref/occ/cl/ISyncSession), >>> and "entityNames" is a Python list of strings. >> >> What versions of Python, PyObjC, and OSX are you using? What's the full >> traceback? What is the value of entityNames? How do you create session? > > Hi Aahz! > > I'm building my app on a 10.5.8 system, with standard versions of > Python and PyObjC (2.5, and 2.0 respectively). I have not determined > if the errors occur on specific versions of OSX, but we QA the > application on both Leopard and Snow Leopard and internally we cannot > reproduce the problem (yet). > > The error posted is the full traceback. There is nothing else. > > The value of entityNames is *always* the following: > > entityNames = ['com.apple.contacts.Contact', > 'com.apple.contacts.Email Address', > 'com.apple.calendars.Calendar', > 'com.apple.calendars.Event', > 'com.apple.calendars.Recurrence', > 'com.apple.calendars.Attendee'] > > The session is created using > "ISyncSession.beginSessionWithClient_entityNames_beforeDate_". The > prepareToPullChanges... code would not be invoked if creating the > session returns a nil/None session object, or if it raises any > exception. I haven't used SyncServices for anything serious yet, which means I could be completely wrong with my assumptions. IIUC prepareToPullChanges... ends the phase where you push updates to SyncServices and starts the phase where SyncServices pushes changes to you. What kind of objects do you push to SyncServices? Are those pure Objective-C, instances of PyObjC subclasses or pure Python? The exception could occur when you push Python objects to SyncServices and SyncServices tries to serialize them using NSArchiver that doesn't support keyed coding, the code in Lib/objc/_pycoder.py assumes all archivers support keyed coding. Ronald |
From: Mani G. <ma...@tu...> - 2010-04-29 15:58:00
|
On Thu, Apr 29, 2010 at 11:45 AM, Aahz <aa...@py...> wrote: > On Thu, Apr 29, 2010, Mani Ghasemlou wrote: >> >> Users of my app have been complaining of the following error: >> >> ValueError: NSInvalidArgumentException - *** -encodeInt:forKey: only >> defined for abstract class. Define -[NSArchiver encodeInt:forKey:]! >> >> It occurs in the following line of code: >> >> session.prepareToPullChangesForEntityNames_beforeDate_(entityNames, >> NSDate.distantFuture()) >> >> Where "session" is an ISyncSession object >> (http://developer.apple.com/mac/library/documentation/cocoa/Reference/SyncServicesFramework/Classes/ISyncSession_Class/Reference/Reference.html#//apple_ref/occ/cl/ISyncSession), >> and "entityNames" is a Python list of strings. > > What versions of Python, PyObjC, and OSX are you using? What's the full > traceback? What is the value of entityNames? How do you create session? Hi Aahz! I'm building my app on a 10.5.8 system, with standard versions of Python and PyObjC (2.5, and 2.0 respectively). I have not determined if the errors occur on specific versions of OSX, but we QA the application on both Leopard and Snow Leopard and internally we cannot reproduce the problem (yet). The error posted is the full traceback. There is nothing else. The value of entityNames is *always* the following: entityNames = ['com.apple.contacts.Contact', 'com.apple.contacts.Email Address', 'com.apple.calendars.Calendar', 'com.apple.calendars.Event', 'com.apple.calendars.Recurrence', 'com.apple.calendars.Attendee'] The session is created using "ISyncSession.beginSessionWithClient_entityNames_beforeDate_". The prepareToPullChanges... code would not be invoked if creating the session returns a nil/None session object, or if it raises any exception. Thanks! Mani |
From: Aahz <aa...@py...> - 2010-04-29 15:46:04
|
On Thu, Apr 29, 2010, Mani Ghasemlou wrote: > > Users of my app have been complaining of the following error: > > ValueError: NSInvalidArgumentException - *** -encodeInt:forKey: only > defined for abstract class. Define -[NSArchiver encodeInt:forKey:]! > > It occurs in the following line of code: > > session.prepareToPullChangesForEntityNames_beforeDate_(entityNames, > NSDate.distantFuture()) > > Where "session" is an ISyncSession object > (http://developer.apple.com/mac/library/documentation/cocoa/Reference/SyncServicesFramework/Classes/ISyncSession_Class/Reference/Reference.html#//apple_ref/occ/cl/ISyncSession), > and "entityNames" is a Python list of strings. What versions of Python, PyObjC, and OSX are you using? What's the full traceback? What is the value of entityNames? How do you create session? -- Aahz (aa...@py...) <*> http://www.pythoncraft.com/ "It is easier to optimize correct code than to correct optimized code." --Bill Harlan |
From: Mani G. <ma...@tu...> - 2010-04-29 15:21:53
|
Hello, Users of my app have been complaining of the following error: ValueError: NSInvalidArgumentException - *** -encodeInt:forKey: only defined for abstract class. Define -[NSArchiver encodeInt:forKey:]! It occurs in the following line of code: session.prepareToPullChangesForEntityNames_beforeDate_(entityNames, NSDate.distantFuture()) Where "session" is an ISyncSession object (http://developer.apple.com/mac/library/documentation/cocoa/Reference/SyncServicesFramework/Classes/ISyncSession_Class/Reference/Reference.html#//apple_ref/occ/cl/ISyncSession), and "entityNames" is a Python list of strings. Most of the time, for most users, this problem does not happen. But it seems like, for some people a different code path is being executed under the hood of SyncServices and this is happening. Not much to start with, but I am here to provide any more information as needed. This is a very serious issue for our user base and hopefully someone will be able to shed light on the issue, if it is indeed a PyObjC bridge matter. Thanks very much! Mani |
From: Ronald O. <ron...@ma...> - 2010-04-21 10:38:27
|
On Wednesday, April 21, 2010, at 11:48AM, "Greg Ewing" <gre...@ca...> wrote: >The NSGraphicsContext class has class methods called >saveGraphicsState and restoreGraphicsState which can't >be called from Python, because there are also instance >methods with the same names, and PyObjC complains that >you haven't supplied a 'self' argument. > >Is there some other way of calling the class versions >of these methods? Which version of PyObjC? This should just work in PyObjC 2.2 or later (including the version shipped with SL). In earlier version you have to use a crummy way to call methods: NSGraphicsContext.pyobjc_classMethods.saveGraphicsState() Ronald > >-- >Greg > >------------------------------------------------------------------------------ >_______________________________________________ >Pyobjc-dev mailing list >Pyo...@li... >https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > |
From: Greg E. <gre...@ca...> - 2010-04-21 09:39:04
|
The NSGraphicsContext class has class methods called saveGraphicsState and restoreGraphicsState which can't be called from Python, because there are also instance methods with the same names, and PyObjC complains that you haven't supplied a 'self' argument. Is there some other way of calling the class versions of these methods? -- Greg |
From: Ronald O. <ron...@ma...> - 2010-04-15 13:39:12
|
On 12 Apr, 2010, at 20:34, Pepijn de Vos wrote: > Thank you, that seemed to work. > > By the way, the bug is right there under your nose: > <arg type='{CGPoint=ff}' type64='{CGPoint=**ff**}' /> > Change the second ff into dd and it's done. > Should I submit a patch or bug report somewhere? I've saved your message and will commit a fix in the near future. Ronald |
From: Virgil D. <hs...@ha...> - 2010-04-12 18:44:21
|
On Mon, Apr 12, 2010 at 8:34 PM, Pepijn de Vos <pep...@gm...> wrote: > Thank you, that seemed to work. > > By the way, the bug is right there under your nose: > <arg type='{CGPoint=ff}' type64='{CGPoint=**ff**}' /> > Change the second ff into dd and it's done. > Should I submit a patch or bug report somewhere? > > Groeten, > Pepijn de Vos > -- > Sent from my iPod Shuffle > http://pepijndevos.nl > > On Apr 12, 2010, at 8:13 PM, Virgil Dupras wrote: > >> On Mon, Apr 12, 2010 at 7:44 PM, Pepijn de Vos <pep...@gm...> wrote: >>> Hi, >>> It's me again. >>> How can I change the wrapper for a function like CGEventCreateMouseEvent >>> from Quartz? >>> It seems like my CGPoint uses floats instead of doubles, which is wrong for >>> 64 bit, like in Snow Leopard. >>> Another option is going back to using objc and importing the function >>> manually. >>> The problem is that I don't know the syntax for loadBundleFunctions. >>> I managed to get CGPostMouseEvent working with this: v{CGPoint=dd} (instead >>> of ff) >>> What would I need to do to import CGEventCreateMouseEvent? >>> Groeten, >>> Pepijn de Vos >>> -- >>> Sent from my iPod Shuffle >>> http://pepijndevos.nl >>> On Apr 4, 2010, at 6:23 PM, Ratko Jagodic wrote: >>> >>> Hi Pepijn, >>> Sorry, but I haven't seen this before. It seemed to work for me. If you feel >>> adventurous, you could try investigating yourself in the PyObjC source. The >>> file is _callbacks.m where the link between C/Python is for events. >>> Sorry I couldn't be of more help. Maybe others on this list could provide >>> more info. >>> Good luck. >>> Ratko >>> >>> >>> On Sun, Apr 4, 2010 at 11:02 AM, Pepijn de Vos <pep...@gm...> >>> wrote: >>>> >>>> Hi, >>>> As you can see in the code below the returned value of the mouse event has >>>> an insane value. >>>> When I generate a click or move event the mouse jumps to the very corner >>>> of the screen. >>>> <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> >>>> Could it be that integer and float conversions between C and Python are >>>> messed up somewhere? >>>> I tried to use a tuple, a NSPoint and a CGPoint, which made no difference >>>> at all. >>>> Just creating a CGPoint object without the event works fine though. >>>> Groeten, >>>> Pepijn de Vos >>>> -- >>>> Sent from my iPod Shuffle >>>> http://pepijndevos.nl >>>> On Apr 4, 2010, at 5:54 PM, Ratko Jagodic wrote: >>>> >>>> I ran across the same problem back in September and there were a few bugs >>>> in the C code. I reported the bugs and they were fixed so I guess the >>>> Macports version includes those fixes. Don't know about the version numbers. >>>> CGEventTapCreate should take 6 parameters, as it does in carbon. >>>> >>>> What do you mean by "breaks the location"? >>>> "When I run Python26 and PyObjC from Macports the event system works fine, >>>> but making an event breaks the location." >>>> >>>> >>>> Ratko >>>> >>>> >>>> On Sun, Apr 4, 2010 at 10:27 AM, Pepijn de Vos <pep...@gm...> >>>> wrote: >>>>> >>>>> Hi all, >>>>> >>>>> I finally managed to get listening to events working, the code is at >>>>> http://github.com/pepijndevos/PyMouse/blob/master/mac.py#L30 >>>>> I don't know what made the difference, but after a lot of trying it >>>>> suddenly worked. >>>>> >>>>> Now I have another strange issue. >>>>> When I run the default Python and PyObjC version that came with Mac OS X >>>>> 10.6, Python segfaults while creating an event tap. >>>>> When I run Python26 and PyObjC from Macports the event system works fine, >>>>> but making an event breaks the location. >>>>> >>>>> Stock Python: >>>>> >>>>>>>> from Quartz import * >>>>>>>> def test(*args): >>>>> ... print args >>>>> ... >>>>>>>> tap = CGEventTapCreate( >>>>> ... kCGSessionEventTap, >>>>> ... kCGHeadInsertEventTap, >>>>> ... kCGEventTapOptionDefault, >>>>> ... CGEventMaskBit(kCGEventMouseMoved) | >>>>> ... CGEventMaskBit(kCGEventLeftMouseDown) | >>>>> ... CGEventMaskBit(kCGEventLeftMouseUp) | >>>>> ... CGEventMaskBit(kCGEventRightMouseDown) | >>>>> ... CGEventMaskBit(kCGEventRightMouseUp) | >>>>> ... CGEventMaskBit(kCGEventOtherMouseDown) | >>>>> ... CGEventMaskBit(kCGEventOtherMouseUp), >>>>> ... test) >>>>> Segmentation fault >>>>> >>>>> Macports Python: >>>>> >>>>>>>> from Quartz import * >>>>>>>> event = CGEventCreateMouseEvent(None, 3, CGPoint(200, 200), 1) >>>>>>>> CGEventGetLocation(event) >>>>> <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> >>>>> >>>>> Also the stock version of CGEventTapCreate needs 5 parameters while the >>>>> Macports version needs 6. >>>>> >>>>> Macports version of PyObjC is 2.2 >>>>> Included version should be 2.2b3 according to a blog I found. >>>>> >>>>> Groeten, >>>>> Pepijn de Vos >>>>> -- >>>>> Sent from my iPod Shuffle >>>>> http://pepijndevos.nl >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Download Intel® Parallel Studio Eval >>>>> Try the new software tools for yourself. Speed compiling, find bugs >>>>> proactively, and fine-tune applications for parallel performance. >>>>> See why Intel Parallel Studio got high marks during beta. >>>>> http://p.sf.net/sfu/intel-sw-dev >>>>> _______________________________________________ >>>>> Pyobjc-dev mailing list >>>>> Pyo...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>> >>>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> _______________________________________________ >>> Pyobjc-dev mailing list >>> Pyo...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>> >>> >> >> Maybe you can inspire yourself from the PyObjC.bridgeSupport file? The entry is: >> >> <function name='CGEventCreateMouseEvent'> >> <retval already_cfretained='true' type='^{__CGEvent=}' /> >> <arg type='^{__CGEventSource=}' /> >> <arg type='I' /> >> <arg type='{CGPoint=ff}' type64='{CGPoint=ff}' /> >> <arg type='I' /> >> </function> >> >> So maybe that your 64-bit signature would be >> "^{__CGEvent=}^{__CGEventSource=}I{CGPoint=dd}I" or something? >> >> -- >> Virgil Dupras > > I know it's a bug, I had started a fork of PyObjC with 64-bit fixes at http://bitbucket.org/hsoft/pyobjc/ , but I think that Ronald, in his recent commits, already fixed most of these bugs in the trunk. There's (or there were) a *lot* of 64-bit glitches all around. -- Virgil Dupras |
From: Pepijn de V. <pep...@gm...> - 2010-04-12 18:39:56
|
So it's fixed for the next version? Cool, thanks! Groeten, Pepijn de Vos -- Sent from my iPod Shuffle http://pepijndevos.nl On Apr 12, 2010, at 8:38 PM, Virgil Dupras wrote: > On Mon, Apr 12, 2010 at 8:34 PM, Pepijn de Vos <pep...@gm...> wrote: >> Thank you, that seemed to work. >> >> By the way, the bug is right there under your nose: >> <arg type='{CGPoint=ff}' type64='{CGPoint=**ff**}' /> >> Change the second ff into dd and it's done. >> Should I submit a patch or bug report somewhere? >> >> Groeten, >> Pepijn de Vos >> -- >> Sent from my iPod Shuffle >> http://pepijndevos.nl >> >> On Apr 12, 2010, at 8:13 PM, Virgil Dupras wrote: >> >>> On Mon, Apr 12, 2010 at 7:44 PM, Pepijn de Vos <pep...@gm...> wrote: >>>> Hi, >>>> It's me again. >>>> How can I change the wrapper for a function like CGEventCreateMouseEvent >>>> from Quartz? >>>> It seems like my CGPoint uses floats instead of doubles, which is wrong for >>>> 64 bit, like in Snow Leopard. >>>> Another option is going back to using objc and importing the function >>>> manually. >>>> The problem is that I don't know the syntax for loadBundleFunctions. >>>> I managed to get CGPostMouseEvent working with this: v{CGPoint=dd} (instead >>>> of ff) >>>> What would I need to do to import CGEventCreateMouseEvent? >>>> Groeten, >>>> Pepijn de Vos >>>> -- >>>> Sent from my iPod Shuffle >>>> http://pepijndevos.nl >>>> On Apr 4, 2010, at 6:23 PM, Ratko Jagodic wrote: >>>> >>>> Hi Pepijn, >>>> Sorry, but I haven't seen this before. It seemed to work for me. If you feel >>>> adventurous, you could try investigating yourself in the PyObjC source. The >>>> file is _callbacks.m where the link between C/Python is for events. >>>> Sorry I couldn't be of more help. Maybe others on this list could provide >>>> more info. >>>> Good luck. >>>> Ratko >>>> >>>> >>>> On Sun, Apr 4, 2010 at 11:02 AM, Pepijn de Vos <pep...@gm...> >>>> wrote: >>>>> >>>>> Hi, >>>>> As you can see in the code below the returned value of the mouse event has >>>>> an insane value. >>>>> When I generate a click or move event the mouse jumps to the very corner >>>>> of the screen. >>>>> <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> >>>>> Could it be that integer and float conversions between C and Python are >>>>> messed up somewhere? >>>>> I tried to use a tuple, a NSPoint and a CGPoint, which made no difference >>>>> at all. >>>>> Just creating a CGPoint object without the event works fine though. >>>>> Groeten, >>>>> Pepijn de Vos >>>>> -- >>>>> Sent from my iPod Shuffle >>>>> http://pepijndevos.nl >>>>> On Apr 4, 2010, at 5:54 PM, Ratko Jagodic wrote: >>>>> >>>>> I ran across the same problem back in September and there were a few bugs >>>>> in the C code. I reported the bugs and they were fixed so I guess the >>>>> Macports version includes those fixes. Don't know about the version numbers. >>>>> CGEventTapCreate should take 6 parameters, as it does in carbon. >>>>> >>>>> What do you mean by "breaks the location"? >>>>> "When I run Python26 and PyObjC from Macports the event system works fine, >>>>> but making an event breaks the location." >>>>> >>>>> >>>>> Ratko >>>>> >>>>> >>>>> On Sun, Apr 4, 2010 at 10:27 AM, Pepijn de Vos <pep...@gm...> >>>>> wrote: >>>>>> >>>>>> Hi all, >>>>>> >>>>>> I finally managed to get listening to events working, the code is at >>>>>> http://github.com/pepijndevos/PyMouse/blob/master/mac.py#L30 >>>>>> I don't know what made the difference, but after a lot of trying it >>>>>> suddenly worked. >>>>>> >>>>>> Now I have another strange issue. >>>>>> When I run the default Python and PyObjC version that came with Mac OS X >>>>>> 10.6, Python segfaults while creating an event tap. >>>>>> When I run Python26 and PyObjC from Macports the event system works fine, >>>>>> but making an event breaks the location. >>>>>> >>>>>> Stock Python: >>>>>> >>>>>>>>> from Quartz import * >>>>>>>>> def test(*args): >>>>>> ... print args >>>>>> ... >>>>>>>>> tap = CGEventTapCreate( >>>>>> ... kCGSessionEventTap, >>>>>> ... kCGHeadInsertEventTap, >>>>>> ... kCGEventTapOptionDefault, >>>>>> ... CGEventMaskBit(kCGEventMouseMoved) | >>>>>> ... CGEventMaskBit(kCGEventLeftMouseDown) | >>>>>> ... CGEventMaskBit(kCGEventLeftMouseUp) | >>>>>> ... CGEventMaskBit(kCGEventRightMouseDown) | >>>>>> ... CGEventMaskBit(kCGEventRightMouseUp) | >>>>>> ... CGEventMaskBit(kCGEventOtherMouseDown) | >>>>>> ... CGEventMaskBit(kCGEventOtherMouseUp), >>>>>> ... test) >>>>>> Segmentation fault >>>>>> >>>>>> Macports Python: >>>>>> >>>>>>>>> from Quartz import * >>>>>>>>> event = CGEventCreateMouseEvent(None, 3, CGPoint(200, 200), 1) >>>>>>>>> CGEventGetLocation(event) >>>>>> <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> >>>>>> >>>>>> Also the stock version of CGEventTapCreate needs 5 parameters while the >>>>>> Macports version needs 6. >>>>>> >>>>>> Macports version of PyObjC is 2.2 >>>>>> Included version should be 2.2b3 according to a blog I found. >>>>>> >>>>>> Groeten, >>>>>> Pepijn de Vos >>>>>> -- >>>>>> Sent from my iPod Shuffle >>>>>> http://pepijndevos.nl >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Download Intel® Parallel Studio Eval >>>>>> Try the new software tools for yourself. Speed compiling, find bugs >>>>>> proactively, and fine-tune applications for parallel performance. >>>>>> See why Intel Parallel Studio got high marks during beta. >>>>>> http://p.sf.net/sfu/intel-sw-dev >>>>>> _______________________________________________ >>>>>> Pyobjc-dev mailing list >>>>>> Pyo...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>> >>>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Download Intel® Parallel Studio Eval >>>> Try the new software tools for yourself. Speed compiling, find bugs >>>> proactively, and fine-tune applications for parallel performance. >>>> See why Intel Parallel Studio got high marks during beta. >>>> http://p.sf.net/sfu/intel-sw-dev >>>> _______________________________________________ >>>> Pyobjc-dev mailing list >>>> Pyo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>> >>>> >>> >>> Maybe you can inspire yourself from the PyObjC.bridgeSupport file? The entry is: >>> >>> <function name='CGEventCreateMouseEvent'> >>> <retval already_cfretained='true' type='^{__CGEvent=}' /> >>> <arg type='^{__CGEventSource=}' /> >>> <arg type='I' /> >>> <arg type='{CGPoint=ff}' type64='{CGPoint=ff}' /> >>> <arg type='I' /> >>> </function> >>> >>> So maybe that your 64-bit signature would be >>> "^{__CGEvent=}^{__CGEventSource=}I{CGPoint=dd}I" or something? >>> >>> -- >>> Virgil Dupras >> >> > > I know it's a bug, I had started a fork of PyObjC with 64-bit fixes at > http://bitbucket.org/hsoft/pyobjc/ , but I think that Ronald, in his > recent commits, already fixed most of these bugs in the trunk. > > There's (or there were) a *lot* of 64-bit glitches all around. > -- > Virgil Dupras |
From: Virgil D. <hs...@ha...> - 2010-04-12 18:39:55
|
On Mon, Apr 12, 2010 at 7:44 PM, Pepijn de Vos <pep...@gm...> wrote: > Hi, > It's me again. > How can I change the wrapper for a function like CGEventCreateMouseEvent > from Quartz? > It seems like my CGPoint uses floats instead of doubles, which is wrong for > 64 bit, like in Snow Leopard. > Another option is going back to using objc and importing the function > manually. > The problem is that I don't know the syntax for loadBundleFunctions. > I managed to get CGPostMouseEvent working with this: v{CGPoint=dd} (instead > of ff) > What would I need to do to import CGEventCreateMouseEvent? > Groeten, > Pepijn de Vos > -- > Sent from my iPod Shuffle > http://pepijndevos.nl > On Apr 4, 2010, at 6:23 PM, Ratko Jagodic wrote: > > Hi Pepijn, > Sorry, but I haven't seen this before. It seemed to work for me. If you feel > adventurous, you could try investigating yourself in the PyObjC source. The > file is _callbacks.m where the link between C/Python is for events. > Sorry I couldn't be of more help. Maybe others on this list could provide > more info. > Good luck. > Ratko > > > On Sun, Apr 4, 2010 at 11:02 AM, Pepijn de Vos <pep...@gm...> > wrote: >> >> Hi, >> As you can see in the code below the returned value of the mouse event has >> an insane value. >> When I generate a click or move event the mouse jumps to the very corner >> of the screen. >> <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> >> Could it be that integer and float conversions between C and Python are >> messed up somewhere? >> I tried to use a tuple, a NSPoint and a CGPoint, which made no difference >> at all. >> Just creating a CGPoint object without the event works fine though. >> Groeten, >> Pepijn de Vos >> -- >> Sent from my iPod Shuffle >> http://pepijndevos.nl >> On Apr 4, 2010, at 5:54 PM, Ratko Jagodic wrote: >> >> I ran across the same problem back in September and there were a few bugs >> in the C code. I reported the bugs and they were fixed so I guess the >> Macports version includes those fixes. Don't know about the version numbers. >> CGEventTapCreate should take 6 parameters, as it does in carbon. >> >> What do you mean by "breaks the location"? >> "When I run Python26 and PyObjC from Macports the event system works fine, >> but making an event breaks the location." >> >> >> Ratko >> >> >> On Sun, Apr 4, 2010 at 10:27 AM, Pepijn de Vos <pep...@gm...> >> wrote: >>> >>> Hi all, >>> >>> I finally managed to get listening to events working, the code is at >>> http://github.com/pepijndevos/PyMouse/blob/master/mac.py#L30 >>> I don't know what made the difference, but after a lot of trying it >>> suddenly worked. >>> >>> Now I have another strange issue. >>> When I run the default Python and PyObjC version that came with Mac OS X >>> 10.6, Python segfaults while creating an event tap. >>> When I run Python26 and PyObjC from Macports the event system works fine, >>> but making an event breaks the location. >>> >>> Stock Python: >>> >>> >>> from Quartz import * >>> >>> def test(*args): >>> ... print args >>> ... >>> >>> tap = CGEventTapCreate( >>> ... kCGSessionEventTap, >>> ... kCGHeadInsertEventTap, >>> ... kCGEventTapOptionDefault, >>> ... CGEventMaskBit(kCGEventMouseMoved) | >>> ... CGEventMaskBit(kCGEventLeftMouseDown) | >>> ... CGEventMaskBit(kCGEventLeftMouseUp) | >>> ... CGEventMaskBit(kCGEventRightMouseDown) | >>> ... CGEventMaskBit(kCGEventRightMouseUp) | >>> ... CGEventMaskBit(kCGEventOtherMouseDown) | >>> ... CGEventMaskBit(kCGEventOtherMouseUp), >>> ... test) >>> Segmentation fault >>> >>> Macports Python: >>> >>> >>> from Quartz import * >>> >>> event = CGEventCreateMouseEvent(None, 3, CGPoint(200, 200), 1) >>> >>> CGEventGetLocation(event) >>> <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> >>> >>> Also the stock version of CGEventTapCreate needs 5 parameters while the >>> Macports version needs 6. >>> >>> Macports version of PyObjC is 2.2 >>> Included version should be 2.2b3 according to a blog I found. >>> >>> Groeten, >>> Pepijn de Vos >>> -- >>> Sent from my iPod Shuffle >>> http://pepijndevos.nl >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> _______________________________________________ >>> Pyobjc-dev mailing list >>> Pyo...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >> >> > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > Maybe you can inspire yourself from the PyObjC.bridgeSupport file? The entry is: <function name='CGEventCreateMouseEvent'> <retval already_cfretained='true' type='^{__CGEvent=}' /> <arg type='^{__CGEventSource=}' /> <arg type='I' /> <arg type='{CGPoint=ff}' type64='{CGPoint=ff}' /> <arg type='I' /> </function> So maybe that your 64-bit signature would be "^{__CGEvent=}^{__CGEventSource=}I{CGPoint=dd}I" or something? -- Virgil Dupras |
From: Pepijn de V. <pep...@gm...> - 2010-04-12 18:34:56
|
Thank you, that seemed to work. By the way, the bug is right there under your nose: <arg type='{CGPoint=ff}' type64='{CGPoint=**ff**}' /> Change the second ff into dd and it's done. Should I submit a patch or bug report somewhere? Groeten, Pepijn de Vos -- Sent from my iPod Shuffle http://pepijndevos.nl On Apr 12, 2010, at 8:13 PM, Virgil Dupras wrote: > On Mon, Apr 12, 2010 at 7:44 PM, Pepijn de Vos <pep...@gm...> wrote: >> Hi, >> It's me again. >> How can I change the wrapper for a function like CGEventCreateMouseEvent >> from Quartz? >> It seems like my CGPoint uses floats instead of doubles, which is wrong for >> 64 bit, like in Snow Leopard. >> Another option is going back to using objc and importing the function >> manually. >> The problem is that I don't know the syntax for loadBundleFunctions. >> I managed to get CGPostMouseEvent working with this: v{CGPoint=dd} (instead >> of ff) >> What would I need to do to import CGEventCreateMouseEvent? >> Groeten, >> Pepijn de Vos >> -- >> Sent from my iPod Shuffle >> http://pepijndevos.nl >> On Apr 4, 2010, at 6:23 PM, Ratko Jagodic wrote: >> >> Hi Pepijn, >> Sorry, but I haven't seen this before. It seemed to work for me. If you feel >> adventurous, you could try investigating yourself in the PyObjC source. The >> file is _callbacks.m where the link between C/Python is for events. >> Sorry I couldn't be of more help. Maybe others on this list could provide >> more info. >> Good luck. >> Ratko >> >> >> On Sun, Apr 4, 2010 at 11:02 AM, Pepijn de Vos <pep...@gm...> >> wrote: >>> >>> Hi, >>> As you can see in the code below the returned value of the mouse event has >>> an insane value. >>> When I generate a click or move event the mouse jumps to the very corner >>> of the screen. >>> <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> >>> Could it be that integer and float conversions between C and Python are >>> messed up somewhere? >>> I tried to use a tuple, a NSPoint and a CGPoint, which made no difference >>> at all. >>> Just creating a CGPoint object without the event works fine though. >>> Groeten, >>> Pepijn de Vos >>> -- >>> Sent from my iPod Shuffle >>> http://pepijndevos.nl >>> On Apr 4, 2010, at 5:54 PM, Ratko Jagodic wrote: >>> >>> I ran across the same problem back in September and there were a few bugs >>> in the C code. I reported the bugs and they were fixed so I guess the >>> Macports version includes those fixes. Don't know about the version numbers. >>> CGEventTapCreate should take 6 parameters, as it does in carbon. >>> >>> What do you mean by "breaks the location"? >>> "When I run Python26 and PyObjC from Macports the event system works fine, >>> but making an event breaks the location." >>> >>> >>> Ratko >>> >>> >>> On Sun, Apr 4, 2010 at 10:27 AM, Pepijn de Vos <pep...@gm...> >>> wrote: >>>> >>>> Hi all, >>>> >>>> I finally managed to get listening to events working, the code is at >>>> http://github.com/pepijndevos/PyMouse/blob/master/mac.py#L30 >>>> I don't know what made the difference, but after a lot of trying it >>>> suddenly worked. >>>> >>>> Now I have another strange issue. >>>> When I run the default Python and PyObjC version that came with Mac OS X >>>> 10.6, Python segfaults while creating an event tap. >>>> When I run Python26 and PyObjC from Macports the event system works fine, >>>> but making an event breaks the location. >>>> >>>> Stock Python: >>>> >>>>>>> from Quartz import * >>>>>>> def test(*args): >>>> ... print args >>>> ... >>>>>>> tap = CGEventTapCreate( >>>> ... kCGSessionEventTap, >>>> ... kCGHeadInsertEventTap, >>>> ... kCGEventTapOptionDefault, >>>> ... CGEventMaskBit(kCGEventMouseMoved) | >>>> ... CGEventMaskBit(kCGEventLeftMouseDown) | >>>> ... CGEventMaskBit(kCGEventLeftMouseUp) | >>>> ... CGEventMaskBit(kCGEventRightMouseDown) | >>>> ... CGEventMaskBit(kCGEventRightMouseUp) | >>>> ... CGEventMaskBit(kCGEventOtherMouseDown) | >>>> ... CGEventMaskBit(kCGEventOtherMouseUp), >>>> ... test) >>>> Segmentation fault >>>> >>>> Macports Python: >>>> >>>>>>> from Quartz import * >>>>>>> event = CGEventCreateMouseEvent(None, 3, CGPoint(200, 200), 1) >>>>>>> CGEventGetLocation(event) >>>> <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> >>>> >>>> Also the stock version of CGEventTapCreate needs 5 parameters while the >>>> Macports version needs 6. >>>> >>>> Macports version of PyObjC is 2.2 >>>> Included version should be 2.2b3 according to a blog I found. >>>> >>>> Groeten, >>>> Pepijn de Vos >>>> -- >>>> Sent from my iPod Shuffle >>>> http://pepijndevos.nl >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Download Intel® Parallel Studio Eval >>>> Try the new software tools for yourself. Speed compiling, find bugs >>>> proactively, and fine-tune applications for parallel performance. >>>> See why Intel Parallel Studio got high marks during beta. >>>> http://p.sf.net/sfu/intel-sw-dev >>>> _______________________________________________ >>>> Pyobjc-dev mailing list >>>> Pyo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>> >>> >> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >> >> > > Maybe you can inspire yourself from the PyObjC.bridgeSupport file? The entry is: > > <function name='CGEventCreateMouseEvent'> > <retval already_cfretained='true' type='^{__CGEvent=}' /> > <arg type='^{__CGEventSource=}' /> > <arg type='I' /> > <arg type='{CGPoint=ff}' type64='{CGPoint=ff}' /> > <arg type='I' /> > </function> > > So maybe that your 64-bit signature would be > "^{__CGEvent=}^{__CGEventSource=}I{CGPoint=dd}I" or something? > > -- > Virgil Dupras |
From: Pepijn de V. <pep...@gm...> - 2010-04-12 17:44:53
|
Hi, It's me again. How can I change the wrapper for a function like CGEventCreateMouseEvent from Quartz? It seems like my CGPoint uses floats instead of doubles, which is wrong for 64 bit, like in Snow Leopard. Another option is going back to using objc and importing the function manually. The problem is that I don't know the syntax for loadBundleFunctions. I managed to get CGPostMouseEvent working with this: v{CGPoint=dd} (instead of ff) What would I need to do to import CGEventCreateMouseEvent? Groeten, Pepijn de Vos -- Sent from my iPod Shuffle http://pepijndevos.nl On Apr 4, 2010, at 6:23 PM, Ratko Jagodic wrote: > Hi Pepijn, > > Sorry, but I haven't seen this before. It seemed to work for me. If you feel adventurous, you could try investigating yourself in the PyObjC source. The file is _callbacks.m where the link between C/Python is for events. > > Sorry I couldn't be of more help. Maybe others on this list could provide more info. > Good luck. > > Ratko > > > > On Sun, Apr 4, 2010 at 11:02 AM, Pepijn de Vos <pep...@gm...> wrote: > Hi, > > As you can see in the code below the returned value of the mouse event has an insane value. > When I generate a click or move event the mouse jumps to the very corner of the screen. > > <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> > > Could it be that integer and float conversions between C and Python are messed up somewhere? > I tried to use a tuple, a NSPoint and a CGPoint, which made no difference at all. > Just creating a CGPoint object without the event works fine though. > > Groeten, > Pepijn de Vos > -- > Sent from my iPod Shuffle > http://pepijndevos.nl > > On Apr 4, 2010, at 5:54 PM, Ratko Jagodic wrote: > >> I ran across the same problem back in September and there were a few bugs in the C code. I reported the bugs and they were fixed so I guess the Macports version includes those fixes. Don't know about the version numbers. >> CGEventTapCreate should take 6 parameters, as it does in carbon. >> >> >> What do you mean by "breaks the location"? >> "When I run Python26 and PyObjC from Macports the event system works fine, but making an event breaks the location." >> >> >> Ratko >> >> >> >> On Sun, Apr 4, 2010 at 10:27 AM, Pepijn de Vos <pep...@gm...> wrote: >> Hi all, >> >> I finally managed to get listening to events working, the code is at http://github.com/pepijndevos/PyMouse/blob/master/mac.py#L30 >> I don't know what made the difference, but after a lot of trying it suddenly worked. >> >> Now I have another strange issue. >> When I run the default Python and PyObjC version that came with Mac OS X 10.6, Python segfaults while creating an event tap. >> When I run Python26 and PyObjC from Macports the event system works fine, but making an event breaks the location. >> >> Stock Python: >> >> >>> from Quartz import * >> >>> def test(*args): >> ... print args >> ... >> >>> tap = CGEventTapCreate( >> ... kCGSessionEventTap, >> ... kCGHeadInsertEventTap, >> ... kCGEventTapOptionDefault, >> ... CGEventMaskBit(kCGEventMouseMoved) | >> ... CGEventMaskBit(kCGEventLeftMouseDown) | >> ... CGEventMaskBit(kCGEventLeftMouseUp) | >> ... CGEventMaskBit(kCGEventRightMouseDown) | >> ... CGEventMaskBit(kCGEventRightMouseUp) | >> ... CGEventMaskBit(kCGEventOtherMouseDown) | >> ... CGEventMaskBit(kCGEventOtherMouseUp), >> ... test) >> Segmentation fault >> >> Macports Python: >> >> >>> from Quartz import * >> >>> event = CGEventCreateMouseEvent(None, 3, CGPoint(200, 200), 1) >> >>> CGEventGetLocation(event) >> <NSPoint x=13510801139695616.0 y=6.953222975623699e-310> >> >> Also the stock version of CGEventTapCreate needs 5 parameters while the Macports version needs 6. >> >> Macports version of PyObjC is 2.2 >> Included version should be 2.2b3 according to a blog I found. >> >> Groeten, >> Pepijn de Vos >> -- >> Sent from my iPod Shuffle >> http://pepijndevos.nl >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >> > > |
From: Ronald O. <ron...@ma...> - 2010-04-06 10:02:38
|
On 5 Apr, 2010, at 17:31, Stefan Sieber wrote: > Hi, > > I'm trying to use CLLocationManager from Python. Althoug I don't get an error, I also do not get any output. > > Does someone have some experience with this? There is now an example in the pyobjc SVN repository: <http://svn.red-bean.com/pyobjc/trunk/pyobjc/pyobjc-framework-CoreLocation/Examples/WhereIsMyMac/> Ronald |
From: Ronald O. <ron...@ma...> - 2010-04-06 09:13:37
|
On 6 Apr, 2010, at 1:31, Greg Ewing wrote: > Ronald Oussoren wrote: >> BTW. A side-effect of the py3k port is that the version of pyobjc in the repository requires python 2.6 because I use byte literals ( b"hello") to tweak the output from the 2to3 tool. I have no plans to reintroduce support for python 2.5, especially because I'd like to make some changes to the bridge that will require python 2.6. > > This is a nuisance. Maybe we need a 2to2 tool which undoes all > the hacks people have to put in to get their code to work with > 2to3. :-( It should be fairly easy to use something like b("bytestring") and have that work on both 3.x and 2.x, but I don't care to spend time on doing that. The main reason I don't want to spent time on that is that I have, not fully fleshed out, plans to rewrite the machinery that determines which methods an ObjC class has. That machinery currently eagerly scans ObjC classes when they are first accessed and I want to switch to a scheme where the bridge scans classes much more lazily. That will require python 2.6 to ensure that introspection from Python still works (that is, using "dir(someObject)" to check which methods it has). The reason for that is that python 2.6 has hooks too interact with dir(), python2.5 doesn't have that. Ronald > > -- > Greg > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Ronald O. <ron...@ma...> - 2010-04-06 09:08:25
|
On 5 Apr, 2010, at 17:31, Stefan Sieber wrote: > Hi, > > I'm trying to use CLLocationManager from Python. Althoug I don't get an error, I also do not get any output. > > Does someone have some experience with this? I've two things to say: 1) There is 'pyobjc-framework-CoreLocation' that wraps the CoreLocation APIs. Using objc.loadBunlde works as well, but the CoreLocation wrapper makes the constants in the framework available and is more convenient to use ('import CoreLocation'). 2) You don't use an eventloop, which is probably why your callback doesn't get called. Ronald > > Brgds, > Stefan > > <python> > import objc > from Foundation import * > import time > > > objc.loadBundle("CoreLocation", globals(), "/System/Library/Frameworks/CoreLocation.framework") > > > class LocationDelegate(NSObject): > def locationManager_didUpdateToLocation_fromLocation_(self, manager, newlocation, oldlocation): > print manager > print newlocation > print oldlocation > def didFailWithError_(self, error): > print error > > delegate = LocationDelegate.alloc().init() > print (delegate) > myLocMgr = CLLocationManager.alloc().init() > print (myLocMgr) > myLocMgr.setDelegate_(delegate) > accuracy = -1.0 > myLocMgr.setDesiredAccuracy_(accuracy) > myLocMgr.startUpdatingLocation() > #time.sleep(10) > myLoc = myLocMgr.location() > print (myLoc) > </python> > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Greg E. <gre...@ca...> - 2010-04-05 23:21:06
|
Ronald Oussoren wrote: > BTW. A side-effect of the py3k port is that the version of pyobjc in the repository requires python 2.6 because I use byte literals ( b"hello") to tweak the output from the 2to3 tool. I have no plans to reintroduce support for python 2.5, especially because I'd like to make some changes to the bridge that will require python 2.6. This is a nuisance. Maybe we need a 2to2 tool which undoes all the hacks people have to put in to get their code to work with 2to3. :-( -- Greg |
From: Aahz <aa...@py...> - 2010-04-05 21:41:31
|
On Sun, Apr 04, 2010, Ronald Oussoren wrote: > On 3 Apr, 2010, at 15:41, Aahz wrote: >> >> There's a reasonably good chance we're going to switch to kauth due to >> FSEvents' limitations, which would sidestep the issue another way. Does >> anyone have any experience using kauth? > > What's kauth? Hooks for virus scanners to detect filesystem changes. I believe it's the underlying mechanism for FSEvents: http://developer.apple.com/mac/library/technotes/tn2005/tn2127.html -- Aahz (aa...@py...) <*> http://www.pythoncraft.com/ Why is this newsgroup different from all other newsgroups? |