Re: [Pyobjc-dev] import QTKit -> NSRecursiveLock errors
Brought to you by:
ronaldoussoren
From: Ronald O. <ron...@ma...> - 2009-06-25 06:03:05
|
On 24 Jun, 2009, at 2:34, Dirk Stoop wrote: > > > Make sure you try making a release build of your project after setting > this up though, to verify that the .py file that contains your > QTMovieView subclass is actually bundled in the app. (I'm not sure if > the current Xcode support/templates in PyObjC still relies on > module_graph to detect what needs to be bundled and what not when > building an autonomous .app, but if it does, your module will not be > included if it's only imported in some class' instance or class > methods). The current Xcode templates don't use py2app at all, which really sucks but is unlikely to change soon because fixing that requires some refactoring in py2app. However, if you use py2app it should detect 'import' statements in function bodies as well as at the global level. I'd consider it a bug when it doesn't detect import statements in a function/method body. Ronald > > Cheers, > - Dirk > > On Jun 16, 2009, at 5:19 PM, Orestis Markou wrote: > >> That's because at the time of the import (when main.m is executed) >> there's no connection to the window server yet. >> >> To get around this, you need to start importing in the >> 'applicationDidFinishLaunching' stage. If you want to subclass >> QTMovieView, put it in a different module, and import it in the >> delegate method. That probably means you can't use it in Interface >> Builder - you may be able to set it at runtime, but I can't help you >> there. >> -- >> or...@or... >> http://orestis.gr/ >> >> >> >> >> On 16 Jun 2009, at 18:13, Daniel Ashbrook wrote: >> >>> Does anybody have an idea on how I can deal with this? I got around >>> the issue back in April but now am wanting to subclass a >>> QTMovieView. >>> >>> Thanks, >>> >>> dan >>> >>> On Apr 27, 2009, at 12:25p, Daniel Ashbrook wrote: >>> >>>> I think I remember there being some discussion of this a while >>>> back, >>>> but couldn't find it. >>>> >>>> Try this: >>>> 1) Make a new Python Cocoa app in Xcode >>>> 2) In the application delegate, insert the line "import QTKit" >>>> 3) Run it >>>> >>>> I get: >>>> >>>> _RegisterApplication(), FAILED TO establish the default connection >>>> to the WindowServer, _CGSDefaultConnection() is NULL. >>>> 2009-04-27 12:22:41.794 QTVideoTest2[79402:10b] *** - >>>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>>> '(null)') unlocked when not locked >>>> 2009-04-27 12:22:41.796 QTVideoTest2[79402:10b] *** Break on >>>> _NSLockError() to debug. >>>> 2009-04-27 12:22:41.796 QTVideoTest2[79402:10b] *** - >>>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>>> '(null)') unlocked when not locked >>>> 2009-04-27 12:22:41.797 QTVideoTest2[79402:10b] *** Break on >>>> _NSLockError() to debug. >>>> 2009-04-27 12:22:41.801 QTVideoTest2[79402:10b] *** - >>>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>>> '(null)') unlocked when not locked >>>> 2009-04-27 12:22:41.801 QTVideoTest2[79402:10b] *** Break on >>>> _NSLockError() to debug. >>>> 2009-04-27 12:22:41.804 QTVideoTest2[79402:10b] >>>> NSInternalInconsistencyException - Error (1002) creating CGSWindow >>>> 2009-04-27 12:22:41.811 QTVideoTest2[79402:10b] *** - >>>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>>> '(null)') unlocked when not locked >>>> 2009-04-27 12:22:41.812 QTVideoTest2[79402:10b] *** Break on >>>> _NSLockError() to debug. >>>> 2009-04-27 12:22:41.812 QTVideoTest2[79402:10b] *** - >>>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>>> '(null)') unlocked when not locked >>>> 2009-04-27 12:22:41.812 QTVideoTest2[79402:10b] *** Break on >>>> _NSLockError() to debug. >>>> 2009-04-27 12:22:41.813 QTVideoTest2[79402:10b] *** - >>>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>>> '(null)') unlocked when not locked >>>> 2009-04-27 12:22:41.813 QTVideoTest2[79402:10b] *** Break on >>>> _NSLockError() to debug. >>>> 2009-04-27 12:22:41.814 QTVideoTest2[79402:10b] *** - >>>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>>> '(null)') unlocked when not locked >>>> 2009-04-27 12:22:41.815 QTVideoTest2[79402:10b] *** Break on >>>> _NSLockError() to debug. >>>> >>>> This is particularly frustrating as, in my real project, I am >>>> trying >>>> to make a subclass of QTKit.QTCaptureView; however, I can't, as >>>> importing yields the above errors. >>>> >>>> >>>> dan >>> >>> >>> ------------------------------------------------------------------------------ >>> Crystal Reports - New Free Runtime and 30 Day Trial >>> Check out the new simplified licensing option that enables unlimited >>> royalty-free distribution of the report engine for externally facing >>> server and web deployment. >>> http://p.sf.net/sfu/businessobjects >>> _______________________________________________ >>> Pyobjc-dev mailing list >>> Pyo...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >> >> >> ------------------------------------------------------------------------------ >> Crystal Reports - New Free Runtime and 30 Day Trial >> Check out the new simplified licensing option that enables unlimited >> royalty-free distribution of the report engine for externally facing >> server and web deployment. >> http://p.sf.net/sfu/businessobjects >> _______________________________________________ >> 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 |