Thread: [Pyobjc-dev] NSGraphicsContext.graphicsPort() prints debugging message
Brought to you by:
ronaldoussoren
From: Greg E. <gre...@ca...> - 2010-12-16 05:51:51
|
Every time NSGraphicsContext.graphicsPort() is called, I get a message like this: 2010-12-16 18:49:28.865 Python[210:607] PyObjCPointer created: at 0x395ded0 of type {CGContext=} Is there any way of turning these messages off? I'm finding them annoying. -- Greg |
From: Ronald O. <ron...@ma...> - 2010-12-21 08:25:20
Attachments:
smime.p7s
|
On 16 Dec, 2010, at 6:51, Greg Ewing wrote: > Every time NSGraphicsContext.graphicsPort() is called, I get > a message like this: > > 2010-12-16 18:49:28.865 Python[210:607] PyObjCPointer created: at 0x395ded0 of > type {CGContext=} > > Is there any way of turning these messages off? I'm finding > them annoying. They are printed because creating PyObjCPointers is a bug. The print should go away when you add "import Quartz" somewhere in your program before you call the graphicsPort method (because that way PyObjC knows that it needs to create a CGContext object instead of a generic pointer). Ronald > > -- > Greg > > ------------------------------------------------------------------------------ > Lotusphere 2011 > Register now for Lotusphere 2011 and learn how > to connect the dots, take your collaborative environment > to the next level, and enter the era of Social Business. > http://p.sf.net/sfu/lotusphere-d2d > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |
From: Scott H. <sco...@gm...> - 2011-01-30 06:44:51
|
Have the Xcode template changed recently? I'm getting new errors when I try the pyobjc Xcode templates I had installed some time ago. Xcode ver 3.2.5 I have to remove PPC architectures form the project setting to get it to compile and then I get the console output below. Any ideas? Thanks, -Scott Traceback (most recent call last): File "main.py", line 10, in <module> import objc ImportError: No module named objc 2011-01-29 23:43:00.279 junl[57821:a0f] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '/Users/scott/Development/junl/main.m:44 main() PyRun_SimpleFile failed with file '/Users/scott/Development/junl/build/Debug/junl.app/Contents/Resources/main.py'. See console for errors.' *** Call stack at first throw: ( 0 CoreFoundation 0x963ac6ba __raiseError + 410 1 libobjc.A.dylib 0x9543e509 objc_exception_throw + 56 2 CoreFoundation 0x963ac3e8 +[NSException raise:format:arguments:] + 136 3 CoreFoundation 0x963ac35a +[NSException raise:format:] + 58 4 junl 0x00002c76 main + 1032 5 junl 0x00002842 start + 54 6 ??? 0x00000001 0x0 + 1 ) |
From: Scott H. <sco...@gm...> - 2011-01-30 20:38:52
|
I'm trying to compile and run the graphlaughs example from big nerd ranch. http://weblog.bignerdranch.com/?p=19 However, when I build the project they setup.py script fails here: from PyObjCTools import XcodeSupport Has this gone away? Why? Also, I've noticed that older PyObjC projects tended to follow the pattern of starting up via python and now the XCode templates have a main.m that instantiates a python interpreter and loads the .py files. 1. Why did things change? 2. What's the easiest way modify the graph laughs example and get it up and running? Have the changes to PyObjC made its approach outdated? Thanks, -Scott |
From: Scott H. <sco...@gm...> - 2011-01-30 08:15:18
|
OK, I found python2.7 in /Library/Frameworks and I got rid of that. Now the Xcode template is working, but it's choosing python2.5.4 How do I control which python the Xcode template picks to run my code? I want it to use the Apple supplied 2.6 version. Thanks, -Scott On Jan 30, 2011, at 1:03 AM, Scott Harris wrote: > I think the issue is that something has changed in Xcode. I've explicitly made the main.m in the template call python2.6. > > It used to work with all the apple supplied stuff , so I don't want to install new stuff to confuse the debugging. > > So it is running python 2.7 even though I explicitly put this in main.m: > > Py_SetProgramName("/usr/bin/python2.6"); > > Where is Xcode picking 2.7 up from? > > -Scott > On Jan 30, 2011, at 12:35 AM, Jair Gaxiola wrote: > >> On Sun, Jan 30, 2011 at 1:10 AM, Scott Harris <sco...@gm...> wrote: >>> Yes. pyobjc is found when I run python from the terminal. I'm using the Apple supplied pyobj and python. >>> >> >> Ok, check python version uses in terminal and xcode is the same. Try >> install pyobjc from easy_install. >> >> -- >> SIN ETIQUETAS.[ PUNTO ] >> http://flavors.me/jyr >> http://pythoncocoa.com >> http://opentumblr.com > |
From: Ronald O. <ron...@ma...> - 2011-02-01 16:32:50
|
On 30 Jan, 2011, at 9:15, Scott Harris wrote: > OK, I found python2.7 in /Library/Frameworks and I got rid of that. Now the Xcode template is working, but it's choosing python2.5.4 > > How do I control which python the Xcode template picks to run my code? I want it to use the Apple supplied 2.6 version. You cannot control which framework is used by the Xcode templates other than by installing or removing frameworks. The templates should pick whichever framework gets used when you link with '-framework Python'. This is suboptimal, there really should be an option somewhere that can be used to explicitly select a Python. I haven't looked at the xcode templates for a long time because working on them is an experience that is not much better than just banging my head against a wall: the templates are text-ish files (undocumented format) with some markers in them and Apple doesn't provide tools that make it easier to work on templates. Ronald |
From: Ronald O. <ron...@ma...> - 2011-02-01 16:38:21
|
On 30 Jan, 2011, at 21:38, Scott Harris wrote: > I'm trying to compile and run the graphlaughs example from big nerd ranch. > > http://weblog.bignerdranch.com/?p=19 > > However, when I build the project they setup.py script fails here: > > from PyObjCTools import XcodeSupport > > Has this gone away? Why? > > Also, I've noticed that older PyObjC projects tended to follow the pattern of starting up via python and > now the XCode templates have a main.m that instantiates a python interpreter and loads the .py files. > > 1. Why did things change? Xcode's code completion and other tools don't work when the project doesn't have an Objective-C file in it. > 2. What's the easiest way modify the graph laughs example and get it up and running? Have the changes to PyObjC made its approach > outdated? The link to that example doesn't work for me right now. That said, I tend to use py2app to create application bundles and don't use Xcode for Python development at all because for a Python developer Xcode is just a basic editor with a lot of junk (said junk is very usefull when writing Objective-C, but most tools in Xcode don't understand code that isn't [Objective-]C[++] Ronald |