pyobjc-dev Mailing List for PyObjC (Page 47)
Brought to you by:
ronaldoussoren
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(30) |
May
(18) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2002 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
(3) |
Jul
(13) |
Aug
|
Sep
(23) |
Oct
(180) |
Nov
(291) |
Dec
(95) |
2003 |
Jan
(338) |
Feb
(352) |
Mar
(97) |
Apr
(46) |
May
(226) |
Jun
(184) |
Jul
(145) |
Aug
(141) |
Sep
(69) |
Oct
(161) |
Nov
(96) |
Dec
(90) |
2004 |
Jan
(66) |
Feb
(87) |
Mar
(98) |
Apr
(132) |
May
(115) |
Jun
(68) |
Jul
(150) |
Aug
(92) |
Sep
(59) |
Oct
(52) |
Nov
(17) |
Dec
(75) |
2005 |
Jan
(84) |
Feb
(191) |
Mar
(133) |
Apr
(114) |
May
(158) |
Jun
(185) |
Jul
(62) |
Aug
(28) |
Sep
(36) |
Oct
(88) |
Nov
(65) |
Dec
(43) |
2006 |
Jan
(85) |
Feb
(62) |
Mar
(92) |
Apr
(75) |
May
(68) |
Jun
(101) |
Jul
(73) |
Aug
(37) |
Sep
(91) |
Oct
(65) |
Nov
(30) |
Dec
(39) |
2007 |
Jan
(24) |
Feb
(28) |
Mar
(10) |
Apr
(2) |
May
(18) |
Jun
(16) |
Jul
(21) |
Aug
(6) |
Sep
(30) |
Oct
(31) |
Nov
(153) |
Dec
(31) |
2008 |
Jan
(63) |
Feb
(70) |
Mar
(47) |
Apr
(24) |
May
(59) |
Jun
(22) |
Jul
(12) |
Aug
(7) |
Sep
(14) |
Oct
(26) |
Nov
(5) |
Dec
(5) |
2009 |
Jan
(10) |
Feb
(41) |
Mar
(70) |
Apr
(88) |
May
(49) |
Jun
(62) |
Jul
(34) |
Aug
(15) |
Sep
(55) |
Oct
(40) |
Nov
(67) |
Dec
(21) |
2010 |
Jan
(60) |
Feb
(17) |
Mar
(26) |
Apr
(26) |
May
(29) |
Jun
(4) |
Jul
(21) |
Aug
(21) |
Sep
(10) |
Oct
(12) |
Nov
(3) |
Dec
(19) |
2011 |
Jan
(3) |
Feb
(13) |
Mar
(8) |
Apr
(8) |
May
(17) |
Jun
(20) |
Jul
(21) |
Aug
(7) |
Sep
|
Oct
|
Nov
(9) |
Dec
(11) |
2012 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
(4) |
Jun
(14) |
Jul
(5) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(23) |
Dec
(1) |
2013 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
(5) |
Jun
(1) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(12) |
Nov
(10) |
Dec
(3) |
2014 |
Jan
(7) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(2) |
Jun
(11) |
Jul
(10) |
Aug
(4) |
Sep
|
Oct
(8) |
Nov
(1) |
Dec
(2) |
2015 |
Jan
(9) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(7) |
Jun
|
Jul
(5) |
Aug
(6) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2016 |
Jan
(1) |
Feb
(1) |
Mar
(4) |
Apr
(2) |
May
(1) |
Jun
|
Jul
(6) |
Aug
(8) |
Sep
(21) |
Oct
(17) |
Nov
|
Dec
(36) |
2017 |
Jan
(6) |
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(6) |
2018 |
Jan
(2) |
Feb
(3) |
Mar
(3) |
Apr
(14) |
May
(2) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(6) |
Oct
(16) |
Nov
(1) |
Dec
(6) |
2019 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(1) |
2021 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2025 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ronald O. <ron...@ma...> - 2009-05-07 05:33:36
|
Johan, On 5 May, 2009, at 16:37, Johan Rydberg wrote: > I'm trying to implement the informal NSKeyValueBindingCreation > protocol. > I would love to make it a mixin-class so I can reuse the functionality > throughout > my application. > > Here's how I planned to do it: > > class NSKeyValueBindingCreation: > def bind_toObject_withKeyPath_options_(self, binding, anObject, > keyPath, options): > ... > def observeValueForKeyPath_ofObject_change_context_(self, keyPath, > anObject, > change, > context): > .... > > class Foo(NSObject, NSKeyValueBindingCreation): > .... > > The problem is that my Foo class won't recognize the > observiceValueForKeyPath:ofObject:change:context: message. > > objc.error: NSInternalInconsistencyException - <Foo: 0x35e430>: An > -observeValueForKeyPath:ofObject:change:context: message was received > but not handled. > > > If I put it directly in Foo it gets recognized. > > Poking through the PyObjC manual I found the following lines: > > Multiple inheritance may be used when subclassing an Objective-C > class, so long as the Objective-C class is the first base class and > there > is only one Objective-C base class. The Objective-C runtime does not > support multiple inheritance. These mix-in classes should not contain > different implementations for Objective-C methods. To achieve this > behavior, Categories should be used instead. > > I interpret those lines as that the snippets above should work. > Am I wrong? Yes ;-) > > How can I, and how should I use mixin classes? You cannot do this at the moment. Mixins cannot be used to add new methods that the ObjC runtime will see. I might add this behaviour in the future, I like your usecase and this could be used to make useful common functionality available as mixin classes. Adding this will require a detailed specification and testsuite, the objc runtime doesn't support multiple-inheritance itself and hence support for mixin classes will require some tricks. I'm especially worried about getting the semantics exactly like they'd be if the base-class is a regular Python class. Ronald > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! > Your > production scanning environment may not be a perfect world - but > thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW > KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Johan R. <joh...@gm...> - 2009-05-05 14:38:10
|
I'm trying to implement the informal NSKeyValueBindingCreation protocol. I would love to make it a mixin-class so I can reuse the functionality throughout my application. Here's how I planned to do it: class NSKeyValueBindingCreation: def bind_toObject_withKeyPath_options_(self, binding, anObject, keyPath, options): ... def observeValueForKeyPath_ofObject_change_context_(self, keyPath, anObject, change, context): .... class Foo(NSObject, NSKeyValueBindingCreation): .... The problem is that my Foo class won't recognize the observiceValueForKeyPath:ofObject:change:context: message. objc.error: NSInternalInconsistencyException - <Foo: 0x35e430>: An -observeValueForKeyPath:ofObject:change:context: message was received but not handled. If I put it directly in Foo it gets recognized. Poking through the PyObjC manual I found the following lines: Multiple inheritance may be used when subclassing an Objective-C class, so long as the Objective-C class is the first base class and there is only one Objective-C base class. The Objective-C runtime does not support multiple inheritance. These mix-in classes should not contain different implementations for Objective-C methods. To achieve this behavior, Categories should be used instead. I interpret those lines as that the snippets above should work. Am I wrong? How can I, and how should I use mixin classes? |
From: Robert B. <raf...@mc...> - 2009-04-28 12:12:29
|
remove me please |
From: Ronald O. <ron...@ma...> - 2009-04-28 11:49:15
|
Thanks for the patch, I'll apply both this one and the bridgesupport patch you posted earlier. I'd prefer to completely fail on invalid metadata files, but need to fix pyobjc's metadata tools before I do that. The pyobjc-metadata project contains tools for working with metadata files, but sadly enough those are broken at the moment. One of the tools in there is a script that verifies the contents of a brigesupport file and gives more useful warnings and/or errors. Ronald On 24 Apr, 2009, at 15:00, James R Eagan wrote: > And here's the follow-up patch I referred to yesterday. This one > modifies parsexml.m to avoid a segfault on malformed typestrings (at > least malformed such that the type spec is missing). It also > modifies obj/_bridgesupport.py to output a more user-friendly warning. > > I'm not sure this is necessarily the right approach ... perhaps it > would be better to simply ignore invalid signatures instead of the > entire module. But at least now the user will see a meaningful > error rather than a cryptic segfault when loading frameworks with > faulty bridgesupport metadata. > > Cheers! > James > > <bridgesupport-bogus-data-nocrash.patch> > > PS: Apologies about the previous email. I have no idea why that > duplicate went out. Pixie dust in the > keyboard > ?------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensign 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 |
From: Ronald O. <ron...@ma...> - 2009-04-28 11:41:41
|
On 28 Apr, 2009, at 13:13, Daniel Ashbrook wrote: > Ahh, scratch that; I see I can just provide a string of that name and > it all works out. > That's the correct way of using these values, Apple doesn't provide constants for them in Objective-C either. Ronald > > dan > > > On Apr 27, 2009, at 4:10p, Daniel Ashbrook wrote: > >> It appears that the constants listed in the reference for >> QTCompressionOptions are missing; they are: >> >> QTCompressionOptionsLosslessAppleIntermediateVideo; >> QTCompressionOptionsLosslessAnimationVideo; >> QTCompressionOptions120SizeH264Video; >> QTCompressionOptions240SizeH264Video; >> QTCompressionOptionsSD480SizeH264Video; >> QTCompressionOptions120SizeMPEG4Video; >> QTCompressionOptions240SizeMPEG4Video; >> QTCompressionOptionsSD480SizeMPEG4Video; >> QTCompressionOptionsLosslessALACAudio; >> QTCompressionOptionsHighQualityAACAudio; >> QTCompressionOptionsVoiceQualityAACAudio; >> >> I'd expect to find them in QTKit; maybe there's somewhere else I >> should be looking? >> >> >> dan > > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code > vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Daniel A. <an...@cc...> - 2009-04-28 11:13:59
|
Ahh, scratch that; I see I can just provide a string of that name and it all works out. dan On Apr 27, 2009, at 4:10p, Daniel Ashbrook wrote: > It appears that the constants listed in the reference for > QTCompressionOptions are missing; they are: > > QTCompressionOptionsLosslessAppleIntermediateVideo; > QTCompressionOptionsLosslessAnimationVideo; > QTCompressionOptions120SizeH264Video; > QTCompressionOptions240SizeH264Video; > QTCompressionOptionsSD480SizeH264Video; > QTCompressionOptions120SizeMPEG4Video; > QTCompressionOptions240SizeMPEG4Video; > QTCompressionOptionsSD480SizeMPEG4Video; > QTCompressionOptionsLosslessALACAudio; > QTCompressionOptionsHighQualityAACAudio; > QTCompressionOptionsVoiceQualityAACAudio; > > I'd expect to find them in QTKit; maybe there's somewhere else I > should be looking? > > > dan |
From: Ronald O. <ron...@ma...> - 2009-04-28 07:47:38
|
On 27 Apr, 2009, at 22:10, Daniel Ashbrook wrote: > It appears that the constants listed in the reference for > QTCompressionOptions are missing; they are: > > QTCompressionOptionsLosslessAppleIntermediateVideo; > QTCompressionOptionsLosslessAnimationVideo; > QTCompressionOptions120SizeH264Video; > QTCompressionOptions240SizeH264Video; > QTCompressionOptionsSD480SizeH264Video; > QTCompressionOptions120SizeMPEG4Video; > QTCompressionOptions240SizeMPEG4Video; > QTCompressionOptionsSD480SizeMPEG4Video; > QTCompressionOptionsLosslessALACAudio; > QTCompressionOptionsHighQualityAACAudio; > QTCompressionOptionsVoiceQualityAACAudio; > > I'd expect to find them in QTKit; maybe there's somewhere else I > should be looking? It's a bit odd given the structure of other frameworks, but these aren't defined as constants in a header file. You should use string literals with these values instead ( u"QTCompressionOptions240SizeMPEG4Video" ). Ronald > > > dan > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensign 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 |
From: Daniel A. <an...@cc...> - 2009-04-27 20:10:27
|
It appears that the constants listed in the reference for QTCompressionOptions are missing; they are: QTCompressionOptionsLosslessAppleIntermediateVideo; QTCompressionOptionsLosslessAnimationVideo; QTCompressionOptions120SizeH264Video; QTCompressionOptions240SizeH264Video; QTCompressionOptionsSD480SizeH264Video; QTCompressionOptions120SizeMPEG4Video; QTCompressionOptions240SizeMPEG4Video; QTCompressionOptionsSD480SizeMPEG4Video; QTCompressionOptionsLosslessALACAudio; QTCompressionOptionsHighQualityAACAudio; QTCompressionOptionsVoiceQualityAACAudio; I'd expect to find them in QTKit; maybe there's somewhere else I should be looking? dan |
From: Daniel A. <an...@cc...> - 2009-04-27 16:26:02
|
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 |
From: Greg E. <gre...@ca...> - 2009-04-27 01:24:45
|
Randy Syring wrote: > Could you tell me briefly how this project differs from something like > wxPython? It wraps platform-specific libraries directly, rather than being a wrapper around another cross-platform library. This means less bloat and less dependencies. Chances are you already have the necessary libraries installed. The API is designed to be very straightforward and Pythonic, and it's fully documented in its own terms, so you don't have to consult the documentation for some other library in some other language and translate into Python. -- Greg |
From: Ronald O. <ron...@ma...> - 2009-04-26 10:13:43
|
On 26 Apr, 2009, at 11:01, James Trankelson wrote: > Gauging from the fact that this thread has gone stale, Is it safe to > assume that this just isn't possible with pyobjc? It is possible, I've been busy with other stuff and others don't seem to feel qualified enough to anwser your question. My current guess is that you have succeeded in partially installing the latest version of PyObjC. Check you /Library/Python/2.5/site- packages directory and remove all traces of pyobjc-2.2 in there (pyobjc-core, pyobjc-framework-*). If you do that the ord('...)' version should work. If it doesn't you'll have to wait for a proper release of pyobjc 2.2. Ronald > > -jt > > On Thu, Apr 23, 2009 at 9:17 AM, James Trankelson <tra...@gm... > > wrote: >> Ok, now using ord: >> >> v, gl = CTFontGetGlyphsForCharacters(font, ord(u'x'), None, 1) >> >> Produces: >> >> TypeError: Expecting UniChar >> >> -jt >> >> On Thu, Apr 23, 2009 at 7:43 AM, Ronald Oussoren <ron...@ma... >> > wrote: >>> >>> On 23 Apr, 2009, at 0:55, James Trankelson wrote: >>> >>>> Ok, so in order to do this, I need to install the version in the >>>> trunk. >>> >>> You don't have to install the version in the trunk, if you >>> manually convert >>> unicode characters to integers (using "ord", rather than the unichar >>> function I mentioned yesterday) >>>> >>>> I hate to say it, but that's causing me trouble as well... >>> >>> Phew, I'm glad that didn't work. Please don't install PyObjC 2.2 >>> in the >>> system install of Python. There are differences between the >>> current edition >>> of PyObjC and the version included in Leoopard and I don't know if >>> those >>> changes are backward compatible. That means that installing an >>> updated >>> version of PyObjC could break system components (especially on >>> Leopard >>> Server). >>> >>> Sadly enough the version in the trunk isn't ready to be installed >>> by new >>> users yet, I need to do some work on packaging (makeing sure that >>> it can be >>> installed from source with the Python.org distribution, provide >>> binary >>> packages, ...). >>> >>> Ronald >>> >>>> >>>> $ sudo easy_install pyobjc==2.2b1 >>>> >>>> Searching for pyobjc==2.2b1 >>>> ... >>>> Running pyobjc-2.2b1/setup.py -q bdist_egg --dist-dir >>>> /tmp/easy_install-_86MCZ/pyobjc-2.2b1/egg-dist-tmp-Q8jX-H >>>> The required version of setuptools (>=0.6c9) is not available, and >>>> can't be installed while this script is running. Please install >>>> a more recent version first, using 'easy_install -U setuptools'. >>>> >>>> (Currently using setuptools 0.6c7 >>>> >>>> (/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/ >>>> lib/python)) >>>> error: Setup script exited with 2 >>>> >>>> $ sudo easy_install -U setuptools >>>> Searching for setuptools >>>> Reading http://pypi.python.org/simple/setuptools/ >>>> Best match: setuptools 0.6c9 >>>> Processing setuptools-0.6c9-py2.5.egg >>>> setuptools 0.6c9 is already the active version in easy-install.pth >>>> Installing easy_install script to /usr/local/bin >>>> Installing easy_install-2.5 script to /usr/local/bin >>>> >>>> Using /Library/Python/2.5/site-packages/setuptools-0.6c9-py2.5.egg >>>> Processing dependencies for setuptools >>>> Finished processing dependencies for setuptools >>>> >>>> $ sudo easy_install pyobjc==2.2b1 >>>> >>>> (Same as first try) >>>> >>>> Is there some config file that will allow me to get this to point >>>> to >>>> the right setuptools? >>>> >>>> Thanks again. >>>> >>>> -jt >>>> >>>> On Wed, Apr 22, 2009 at 10:29 PM, Ronald Oussoren >>>> <ron...@ma...> wrote: >>>>> >>>>> On 22 Apr, 2009, at 14:38, James Trankelson wrote: >>>>> >>>>>> Bah. Thanks. Still not quite out of the woods, though. >>>>>> >>>>>> Now it's not having trouble finding the function >>>>>> (CTFontCreatePathForGlyph), but I get a new error: >>>>>> >>>>>> depythonifying 'short', got 'unicode' of 1 >>>>> >>>>> I should have mentioned that, the version of pyobjc that's >>>>> included with >>>>> Leopard cannot do what you want it to do. You must pass >>>>> unichar(u'a')) >>>>> instead of u'a'. The reason for that is that "unichar" is an >>>>> alias for >>>>> "short int" in (Objective-)C, both result in the same metadata. >>>>> >>>>> The version of PyObjC that's in the subversion repository does >>>>> know the >>>>> difference between "unichar" and "unsigned short" using hacks in >>>>> the >>>>> metadata file. >>>>> >>>>>> >>>>>> My usage is nearly identical to an example in cttests.py for >>>>>> obtaining >>>>>> a font and getting the Glyph from it: >>>>>> >>>>>> v, gl = CTFontGetGlyphsForCharacters(font, u'x', None, 1) >>>>>> v = CTFontCreatePathForGlyph(font, gl[0], None) >>>>>> >>>>>> This leads me to wonder if the signature mentioned previously for >>>>>> CTFontCreatePathForGlyph was incorrect: >>>>>> >>>>>> '@@sn^{CGAffineTransform=ffffff}' >>>>>> >>>>>> Unfortunately, I can't find any documentation on how to map the >>>>>> signatures. For someone that knows, is this signature correct? >>>>> >>>>> The signature is correct. "s" is the encoding for both "short >>>>> int" and >>>>> "unichar". >>>>> >>>>> Ronald >>>>> >>>>>> >>>>>> Thanks >>>>>> >>>>>> -jt >>>>>> >>>>>> >>>>>> On Wed, Apr 22, 2009 at 10:19 AM, Petr Mifek >>>>>> <pet...@an...> wrote: >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> James, import CoreText is missing there. >>>>>>> >>>>>>> Cheers, Petr >>>>>>> >>>>>>> James Trankelson wrote: >>>>>>>> >>>>>>>> It seems like some names can't be found. CoreText is one of >>>>>>>> them. >>>>>>>> >>>>>>>> from CoreText import * >>>>>>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>>>>>> ('CTFontCreatePathForGlyph', >>>>>>>> '@@sn^{CGAffineTransform=ffffff}') >>>>>>>> ], False) >>>>>>>> >>>>>>>> Produces: NameError: name 'CoreText' is not defined >>>>>>>> >>>>>>>> I tried manually loading the bundle as follows: >>>>>>>> >>>>>>>> objc.loadBundle("CoreText", globals(), >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> bundle_path=objc.pathForFramework(u'/Developer/SDKs/ >>>>>>>> MacOSX10.5.sdk/System/Library/Frameworks/ >>>>>>>> ApplicationServices.framework/Versions/A/Frameworks/ >>>>>>>> CoreText.framework')) >>>>>>>> >>>>>>>> Which also fails. >>>>>>>> >>>>>>>> -jt >>>>>>>> >>>>>>>> On Wed, Apr 22, 2009 at 7:22 AM, Ronald Oussoren >>>>>>>> <ron...@ma...> >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> On 21 Apr, 2009, at 20:59, James Trankelson wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I'm trying to do some CoreText suff (10.5). Most of the >>>>>>>>>> calls are >>>>>>>>>> fine, but one fails: >>>>>>>>>> >>>>>>>>>> global name 'CTFontCreatePathForGlyph' is not defined >>>>>>>>>> >>>>>>>>>> Is there any way around this? >>>>>>>>> >>>>>>>>> Which version of PyObjC do you use? I guess it's the one >>>>>>>>> included in >>>>>>>>> Leopard, that seems to mis the symbol while PyObjC 2.2 does >>>>>>>>> have it. >>>>>>>>> >>>>>>>>> Adding a new function can be done using >>>>>>>>> objc.loadBundleFunctions: >>>>>>>>> >>>>>>>>> import objc >>>>>>>>> import CoreText >>>>>>>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>>>>>>> ('CTFontCreatePathForGlyph', >>>>>>>>> '@@sn^{CGAffineTransform=ffffff}') >>>>>>>>> ], False) >>>>>>>>> >>>>>>>>> The code above (untested) should add >>>>>>>>> 'CTFontCreatePathForGlyph' to >>>>>>>>> the >>>>>>>>> globals dictionary. >>>>>>>>> >>>>>>>>> Ronald >>>>>>>>>> >>>>>>>>>> Thanks >>>>>>>>>> >>>>>>>>>> -jt >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> ------------------------------------------------------------------------------ >>>>>>>>>> Stay on top of everything new and different, both inside and >>>>>>>>>> around Java (TM) technology - register by April 22, and save >>>>>>>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San >>>>>>>>>> Francisco. >>>>>>>>>> 300 plus technical and hands-on sessions. Register today. >>>>>>>>>> Use priority code J9JMT32. http://p.sf.net/sfu/p >>>>>>>>>> _______________________________________________ >>>>>>>>>> Pyobjc-dev mailing list >>>>>>>>>> Pyo...@li... >>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> ------------------------------------------------------------------------------ >>>>>>>> Stay on top of everything new and different, both inside and >>>>>>>> around >>>>>>>> Java >>>>>>>> (TM) technology - register by April 22, and save >>>>>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San >>>>>>>> Francisco. >>>>>>>> 300 plus technical and hands-on sessions. Register today. Use >>>>>>>> priority >>>>>>>> code J9JMT32. http://p.sf.net/sfu/p >>>>>>>> _______________________________________________ >>>>>>>> Pyobjc-dev mailing list >>>>>>>> Pyo...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>>>> >>>>> >>>>> >>> >>> >> |
From: Greg E. <gre...@ca...> - 2009-04-26 09:19:52
|
PyGUI 2.0.5 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ More bug fixes for various platforms. Still no idea what's causing the "object has been destroyed" error on Windows XP, though. Does this happen for everyone? Is there anyone who *has* got 12-scroll.py working for them on XP? What is PyGUI? -------------- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly Pythonic API. -- Gregory Ewing gre...@ca... http://www.cosc.canterbury.ac.nz/greg.ewing/ |
From: James T. <tra...@gm...> - 2009-04-26 09:01:48
|
Gauging from the fact that this thread has gone stale, Is it safe to assume that this just isn't possible with pyobjc? -jt On Thu, Apr 23, 2009 at 9:17 AM, James Trankelson <tra...@gm...> wrote: > Ok, now using ord: > > v, gl = CTFontGetGlyphsForCharacters(font, ord(u'x'), None, 1) > > Produces: > > TypeError: Expecting UniChar > > -jt > > On Thu, Apr 23, 2009 at 7:43 AM, Ronald Oussoren <ron...@ma...> wrote: >> >> On 23 Apr, 2009, at 0:55, James Trankelson wrote: >> >>> Ok, so in order to do this, I need to install the version in the trunk. >> >> You don't have to install the version in the trunk, if you manually convert >> unicode characters to integers (using "ord", rather than the unichar >> function I mentioned yesterday) >>> >>> I hate to say it, but that's causing me trouble as well... >> >> Phew, I'm glad that didn't work. Please don't install PyObjC 2.2 in the >> system install of Python. There are differences between the current edition >> of PyObjC and the version included in Leoopard and I don't know if those >> changes are backward compatible. That means that installing an updated >> version of PyObjC could break system components (especially on Leopard >> Server). >> >> Sadly enough the version in the trunk isn't ready to be installed by new >> users yet, I need to do some work on packaging (makeing sure that it can be >> installed from source with the Python.org distribution, provide binary >> packages, ...). >> >> Ronald >> >>> >>> $ sudo easy_install pyobjc==2.2b1 >>> >>> Searching for pyobjc==2.2b1 >>> ... >>> Running pyobjc-2.2b1/setup.py -q bdist_egg --dist-dir >>> /tmp/easy_install-_86MCZ/pyobjc-2.2b1/egg-dist-tmp-Q8jX-H >>> The required version of setuptools (>=0.6c9) is not available, and >>> can't be installed while this script is running. Please install >>> a more recent version first, using 'easy_install -U setuptools'. >>> >>> (Currently using setuptools 0.6c7 >>> >>> (/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python)) >>> error: Setup script exited with 2 >>> >>> $ sudo easy_install -U setuptools >>> Searching for setuptools >>> Reading http://pypi.python.org/simple/setuptools/ >>> Best match: setuptools 0.6c9 >>> Processing setuptools-0.6c9-py2.5.egg >>> setuptools 0.6c9 is already the active version in easy-install.pth >>> Installing easy_install script to /usr/local/bin >>> Installing easy_install-2.5 script to /usr/local/bin >>> >>> Using /Library/Python/2.5/site-packages/setuptools-0.6c9-py2.5.egg >>> Processing dependencies for setuptools >>> Finished processing dependencies for setuptools >>> >>> $ sudo easy_install pyobjc==2.2b1 >>> >>> (Same as first try) >>> >>> Is there some config file that will allow me to get this to point to >>> the right setuptools? >>> >>> Thanks again. >>> >>> -jt >>> >>> On Wed, Apr 22, 2009 at 10:29 PM, Ronald Oussoren >>> <ron...@ma...> wrote: >>>> >>>> On 22 Apr, 2009, at 14:38, James Trankelson wrote: >>>> >>>>> Bah. Thanks. Still not quite out of the woods, though. >>>>> >>>>> Now it's not having trouble finding the function >>>>> (CTFontCreatePathForGlyph), but I get a new error: >>>>> >>>>> depythonifying 'short', got 'unicode' of 1 >>>> >>>> I should have mentioned that, the version of pyobjc that's included with >>>> Leopard cannot do what you want it to do. You must pass unichar(u'a')) >>>> instead of u'a'. The reason for that is that "unichar" is an alias for >>>> "short int" in (Objective-)C, both result in the same metadata. >>>> >>>> The version of PyObjC that's in the subversion repository does know the >>>> difference between "unichar" and "unsigned short" using hacks in the >>>> metadata file. >>>> >>>>> >>>>> My usage is nearly identical to an example in cttests.py for obtaining >>>>> a font and getting the Glyph from it: >>>>> >>>>> v, gl = CTFontGetGlyphsForCharacters(font, u'x', None, 1) >>>>> v = CTFontCreatePathForGlyph(font, gl[0], None) >>>>> >>>>> This leads me to wonder if the signature mentioned previously for >>>>> CTFontCreatePathForGlyph was incorrect: >>>>> >>>>> '@@sn^{CGAffineTransform=ffffff}' >>>>> >>>>> Unfortunately, I can't find any documentation on how to map the >>>>> signatures. For someone that knows, is this signature correct? >>>> >>>> The signature is correct. "s" is the encoding for both "short int" and >>>> "unichar". >>>> >>>> Ronald >>>> >>>>> >>>>> Thanks >>>>> >>>>> -jt >>>>> >>>>> >>>>> On Wed, Apr 22, 2009 at 10:19 AM, Petr Mifek >>>>> <pet...@an...> wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>>> James, import CoreText is missing there. >>>>>> >>>>>> Cheers, Petr >>>>>> >>>>>> James Trankelson wrote: >>>>>>> >>>>>>> It seems like some names can't be found. CoreText is one of them. >>>>>>> >>>>>>> from CoreText import * >>>>>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>>>>> ('CTFontCreatePathForGlyph', >>>>>>> '@@sn^{CGAffineTransform=ffffff}') >>>>>>> ], False) >>>>>>> >>>>>>> Produces: NameError: name 'CoreText' is not defined >>>>>>> >>>>>>> I tried manually loading the bundle as follows: >>>>>>> >>>>>>> objc.loadBundle("CoreText", globals(), >>>>>>> >>>>>>> >>>>>>> >>>>>>> bundle_path=objc.pathForFramework(u'/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework')) >>>>>>> >>>>>>> Which also fails. >>>>>>> >>>>>>> -jt >>>>>>> >>>>>>> On Wed, Apr 22, 2009 at 7:22 AM, Ronald Oussoren >>>>>>> <ron...@ma...> >>>>>>> wrote: >>>>>>>> >>>>>>>> On 21 Apr, 2009, at 20:59, James Trankelson wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I'm trying to do some CoreText suff (10.5). Most of the calls are >>>>>>>>> fine, but one fails: >>>>>>>>> >>>>>>>>> global name 'CTFontCreatePathForGlyph' is not defined >>>>>>>>> >>>>>>>>> Is there any way around this? >>>>>>>> >>>>>>>> Which version of PyObjC do you use? I guess it's the one included in >>>>>>>> Leopard, that seems to mis the symbol while PyObjC 2.2 does have it. >>>>>>>> >>>>>>>> Adding a new function can be done using objc.loadBundleFunctions: >>>>>>>> >>>>>>>> import objc >>>>>>>> import CoreText >>>>>>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>>>>>> ('CTFontCreatePathForGlyph', >>>>>>>> '@@sn^{CGAffineTransform=ffffff}') >>>>>>>> ], False) >>>>>>>> >>>>>>>> The code above (untested) should add 'CTFontCreatePathForGlyph' to >>>>>>>> the >>>>>>>> globals dictionary. >>>>>>>> >>>>>>>> Ronald >>>>>>>>> >>>>>>>>> Thanks >>>>>>>>> >>>>>>>>> -jt >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> ------------------------------------------------------------------------------ >>>>>>>>> Stay on top of everything new and different, both inside and >>>>>>>>> around Java (TM) technology - register by April 22, and save >>>>>>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >>>>>>>>> 300 plus technical and hands-on sessions. Register today. >>>>>>>>> Use priority code J9JMT32. http://p.sf.net/sfu/p >>>>>>>>> _______________________________________________ >>>>>>>>> Pyobjc-dev mailing list >>>>>>>>> Pyo...@li... >>>>>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> Stay on top of everything new and different, both inside and around >>>>>>> Java >>>>>>> (TM) technology - register by April 22, and save >>>>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >>>>>>> 300 plus technical and hands-on sessions. Register today. Use priority >>>>>>> code J9JMT32. http://p.sf.net/sfu/p >>>>>>> _______________________________________________ >>>>>>> Pyobjc-dev mailing list >>>>>>> Pyo...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>>> >>>> >>>> >> >> > |
From: Johan R. <joh...@gm...> - 2009-04-24 13:26:26
|
> Could you provide a small self-contained example that shows the problem? I don't mind if I have to download a framework, but at least provide all python code that's needed to reproduce the problem. I'll try to do that when I get a few minutes over, thanks. > What version of PyObjC are you using? Whatever comes with Leopard. > And to answer your latest question: you have to create informal protocol specifications, but only for methods where not all arguments are objects or where the result is not either "void" or an object. The Foundation.protocols module you mention is an example of that, although later versions of PyObjC use an XML based description file. I managed to get everything working just fine by describing the informal protocol by hand, but how do I use an XML file for this? Best Regards, Johan |
From: James R E. <Jam...@lr...> - 2009-04-24 13:01:02
|
And here's the follow-up patch I referred to yesterday. This one modifies parsexml.m to avoid a segfault on malformed typestrings (at least malformed such that the type spec is missing). It also modifies obj/_bridgesupport.py to output a more user-friendly warning. I'm not sure this is necessarily the right approach ... perhaps it would be better to simply ignore invalid signatures instead of the entire module. But at least now the user will see a meaningful error rather than a cryptic segfault when loading frameworks with faulty bridgesupport metadata. Cheers! James |
From: James R E. <Jam...@lr...> - 2009-04-24 12:10:39
|
Hi folks, Here's another patch that corrects some of the PyObjC.bridgesupport 64- bit signatures for pyobjc-framework-Cocoa. It turns out that it was pretty tricky to track down the bogus metadata, since the ProcessXML routine barfs (segfaults) on bogus metadata, leaving relatively little to backtrack. This patch fixes only the faulty bridgesupport metadata (some of the type64 signatures omitted field types (e.g. "param1""param2" instead of "param1"q"param2"^{__CFURL})). It does not correct the segfault that arises from typecode2typecode in parsexml.m. I'll look into that next. |
From: Ronald O. <ron...@ma...> - 2009-04-24 11:42:49
|
Formal protocols should work just fine. Is MGScopeBarController a formal protocol? If you want to create a class that implements the formal protocol you need to do something like this: class MyBar (NSObject, MGScopeBarController): pass Could you provide a small self-contained example that shows the problem? I don't mind if I have to download a framework, but at least provide all python code that's needed to reproduce the problem. What version of PyObjC are you using? And to answer your latest question: you have to create informal protocol specifications, but only for methods where not all arguments are objects or where the result is not either "void" or an object. The Foundation.protocols module you mention is an example of that, although later versions of PyObjC use an XML based description file. Ronald On Friday, April 24, 2009, at 12:14PM, "Johan Rydberg" <joh...@gm...> wrote: >I changed my framework so that it uses informal protocols instead. >Do I have to create informal protocol specifications for PyObjC, like these? > >http://svn.red-bean.com/pyobjc/branches/pyobjc-1.4-branch/Lib/Foundation/protocols.py > >On Thu, Apr 23, 2009 at 11:10 PM, Johan Rydberg <joh...@gm...> wrote: >> I try to implement a format protocol in python. Everything works fine >> as long as my class only >> has methods that are defined by the protocol. When I extend my class >> with something else, >> I get an error: >> >> class MasterListScopeBar(MGScopeBarController): >> objc.internal_error: PyObjCClass_BuildClass: Cannot fetch key in keylist >> >> For example, if I add a awakeFromNib method this happens. >> >> Why is this? >> > >------------------------------------------------------------------------------ >Crystal Reports - New Free Runtime and 30 Day Trial >Check out the new simplified licensign 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 > > |
From: Johan R. <joh...@gm...> - 2009-04-24 10:14:32
|
I changed my framework so that it uses informal protocols instead. Do I have to create informal protocol specifications for PyObjC, like these? http://svn.red-bean.com/pyobjc/branches/pyobjc-1.4-branch/Lib/Foundation/protocols.py On Thu, Apr 23, 2009 at 11:10 PM, Johan Rydberg <joh...@gm...> wrote: > I try to implement a format protocol in python. Everything works fine > as long as my class only > has methods that are defined by the protocol. When I extend my class > with something else, > I get an error: > > class MasterListScopeBar(MGScopeBarController): > objc.internal_error: PyObjCClass_BuildClass: Cannot fetch key in keylist > > For example, if I add a awakeFromNib method this happens. > > Why is this? > |
From: Johan R. <joh...@gm...> - 2009-04-23 21:10:44
|
I try to implement a format protocol in python. Everything works fine as long as my class only has methods that are defined by the protocol. When I extend my class with something else, I get an error: class MasterListScopeBar(MGScopeBarController): objc.internal_error: PyObjCClass_BuildClass: Cannot fetch key in keylist For example, if I add a awakeFromNib method this happens. Why is this? |
From: Johan R. <joh...@gm...> - 2009-04-23 15:14:36
|
To be able to use MG's nice looking implementation of a scope bar I've packaged it like a framework, and hacked up an example on how to use it from PyObjC. The framework can be found here: http://github.com/jrydberg/scopebar/tree/master (Not sure I got the Xcode project setup correctly, since this was my first framework project) A small example on how to use it can be found here: http://github.com/jrydberg/scopebarexample/tree/master BTW, are there any guidelines on how to wrap and distribute Frameworks for PyObjC, esp when it comes to installation? Hope someone finds this useful. Best Regards, Johan |
From: James R E. <Jam...@lr...> - 2009-04-23 12:31:09
|
Hi folks, Here's another patch that corrects some of the PyObjC.bridgesupport 64- bit signatures for pyobjc-framework-Cocoa. It turns out that it was pretty tricky to track down the bogus metadata, since the ProcessXML routine barfs (segfaults) on bogus metadata, leaving relatively little to backtrack. This patch fixes only the faulty bridgesupport metadata (some of the type64 signatures omitted field types (e.g. "param1""param2" instead of "param1"q"param2"^{__CFURL})). It does not correct the segfault that arises from typecode2typecode in parsexml.m. I'll look into that next. |
From: James T. <tra...@gm...> - 2009-04-23 07:17:18
|
Ok, now using ord: v, gl = CTFontGetGlyphsForCharacters(font, ord(u'x'), None, 1) Produces: TypeError: Expecting UniChar -jt On Thu, Apr 23, 2009 at 7:43 AM, Ronald Oussoren <ron...@ma...> wrote: > > On 23 Apr, 2009, at 0:55, James Trankelson wrote: > >> Ok, so in order to do this, I need to install the version in the trunk. > > You don't have to install the version in the trunk, if you manually convert > unicode characters to integers (using "ord", rather than the unichar > function I mentioned yesterday) >> >> I hate to say it, but that's causing me trouble as well... > > Phew, I'm glad that didn't work. Please don't install PyObjC 2.2 in the > system install of Python. There are differences between the current edition > of PyObjC and the version included in Leoopard and I don't know if those > changes are backward compatible. That means that installing an updated > version of PyObjC could break system components (especially on Leopard > Server). > > Sadly enough the version in the trunk isn't ready to be installed by new > users yet, I need to do some work on packaging (makeing sure that it can be > installed from source with the Python.org distribution, provide binary > packages, ...). > > Ronald > >> >> $ sudo easy_install pyobjc==2.2b1 >> >> Searching for pyobjc==2.2b1 >> ... >> Running pyobjc-2.2b1/setup.py -q bdist_egg --dist-dir >> /tmp/easy_install-_86MCZ/pyobjc-2.2b1/egg-dist-tmp-Q8jX-H >> The required version of setuptools (>=0.6c9) is not available, and >> can't be installed while this script is running. Please install >> a more recent version first, using 'easy_install -U setuptools'. >> >> (Currently using setuptools 0.6c7 >> >> (/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python)) >> error: Setup script exited with 2 >> >> $ sudo easy_install -U setuptools >> Searching for setuptools >> Reading http://pypi.python.org/simple/setuptools/ >> Best match: setuptools 0.6c9 >> Processing setuptools-0.6c9-py2.5.egg >> setuptools 0.6c9 is already the active version in easy-install.pth >> Installing easy_install script to /usr/local/bin >> Installing easy_install-2.5 script to /usr/local/bin >> >> Using /Library/Python/2.5/site-packages/setuptools-0.6c9-py2.5.egg >> Processing dependencies for setuptools >> Finished processing dependencies for setuptools >> >> $ sudo easy_install pyobjc==2.2b1 >> >> (Same as first try) >> >> Is there some config file that will allow me to get this to point to >> the right setuptools? >> >> Thanks again. >> >> -jt >> >> On Wed, Apr 22, 2009 at 10:29 PM, Ronald Oussoren >> <ron...@ma...> wrote: >>> >>> On 22 Apr, 2009, at 14:38, James Trankelson wrote: >>> >>>> Bah. Thanks. Still not quite out of the woods, though. >>>> >>>> Now it's not having trouble finding the function >>>> (CTFontCreatePathForGlyph), but I get a new error: >>>> >>>> depythonifying 'short', got 'unicode' of 1 >>> >>> I should have mentioned that, the version of pyobjc that's included with >>> Leopard cannot do what you want it to do. You must pass unichar(u'a')) >>> instead of u'a'. The reason for that is that "unichar" is an alias for >>> "short int" in (Objective-)C, both result in the same metadata. >>> >>> The version of PyObjC that's in the subversion repository does know the >>> difference between "unichar" and "unsigned short" using hacks in the >>> metadata file. >>> >>>> >>>> My usage is nearly identical to an example in cttests.py for obtaining >>>> a font and getting the Glyph from it: >>>> >>>> v, gl = CTFontGetGlyphsForCharacters(font, u'x', None, 1) >>>> v = CTFontCreatePathForGlyph(font, gl[0], None) >>>> >>>> This leads me to wonder if the signature mentioned previously for >>>> CTFontCreatePathForGlyph was incorrect: >>>> >>>> '@@sn^{CGAffineTransform=ffffff}' >>>> >>>> Unfortunately, I can't find any documentation on how to map the >>>> signatures. For someone that knows, is this signature correct? >>> >>> The signature is correct. "s" is the encoding for both "short int" and >>> "unichar". >>> >>> Ronald >>> >>>> >>>> Thanks >>>> >>>> -jt >>>> >>>> >>>> On Wed, Apr 22, 2009 at 10:19 AM, Petr Mifek >>>> <pet...@an...> wrote: >>>>> >>>>> Hi, >>>>> >>>>> James, import CoreText is missing there. >>>>> >>>>> Cheers, Petr >>>>> >>>>> James Trankelson wrote: >>>>>> >>>>>> It seems like some names can't be found. CoreText is one of them. >>>>>> >>>>>> from CoreText import * >>>>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>>>> ('CTFontCreatePathForGlyph', >>>>>> '@@sn^{CGAffineTransform=ffffff}') >>>>>> ], False) >>>>>> >>>>>> Produces: NameError: name 'CoreText' is not defined >>>>>> >>>>>> I tried manually loading the bundle as follows: >>>>>> >>>>>> objc.loadBundle("CoreText", globals(), >>>>>> >>>>>> >>>>>> >>>>>> bundle_path=objc.pathForFramework(u'/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework')) >>>>>> >>>>>> Which also fails. >>>>>> >>>>>> -jt >>>>>> >>>>>> On Wed, Apr 22, 2009 at 7:22 AM, Ronald Oussoren >>>>>> <ron...@ma...> >>>>>> wrote: >>>>>>> >>>>>>> On 21 Apr, 2009, at 20:59, James Trankelson wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I'm trying to do some CoreText suff (10.5). Most of the calls are >>>>>>>> fine, but one fails: >>>>>>>> >>>>>>>> global name 'CTFontCreatePathForGlyph' is not defined >>>>>>>> >>>>>>>> Is there any way around this? >>>>>>> >>>>>>> Which version of PyObjC do you use? I guess it's the one included in >>>>>>> Leopard, that seems to mis the symbol while PyObjC 2.2 does have it. >>>>>>> >>>>>>> Adding a new function can be done using objc.loadBundleFunctions: >>>>>>> >>>>>>> import objc >>>>>>> import CoreText >>>>>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>>>>> ('CTFontCreatePathForGlyph', >>>>>>> '@@sn^{CGAffineTransform=ffffff}') >>>>>>> ], False) >>>>>>> >>>>>>> The code above (untested) should add 'CTFontCreatePathForGlyph' to >>>>>>> the >>>>>>> globals dictionary. >>>>>>> >>>>>>> Ronald >>>>>>>> >>>>>>>> Thanks >>>>>>>> >>>>>>>> -jt >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> ------------------------------------------------------------------------------ >>>>>>>> Stay on top of everything new and different, both inside and >>>>>>>> around Java (TM) technology - register by April 22, and save >>>>>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >>>>>>>> 300 plus technical and hands-on sessions. Register today. >>>>>>>> Use priority code J9JMT32. http://p.sf.net/sfu/p >>>>>>>> _______________________________________________ >>>>>>>> Pyobjc-dev mailing list >>>>>>>> Pyo...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Stay on top of everything new and different, both inside and around >>>>>> Java >>>>>> (TM) technology - register by April 22, and save >>>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >>>>>> 300 plus technical and hands-on sessions. Register today. Use priority >>>>>> code J9JMT32. http://p.sf.net/sfu/p >>>>>> _______________________________________________ >>>>>> Pyobjc-dev mailing list >>>>>> Pyo...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>> >>> >>> > > |
From: Ronald O. <ron...@ma...> - 2009-04-23 05:44:20
|
On 23 Apr, 2009, at 0:55, James Trankelson wrote: > Ok, so in order to do this, I need to install the version in the > trunk. You don't have to install the version in the trunk, if you manually convert unicode characters to integers (using "ord", rather than the unichar function I mentioned yesterday) > > I hate to say it, but that's causing me trouble as well... Phew, I'm glad that didn't work. Please don't install PyObjC 2.2 in the system install of Python. There are differences between the current edition of PyObjC and the version included in Leoopard and I don't know if those changes are backward compatible. That means that installing an updated version of PyObjC could break system components (especially on Leopard Server). Sadly enough the version in the trunk isn't ready to be installed by new users yet, I need to do some work on packaging (makeing sure that it can be installed from source with the Python.org distribution, provide binary packages, ...). Ronald > > $ sudo easy_install pyobjc==2.2b1 > > Searching for pyobjc==2.2b1 > ... > Running pyobjc-2.2b1/setup.py -q bdist_egg --dist-dir > /tmp/easy_install-_86MCZ/pyobjc-2.2b1/egg-dist-tmp-Q8jX-H > The required version of setuptools (>=0.6c9) is not available, and > can't be installed while this script is running. Please install > a more recent version first, using 'easy_install -U setuptools'. > > (Currently using setuptools 0.6c7 > (/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/ > python)) > error: Setup script exited with 2 > > $ sudo easy_install -U setuptools > Searching for setuptools > Reading http://pypi.python.org/simple/setuptools/ > Best match: setuptools 0.6c9 > Processing setuptools-0.6c9-py2.5.egg > setuptools 0.6c9 is already the active version in easy-install.pth > Installing easy_install script to /usr/local/bin > Installing easy_install-2.5 script to /usr/local/bin > > Using /Library/Python/2.5/site-packages/setuptools-0.6c9-py2.5.egg > Processing dependencies for setuptools > Finished processing dependencies for setuptools > > $ sudo easy_install pyobjc==2.2b1 > > (Same as first try) > > Is there some config file that will allow me to get this to point to > the right setuptools? > > Thanks again. > > -jt > > On Wed, Apr 22, 2009 at 10:29 PM, Ronald Oussoren > <ron...@ma...> wrote: >> >> On 22 Apr, 2009, at 14:38, James Trankelson wrote: >> >>> Bah. Thanks. Still not quite out of the woods, though. >>> >>> Now it's not having trouble finding the function >>> (CTFontCreatePathForGlyph), but I get a new error: >>> >>> depythonifying 'short', got 'unicode' of 1 >> >> I should have mentioned that, the version of pyobjc that's included >> with >> Leopard cannot do what you want it to do. You must pass >> unichar(u'a')) >> instead of u'a'. The reason for that is that "unichar" is an alias >> for >> "short int" in (Objective-)C, both result in the same metadata. >> >> The version of PyObjC that's in the subversion repository does know >> the >> difference between "unichar" and "unsigned short" using hacks in the >> metadata file. >> >>> >>> My usage is nearly identical to an example in cttests.py for >>> obtaining >>> a font and getting the Glyph from it: >>> >>> v, gl = CTFontGetGlyphsForCharacters(font, u'x', None, 1) >>> v = CTFontCreatePathForGlyph(font, gl[0], None) >>> >>> This leads me to wonder if the signature mentioned previously for >>> CTFontCreatePathForGlyph was incorrect: >>> >>> '@@sn^{CGAffineTransform=ffffff}' >>> >>> Unfortunately, I can't find any documentation on how to map the >>> signatures. For someone that knows, is this signature correct? >> >> The signature is correct. "s" is the encoding for both "short int" >> and >> "unichar". >> >> Ronald >> >>> >>> Thanks >>> >>> -jt >>> >>> >>> On Wed, Apr 22, 2009 at 10:19 AM, Petr Mifek >>> <pet...@an...> wrote: >>>> >>>> Hi, >>>> >>>> James, import CoreText is missing there. >>>> >>>> Cheers, Petr >>>> >>>> James Trankelson wrote: >>>>> >>>>> It seems like some names can't be found. CoreText is one of them. >>>>> >>>>> from CoreText import * >>>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>>> ('CTFontCreatePathForGlyph', >>>>> '@@sn^{CGAffineTransform=ffffff}') >>>>> ], False) >>>>> >>>>> Produces: NameError: name 'CoreText' is not defined >>>>> >>>>> I tried manually loading the bundle as follows: >>>>> >>>>> objc.loadBundle("CoreText", globals(), >>>>> >>>>> >>>>> bundle_path=objc.pathForFramework(u'/Developer/SDKs/ >>>>> MacOSX10.5.sdk/System/Library/Frameworks/ >>>>> ApplicationServices.framework/Versions/A/Frameworks/ >>>>> CoreText.framework')) >>>>> >>>>> Which also fails. >>>>> >>>>> -jt >>>>> >>>>> On Wed, Apr 22, 2009 at 7:22 AM, Ronald Oussoren >>>>> <ron...@ma...> >>>>> wrote: >>>>>> >>>>>> On 21 Apr, 2009, at 20:59, James Trankelson wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I'm trying to do some CoreText suff (10.5). Most of the calls >>>>>>> are >>>>>>> fine, but one fails: >>>>>>> >>>>>>> global name 'CTFontCreatePathForGlyph' is not defined >>>>>>> >>>>>>> Is there any way around this? >>>>>> >>>>>> Which version of PyObjC do you use? I guess it's the one >>>>>> included in >>>>>> Leopard, that seems to mis the symbol while PyObjC 2.2 does >>>>>> have it. >>>>>> >>>>>> Adding a new function can be done using objc.loadBundleFunctions: >>>>>> >>>>>> import objc >>>>>> import CoreText >>>>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>>>> ('CTFontCreatePathForGlyph', >>>>>> '@@sn^{CGAffineTransform=ffffff}') >>>>>> ], False) >>>>>> >>>>>> The code above (untested) should add 'CTFontCreatePathForGlyph' >>>>>> to the >>>>>> globals dictionary. >>>>>> >>>>>> Ronald >>>>>>> >>>>>>> Thanks >>>>>>> >>>>>>> -jt >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> Stay on top of everything new and different, both inside and >>>>>>> around Java (TM) technology - register by April 22, and save >>>>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San >>>>>>> Francisco. >>>>>>> 300 plus technical and hands-on sessions. Register today. >>>>>>> Use priority code J9JMT32. http://p.sf.net/sfu/p >>>>>>> _______________________________________________ >>>>>>> Pyobjc-dev mailing list >>>>>>> Pyo...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Stay on top of everything new and different, both inside and >>>>> around Java >>>>> (TM) technology - register by April 22, and save >>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San >>>>> Francisco. >>>>> 300 plus technical and hands-on sessions. Register today. Use >>>>> priority >>>>> code J9JMT32. http://p.sf.net/sfu/p >>>>> _______________________________________________ >>>>> Pyobjc-dev mailing list >>>>> Pyo...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>> >> >> |
From: James T. <tra...@gm...> - 2009-04-22 22:56:08
|
Ok, so in order to do this, I need to install the version in the trunk. I hate to say it, but that's causing me trouble as well... $ sudo easy_install pyobjc==2.2b1 Searching for pyobjc==2.2b1 ... Running pyobjc-2.2b1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_86MCZ/pyobjc-2.2b1/egg-dist-tmp-Q8jX-H The required version of setuptools (>=0.6c9) is not available, and can't be installed while this script is running. Please install a more recent version first, using 'easy_install -U setuptools'. (Currently using setuptools 0.6c7 (/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python)) error: Setup script exited with 2 $ sudo easy_install -U setuptools Searching for setuptools Reading http://pypi.python.org/simple/setuptools/ Best match: setuptools 0.6c9 Processing setuptools-0.6c9-py2.5.egg setuptools 0.6c9 is already the active version in easy-install.pth Installing easy_install script to /usr/local/bin Installing easy_install-2.5 script to /usr/local/bin Using /Library/Python/2.5/site-packages/setuptools-0.6c9-py2.5.egg Processing dependencies for setuptools Finished processing dependencies for setuptools $ sudo easy_install pyobjc==2.2b1 (Same as first try) Is there some config file that will allow me to get this to point to the right setuptools? Thanks again. -jt On Wed, Apr 22, 2009 at 10:29 PM, Ronald Oussoren <ron...@ma...> wrote: > > On 22 Apr, 2009, at 14:38, James Trankelson wrote: > >> Bah. Thanks. Still not quite out of the woods, though. >> >> Now it's not having trouble finding the function >> (CTFontCreatePathForGlyph), but I get a new error: >> >> depythonifying 'short', got 'unicode' of 1 > > I should have mentioned that, the version of pyobjc that's included with > Leopard cannot do what you want it to do. You must pass unichar(u'a')) > instead of u'a'. The reason for that is that "unichar" is an alias for > "short int" in (Objective-)C, both result in the same metadata. > > The version of PyObjC that's in the subversion repository does know the > difference between "unichar" and "unsigned short" using hacks in the > metadata file. > >> >> My usage is nearly identical to an example in cttests.py for obtaining >> a font and getting the Glyph from it: >> >> v, gl = CTFontGetGlyphsForCharacters(font, u'x', None, 1) >> v = CTFontCreatePathForGlyph(font, gl[0], None) >> >> This leads me to wonder if the signature mentioned previously for >> CTFontCreatePathForGlyph was incorrect: >> >> '@@sn^{CGAffineTransform=ffffff}' >> >> Unfortunately, I can't find any documentation on how to map the >> signatures. For someone that knows, is this signature correct? > > The signature is correct. "s" is the encoding for both "short int" and > "unichar". > > Ronald > >> >> Thanks >> >> -jt >> >> >> On Wed, Apr 22, 2009 at 10:19 AM, Petr Mifek >> <pet...@an...> wrote: >>> >>> Hi, >>> >>> James, import CoreText is missing there. >>> >>> Cheers, Petr >>> >>> James Trankelson wrote: >>>> >>>> It seems like some names can't be found. CoreText is one of them. >>>> >>>> from CoreText import * >>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>> ('CTFontCreatePathForGlyph', >>>> '@@sn^{CGAffineTransform=ffffff}') >>>> ], False) >>>> >>>> Produces: NameError: name 'CoreText' is not defined >>>> >>>> I tried manually loading the bundle as follows: >>>> >>>> objc.loadBundle("CoreText", globals(), >>>> >>>> >>>> bundle_path=objc.pathForFramework(u'/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework')) >>>> >>>> Which also fails. >>>> >>>> -jt >>>> >>>> On Wed, Apr 22, 2009 at 7:22 AM, Ronald Oussoren >>>> <ron...@ma...> >>>> wrote: >>>>> >>>>> On 21 Apr, 2009, at 20:59, James Trankelson wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I'm trying to do some CoreText suff (10.5). Most of the calls are >>>>>> fine, but one fails: >>>>>> >>>>>> global name 'CTFontCreatePathForGlyph' is not defined >>>>>> >>>>>> Is there any way around this? >>>>> >>>>> Which version of PyObjC do you use? I guess it's the one included in >>>>> Leopard, that seems to mis the symbol while PyObjC 2.2 does have it. >>>>> >>>>> Adding a new function can be done using objc.loadBundleFunctions: >>>>> >>>>> import objc >>>>> import CoreText >>>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>>> ('CTFontCreatePathForGlyph', >>>>> '@@sn^{CGAffineTransform=ffffff}') >>>>> ], False) >>>>> >>>>> The code above (untested) should add 'CTFontCreatePathForGlyph' to the >>>>> globals dictionary. >>>>> >>>>> Ronald >>>>>> >>>>>> Thanks >>>>>> >>>>>> -jt >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Stay on top of everything new and different, both inside and >>>>>> around Java (TM) technology - register by April 22, and save >>>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >>>>>> 300 plus technical and hands-on sessions. Register today. >>>>>> Use priority code J9JMT32. http://p.sf.net/sfu/p >>>>>> _______________________________________________ >>>>>> Pyobjc-dev mailing list >>>>>> Pyo...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Stay on top of everything new and different, both inside and around Java >>>> (TM) technology - register by April 22, and save >>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >>>> 300 plus technical and hands-on sessions. Register today. Use priority >>>> code J9JMT32. http://p.sf.net/sfu/p >>>> _______________________________________________ >>>> Pyobjc-dev mailing list >>>> Pyo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>> > > |
From: Ronald O. <ron...@ma...> - 2009-04-22 20:29:55
|
On 22 Apr, 2009, at 14:38, James Trankelson wrote: > Bah. Thanks. Still not quite out of the woods, though. > > Now it's not having trouble finding the function > (CTFontCreatePathForGlyph), but I get a new error: > > depythonifying 'short', got 'unicode' of 1 I should have mentioned that, the version of pyobjc that's included with Leopard cannot do what you want it to do. You must pass unichar(u'a')) instead of u'a'. The reason for that is that "unichar" is an alias for "short int" in (Objective-)C, both result in the same metadata. The version of PyObjC that's in the subversion repository does know the difference between "unichar" and "unsigned short" using hacks in the metadata file. > > My usage is nearly identical to an example in cttests.py for obtaining > a font and getting the Glyph from it: > > v, gl = CTFontGetGlyphsForCharacters(font, u'x', None, 1) > v = CTFontCreatePathForGlyph(font, gl[0], None) > > This leads me to wonder if the signature mentioned previously for > CTFontCreatePathForGlyph was incorrect: > > '@@sn^{CGAffineTransform=ffffff}' > > Unfortunately, I can't find any documentation on how to map the > signatures. For someone that knows, is this signature correct? The signature is correct. "s" is the encoding for both "short int" and "unichar". Ronald > > Thanks > > -jt > > > On Wed, Apr 22, 2009 at 10:19 AM, Petr Mifek > <pet...@an...> wrote: >> Hi, >> >> James, import CoreText is missing there. >> >> Cheers, Petr >> >> James Trankelson wrote: >>> >>> It seems like some names can't be found. CoreText is one of them. >>> >>> from CoreText import * >>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>> ('CTFontCreatePathForGlyph', >>> '@@sn^{CGAffineTransform=ffffff}') >>> ], False) >>> >>> Produces: NameError: name 'CoreText' is not defined >>> >>> I tried manually loading the bundle as follows: >>> >>> objc.loadBundle("CoreText", globals(), >>> >>> bundle_path=objc.pathForFramework(u'/Developer/SDKs/MacOSX10.5.sdk/ >>> System/Library/Frameworks/ApplicationServices.framework/Versions/A/ >>> Frameworks/CoreText.framework')) >>> >>> Which also fails. >>> >>> -jt >>> >>> On Wed, Apr 22, 2009 at 7:22 AM, Ronald Oussoren <ron...@ma... >>> > >>> wrote: >>>> >>>> On 21 Apr, 2009, at 20:59, James Trankelson wrote: >>>> >>>>> Hi, >>>>> >>>>> I'm trying to do some CoreText suff (10.5). Most of the calls are >>>>> fine, but one fails: >>>>> >>>>> global name 'CTFontCreatePathForGlyph' is not defined >>>>> >>>>> Is there any way around this? >>>> >>>> Which version of PyObjC do you use? I guess it's the one included >>>> in >>>> Leopard, that seems to mis the symbol while PyObjC 2.2 does have >>>> it. >>>> >>>> Adding a new function can be done using objc.loadBundleFunctions: >>>> >>>> import objc >>>> import CoreText >>>> objc.loadBundleFunctions(CoreText.__bundle__, globals(), [ >>>> ('CTFontCreatePathForGlyph', >>>> '@@sn^{CGAffineTransform=ffffff}') >>>> ], False) >>>> >>>> The code above (untested) should add 'CTFontCreatePathForGlyph' >>>> to the >>>> globals dictionary. >>>> >>>> Ronald >>>>> >>>>> Thanks >>>>> >>>>> -jt >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Stay on top of everything new and different, both inside and >>>>> around Java (TM) technology - register by April 22, and save >>>>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San >>>>> Francisco. >>>>> 300 plus technical and hands-on sessions. Register today. >>>>> Use priority code J9JMT32. http://p.sf.net/sfu/p >>>>> _______________________________________________ >>>>> Pyobjc-dev mailing list >>>>> Pyo...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Stay on top of everything new and different, both inside and >>> around Java >>> (TM) technology - register by April 22, and save >>> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >>> 300 plus technical and hands-on sessions. Register today. Use >>> priority >>> code J9JMT32. http://p.sf.net/sfu/p >>> _______________________________________________ >>> Pyobjc-dev mailing list >>> Pyo...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >> |