From kevino at theolliviers.com Tue May 2 06:38:09 2006 From: kevino at theolliviers.com (Kevin Ollivier) Date: Mon, 1 May 2006 21:38:09 -0700 Subject: [Pythonmac-SIG] wxPython OS X Universal Binaries RC2 Message-ID: <2163567A-5B7E-48A2-AB56-901D37C519BF@theolliviers.com> Hi all, I've posted a new RC that should fix the issues reported so far. The new version can be downloaded from here: http://www.wxpython.org/download.php Kevin From ronaldoussoren at mac.com Tue May 2 23:45:28 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 2 May 2006 14:45:28 -0700 Subject: [Pythonmac-SIG] [OT] test, please ignore Message-ID: Please ignore this mail. I'm having errors posting using my .mac account, this is to check if this DNS flakeyness is to be blamed. Ronald From daniellord at mac.com Wed May 3 00:47:25 2006 From: daniellord at mac.com (Daniel Lord) Date: Tue, 2 May 2006 15:47:25 -0700 Subject: [Pythonmac-SIG] [OT] test, please ignore In-Reply-To: References: Message-ID: <7A03B2FC-BD1B-4ACD-A8E0-E7BD1A0F8C0E@mac.com> I got a bounce from my .mac account as well. But only one, others went through. I might have been temporary. On May 2, 2006, at 14:45, Ronald Oussoren wrote: > Please ignore this mail. I'm having errors posting using my .mac > account, this is to check if this DNS flakeyness is to be blamed. > > Ronald > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig Daniel Lord daniellord at mac.com --- "You will never regret getting up too early, and you'll always regret getting up too late, but sometimes you may regret giving up too late." -- Mountaineer's Adage From cwmoad at gmail.com Thu May 4 04:09:26 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Wed, 3 May 2006 22:09:26 -0400 Subject: [Pythonmac-SIG] Matplotlib Universal Package Message-ID: <6382066a0605031909y68721928t41c983f9541c3910@mail.gmail.com> I posted a universal build of matplotlib 0.87.2 on sourceforge in egg and mpkg format. It is compiled against the latest numarray, numpy, and Numeric as well as Tk and the new wxPython-rc2 universal. Libpng and freetype2 are statically linked in. Please post or link to either/both at "http://pythonmac.org/packages/py24-fat/". http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 Thanks, Charlie From saggau at gmail.com Thu May 4 23:47:52 2006 From: saggau at gmail.com (Saggau) Date: Thu, 4 May 2006 17:47:52 -0400 Subject: [Pythonmac-SIG] I think I just ate a Zombie Message-ID: (((Disclaimer: I'm cross-posting this to the pyobjc-dev list and the pythonmac-sig list. Normally, I wouldn't do such a thing because I know how annoying that can be. In this case, it seems at least OK. I had asked some questions about this problem on the pyobjc-dev list a couple of months ago and then switched to pestering the pythonmac-sig list about it due to the higher traffic there. Thanks to everyone (Bob!) who offered suggestions.))) Well, I think I've figured out some part of my little NSZombie problem. Bind an NSPopubButton (contents) to a Python List object that is an attribute of a python class placed in an NSArray controlled by an NSArrayController and the OC_PythonArray object from PyObjC corresponding to the Python List gets freed too early. (There's a mouthful... Confusing enough?) Wrap that Python List object in an NSArray.alloc().initWithArray_copyItems_([u'the', u'list'], objc.NO) and (I guess) the NSArray...init... adds one more -retain than does OC_PythonArray and the binding doesn't break. http://jonathansaggau.com/breakPyObjC.tar.gz is the simplest example of the bug I can muster. Set BREAKME = True in testObj.py. Run the app in the debugger (breakpoint is set on -[NSZombie retain] and NSZombie is enabled already in the project) and you'll see what happens when you hit the plus button twice. Set BREAKME = False, rebuild, and everybody is happy. I'm always nervous to call things like this a bug because maybe I'm not *supposed* to be able to do what I'm trying to do in the way that I'm trying to do it, but this one looks like a bug to me. What did I learn from this: 1. Try to use cocoa objects instead of python objects in code that uses bindings; pay special attention to collections (lists, etc.). At least this *seems* safer because a python object being referenced from cocoa is probably more likely to cause problems than a cocoa object controlled from python. (?) Then again, it's pretty stupid to generalize from one experience... 2. GDB is very useful for debugging pyobjc. 3. There are a lot of nice pyobjc debugging features, but you have to turn them on (See my example project referenced above). Things I want to know: 1. Is there a way, when one gets the memory address of a pyobjc proxy object (Like OC_PythonArray) from gdb to figure out which python object it's proxying? 2. Is there a way to get the python object from a memory address? 3. Is there a reliable way to get (in gdb or pdb) the "Python List Object at 0x03423blahblahblah information from the python object being proxied? 4. Can I compile pyobjc with debugging symbols? GDB without them hurts my brain. Cheers, Jonathan Saggau -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060504/06655618/attachment.html From ronaldoussoren at mac.com Fri May 5 00:25:19 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 4 May 2006 15:25:19 -0700 Subject: [Pythonmac-SIG] I think I just ate a Zombie In-Reply-To: References: Message-ID: On 4-mei-2006, at 14:47, Saggau wrote: I haven't look at your example just yet, will do that later on. I'm happy you took the time to create a small program that demonstrates the problem you're seeing, that makes is so much easier to search the problem. > What did I learn from this: > > 1. Try to use cocoa objects instead of python objects in code that > uses bindings; pay special attention to collections (lists, etc.). > At least this *seems* safer because a python object being > referenced from cocoa is probably more likely to cause problems > than a cocoa object controlled from python. (?) Then again, it's > pretty stupid to generalize from one experience... Using Cocoa datastructures instead of python ones when KVO is involved is always a good idea. Python doesn't have enough hooks to allow reliable interception __setitem__. We could (but don't) get 95% of the way by using the same class-swiffling technique as used by the ObjC runtime, but could never go all the way. > 2. GDB is very useful for debugging pyobjc. > 3. There are a lot of nice pyobjc debugging features, but you have > to turn them on (See my example project referenced above). > > Things I want to know: > 1. Is there a way, when one gets the memory address of a pyobjc > proxy object (Like OC_PythonArray) from gdb to figure out which > python object it's proxying? The PyObject* is stored as the instance variable 'value' on the proxy object. > 2. Is there a way to get the python object from a memory address? You mean like "(PyObject*)0xDEADBEEF"? > 3. Is there a reliable way to get (in gdb or pdb) the "Python List > Object at 0x03423blahblahblah information from the python object > being proxied > 4. Can I compile pyobjc with debugging symbols? GDB without them > hurts my brain. PyObjC is compiled with debugging symbols by default. Py2app strips debugging symbols, unless you build with the -A flag. Ronald > Cheers, > Jonathan Saggau > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From lists at mostrom.pp.se Sat May 6 21:35:11 2006 From: lists at mostrom.pp.se (=?UTF-8?Q?Jan_Erik_Mostr=C3=B6?= =?UTF-8?Q?m?=) Date: Sat, 6 May 2006 21:35:11 +0200 Subject: [Pythonmac-SIG] I don't understand Message-ID: I was playing with appscript and created a script and everything worked just fine when I ran it from within BBEdit. Then I moved it to its proper place and tried to use it from the command line, didn't work, it didn't understand the "import" command (unknown command). I started to cut down on the code and ended up with --------------------------------- #!/usr/local/bin/pythonw print 'hello world' --------------------------------- > ./test.py ./test.py: line 3: print: command not found Hmmmmm, I changed to script to --------------------------------- #!/usr/local/bin/python print 'hello world' --------------------------------- > ./test.py hello world The first script still works from BBEdit, so I tried launching pythonw from the command line: > pythonw Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> print 'Hello world' Hello world >>> I don't understand ... what am I missing? -- Jan Erik Mostr?m, www.mostrom.pp.se From bob at redivi.com Sat May 6 21:53:07 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 6 May 2006 12:53:07 -0700 Subject: [Pythonmac-SIG] I don't understand In-Reply-To: References: Message-ID: <3C8BEDE1-41AE-42D1-9648-0168AE5D0F92@redivi.com> On May 6, 2006, at 12:35 PM, Jan Erik Mostr?m wrote: > I was playing with appscript and created a script and everything > worked just > fine when I ran it from within BBEdit. Then I moved it to its > proper place > and tried to use it from the command line, didn't work, it didn't > understand > the "import" command (unknown command). > > I started to cut down on the code and ended up with > --------------------------------- > #!/usr/local/bin/pythonw > > print 'hello world' > --------------------------------- > >> ./test.py > ./test.py: line 3: print: command not found You need to upgrade to Universal Python, or use /usr/bin/env in your #! line. -bob From lists at mostrom.pp.se Sat May 6 21:57:14 2006 From: lists at mostrom.pp.se (=?UTF-8?Q?Jan_Erik_Mostr=C3=B6?= =?UTF-8?Q?m?=) Date: Sat, 6 May 2006 21:57:14 +0200 Subject: [Pythonmac-SIG] I don't understand In-Reply-To: <3C8BEDE1-41AE-42D1-9648-0168AE5D0F92@redivi.com> Message-ID: Bob Ippolito 2006-05-06 21:53: > You need to upgrade to Universal Python, or use /usr/bin/env in your > #! line. Yep, that seems to work. Can you explain why? jem -- Jan Erik Mostr?m, www.mostrom.pp.se From lists at mostrom.pp.se Sat May 6 21:57:41 2006 From: lists at mostrom.pp.se (=?UTF-8?Q?Jan_Erik_Mostr=C3=B6?= =?UTF-8?Q?m?=) Date: Sat, 6 May 2006 21:57:41 +0200 Subject: [Pythonmac-SIG] I don't understand In-Reply-To: <3C8BEDE1-41AE-42D1-9648-0168AE5D0F92@redivi.com> Message-ID: Bob Ippolito 2006-05-06 21:53: > You need to upgrade to Universal Python, or use /usr/bin/env in your > #! line. I mean the search path seems OK etc jem -- Jan Erik Mostr?m, www.mostrom.pp.se From bob at redivi.com Sun May 7 00:07:00 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 6 May 2006 15:07:00 -0700 Subject: [Pythonmac-SIG] I don't understand In-Reply-To: References: Message-ID: On May 6, 2006, at 12:57 PM, Jan Erik Mostr?m wrote: > Bob Ippolito 2006-05-06 21:53: > >> You need to upgrade to Universal Python, or use /usr/bin/env in your >> #! line. > > Yep, that seems to work. Can you explain why? Universal Python replaces pythonw (and python) with a small executable that does what the old pythonw used to (execve a python interpreter that lives inside of an application bundle). That means pythonw is irrelevant as of Universal Python, because either way you start it you'll be able to run GUI stuff. The reason you can't use the old pythonw in a #! line is because it's a shell script and for whatever reason you can't use a shell script as the target for a #! line in Mac OS X. -bob From alex at tweedly.net Mon May 8 00:28:37 2006 From: alex at tweedly.net (Alex Tweedly) Date: Sun, 07 May 2006 23:28:37 +0100 Subject: [Pythonmac-SIG] [Pythoncard-users] Re: Python based apps woes on MacOs X (was :Re: [Pythoncard-users] Re: PythonCard on OS X 10.4 with Python 2.4.1) In-Reply-To: <9af4f4e1ffc20033eaa856d3373d41c7@semi-retired.com> References: <4319994A.603@tweedly.net> <7B3D1657-A9B2-4BD3-B2F0-41C631AD0EF2@mac.com> <431AD610.7040109@tweedly.net> <9af4f4e1ffc20033eaa856d3373d41c7@semi-retired.com> Message-ID: <445E7495.1000700@tweedly.net> [It's not often you get to reply to a thread that's 8 months old ] Kevin Altis wrote: > Alex Tweedlt said: > >> Thanks again for that. (Not quite was I was hoping for :-), but very >> valuable info). >> >> So we now know this simplest case works as expected - and the rather >> complex case within PythonCard doesn't. >> >> It should be straightforward (if somewhat tedious) to narrow down the >> differences until we find where the difference is. But that's not the >> kind of debugging we can do via email on a list (or two!!), so I'm >> hoping a PythonCard / Mac user can take it from there (or will >> contact me off-list and we can work on narrowing it down). > I finally bought my own Mac, but by then I had forgotten this problem (or assumed it had gone away). Today I upgraded to Python 2.4 and ran into the problem myself - and now I'm in a position to track it down. > > I expect the problem has to do with relative paths. For some reason > Python 2.4.1 is behaving different from 2.3 on the Mac as well as > 2.3.x and 2.4.x versions on Windows and Linux. The reason why > PythonCard tickles this problem is likely due to one or more lines in > model.py. In particular, at the top there is a try/except block with > the following line that was added as a fix for relative paths that > would show up in earlier versions of Python when the module was imported: > No, it's not relative paths. We do some hackery to try to determine whether we are running 'normally' or from a standalone built with py2app, py2exe, bundlebuilder, macmillan, etc. (so we can look for resource files in the different places they finish up, rather than in their usual directory alongside the .py file). Part of this is in util.py / main_is_frozen() - where there was an explicit test for a 2.3 based path, specific to the OSX version. Because we wrongly believed we were "frozen". we looked in the wrong place(s). Not sure what the medium term fix is (long term I think it is probably setuptools as Ronald suggested earlier) - but there will be a short term fix in CVS soon, hopefully tonight, so if you have been wanting to move to Python 2.4 but were held back by PythonCard, you should be able to get that soon. Note there may be a delay of up to 24 hours before anonymous cvs access catches any updates. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.5/333 - Release Date: 05/05/2006 From emma at csail.mit.edu Mon May 8 17:37:09 2006 From: emma at csail.mit.edu (emma brunskill) Date: Mon, 8 May 2006 11:37:09 -0400 Subject: [Pythonmac-SIG] ImportError: cannot import name PostponedException Message-ID: Hello, I'm a newbie to python and a Mac OSX Tiger user. I installed python 2.4.3 using the universal build installer (from python.org/download/mac). I then installed the mac os X version of numpy (numpy-0.9.6-py2.3-macosx10.4.dmg) and then installed SciPy 0.4.8 using SciPy 0.4.8 for Python 2.4 (.dmg package) I then start python from the command line and try to do from scipy import * to which I get ImportError: cannot import name PostponedException Does anyone know what might be going on? This originally all came up because I was trying to access something from the spline part of python and it kept giving me "ImportError: No module named spline" when I tried to use the fullname to reference the function: aka import scipy image = scipy.lena().astype(scipy.Float32) (these both work fine) then ck = scipy.signal.cspline2d(image,8.0) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'module' object has no attribute 'signal' I've been looking at lots of mailing lists but am pretty confused-- total beginner at python! Any help would be very much appreciated. Thanks a lot! From Chris.Barker at noaa.gov Mon May 8 19:06:53 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 08 May 2006 10:06:53 -0700 Subject: [Pythonmac-SIG] ImportError: cannot import name PostponedException In-Reply-To: References: Message-ID: <445F7AAD.3070608@noaa.gov> emma brunskill wrote: > I'm a newbie to python and a Mac OSX Tiger user. I installed python > 2.4.3 using the universal build installer (from python.org/download/mac). > I then installed the mac os X version of numpy > (numpy-0.9.6-py2.3-macosx10.4.dmg) This is going to be a problem: You've installed a numpy for python 2.3 on python 2.4.3 That won't work right. I'm pretty sure numpy builds just fine with the universal python with the standard: $ python2.4 setup.py build $ sudo python2.4 setup.py install > and then installed SciPy 0.4.8 using > SciPy 0.4.8 for Python 2.4 (.dmg package) That should work, if you're running a PPC Mac, but I've never tried it. Does it come with it's own numpy? it may well, and the numpy you installed probably got put into Apple's python 2.3.5 > I then start python from the command line and try to do > from scipy import * Are you getting python 2.4 when you do that? > I've been looking at lots of mailing lists but am pretty confused-- > total beginner at python! Ideally, you'll get the best answers from the folks that are building SciPy for OS-X. I'm not sure who that is, but I bet you can find them on the SciPy lists. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From emma at csail.mit.edu Tue May 9 15:54:22 2006 From: emma at csail.mit.edu (emma brunskill) Date: Tue, 9 May 2006 09:54:22 -0400 Subject: [Pythonmac-SIG] ImportError: cannot import name PostponedException In-Reply-To: <445F7AAD.3070608@noaa.gov> References: <445F7AAD.3070608@noaa.gov> Message-ID: Sorry, I mis-typed: I did have numpy for python 2.4 So after several hours of tinkering with different pythons, it now works. The things that resulted in things working were using: getting the PPC-only version (currently 2.4.1) of python The numpy version for python 2.4 Getting g77 Setting gcc to use version 3.3 (may or may not have been important) Building and Installing scipy from source Anyway, just wanted to put this information out there in case anyone ends up with the same issue. Thanks to those that responded! On 5/8/06, Christopher Barker wrote: > emma brunskill wrote: > > I'm a newbie to python and a Mac OSX Tiger user. I installed python > > 2.4.3 using the universal build installer (from python.org/download/mac). > > I then installed the mac os X version of numpy > > (numpy-0.9.6-py2.4-macosx10.4.dmg) > > This is going to be a problem: > > You've installed a numpy for python 2.3 on python 2.4.3 That won't work > right. > > I'm pretty sure numpy builds just fine with the universal python with > the standard: > > $ python2.4 setup.py build > $ sudo python2.4 setup.py install > > > and then installed SciPy 0.4.8 using > > SciPy 0.4.8 for Python 2.4 (.dmg package) > > That should work, if you're running a PPC Mac, but I've never tried it. > Does it come with it's own numpy? it may well, and the numpy you > installed probably got put into Apple's python 2.3.5 > > > > I then start python from the command line and try to do > > from scipy import * > > Are you getting python 2.4 when you do that? > > > > I've been looking at lots of mailing lists but am pretty confused-- > > total beginner at python! > > Ideally, you'll get the best answers from the folks that are building > SciPy for OS-X. I'm not sure who that is, but I bet you can find them on > the SciPy lists. > > -Chris > > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > NOAA/OR&R/HAZMAT (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > From Chris.Barker at noaa.gov Tue May 9 18:02:32 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 09 May 2006 09:02:32 -0700 Subject: [Pythonmac-SIG] ImportError: cannot import name PostponedException In-Reply-To: References: <445F7AAD.3070608@noaa.gov> Message-ID: <4460BD18.5030208@noaa.gov> > So after several hours of tinkering with different pythons, it now works. great! > The things that resulted in things working were using: > getting the PPC-only version (currently 2.4.1) of python I wonder if this was necessary. I think PPC-only packages built for 2.4.1 work fine with the Universal 2.4.3 anyway, but there may not be any advantage for you. > The numpy version for python 2.4 > Getting g77 > Setting gcc to use version 3.3 (may or may not have been important) This is important -- at least it was. A while back, SciPy did not build with gcc + g77 4.*, you had to stick with 3.* Which brings up a question. Is it possible to build universal binaries with gcc 3.*? I'd love to see a Universal SciPy package! -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From daniellord at mac.com Tue May 9 18:06:39 2006 From: daniellord at mac.com (Daniel Lord) Date: Tue, 9 May 2006 09:06:39 -0700 Subject: [Pythonmac-SIG] AE/PyObjC: how to use event loops to process AE Message-ID: <32AF2222-77A8-472C-A97F-DBA2FE346570@mac.com> A PyObjC application using Appkit starts and event loop in AppHelper thus: AppHelper.runEventLoop() But, the examples I have seen using Apple Events in Python (not PyObjC) install their own handlers and then call the event loop: CarbonEvt.RunApplicationEventLoop() Unfortunately and unsurprisingly, trying to inject the handlers from different methods in my PyObjC class inheriting from NibClassBuilder.AutoBaseClass and then expecting them to be called doesn't seem to work. I assume it is because: 1) the Carbon Event Loop does not get called by the AppHelper event loop PyObjC uses but one cannot easily mix event loops and 2) the more complex instantiation chain required for nib objects obfuscates the call chain so I am not sure where to put things or how to extend AppHelper it without breaking it. I am sure most of this is due to my lack of detailed working knowledge of AppKit and PyObjC and I'll hammer away at this over time. But sometimes an example is faster than trial-and-error learning. Anyone know of an example of how this is done? I haven't seen an example of a PyObjC AE application. Is that because it is complex to "pull off"? I assume I have to do some clever chaining of the super class init coupled with looking for Apple Events in the AppHelper event loop and dispatching them correctly to the handlers or maybe there is another way I am too "green" to know. I will keep digging on my own, but sometimes a direct reference is better than a search in terms of time to an objective. I just don't want to 'bark up the wrong tree for a long time" Daniel "Ever tried. Ever failed. No matter. Try again. Fail again. Fail better." ?Samuel Beckett From daniellord at mac.com Tue May 9 19:03:41 2006 From: daniellord at mac.com (Daniel Lord) Date: Tue, 9 May 2006 10:03:41 -0700 Subject: [Pythonmac-SIG] ImportError: cannot import name PostponedException In-Reply-To: <4460BD18.5030208@noaa.gov> References: <445F7AAD.3070608@noaa.gov> <4460BD18.5030208@noaa.gov> Message-ID: On May 9, 2006, at 9:02, Christopher Barker wrote: > > Which brings up a question. Is it possible to build universal binaries > with gcc 3.*? I'd love to see a Universal SciPy package! I haven't tried this, but it might hold promise: http://www.macosxhints.com/article.php?story=20060423105014540&lsrc=osxh Daniel From ronaldoussoren at mac.com Tue May 9 20:12:24 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 9 May 2006 20:12:24 +0200 Subject: [Pythonmac-SIG] ImportError: cannot import name PostponedException In-Reply-To: <4460BD18.5030208@noaa.gov> References: <445F7AAD.3070608@noaa.gov> <4460BD18.5030208@noaa.gov> Message-ID: <30B9D337-C812-4E4B-AC6E-D3C79E18E551@mac.com> On 9-mei-2006, at 18:02, Christopher Barker wrote: > > Which brings up a question. Is it possible to build universal binaries > with gcc 3.*? I'd love to see a Universal SciPy package! I don't know if it is directly possible, but at the very least you could do the 'build intel binary', 'build ppc binary' and 'glue them together using lipo' dance that Apple describes in several documents. With some luck Apple's gcc 3.* port at opensource.apple.com already contains the code that allows you to use multiple -arch flags, that would make building universal binaries trivial. BTW. Does gcc 3.* work at all on OSX/intel? Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2157 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060509/2770d818/attachment.bin From bob at redivi.com Tue May 9 20:31:07 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 9 May 2006 11:31:07 -0700 Subject: [Pythonmac-SIG] ImportError: cannot import name PostponedException In-Reply-To: <4460BD18.5030208@noaa.gov> References: <445F7AAD.3070608@noaa.gov> <4460BD18.5030208@noaa.gov> Message-ID: <51A3A881-3A33-49AA-9C36-18E0DD53BC8D@redivi.com> On May 9, 2006, at 9:02 AM, Christopher Barker wrote: >> So after several hours of tinkering with different pythons, it now >> works. > > great! > >> The things that resulted in things working were using: > >> getting the PPC-only version (currently 2.4.1) of python > > I wonder if this was necessary. I think PPC-only packages built for > 2.4.1 work fine with the Universal 2.4.3 anyway, but there may not be > any advantage for you. PPC-only packages do work with Universal Python. There is very little reason left to use 2.4.1. -bob From bob at redivi.com Tue May 9 20:33:43 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 9 May 2006 11:33:43 -0700 Subject: [Pythonmac-SIG] ImportError: cannot import name PostponedException In-Reply-To: <30B9D337-C812-4E4B-AC6E-D3C79E18E551@mac.com> References: <445F7AAD.3070608@noaa.gov> <4460BD18.5030208@noaa.gov> <30B9D337-C812-4E4B-AC6E-D3C79E18E551@mac.com> Message-ID: <15BD33AE-B224-4A76-A8CA-C667FC1EE810@redivi.com> On May 9, 2006, at 11:12 AM, Ronald Oussoren wrote: > > On 9-mei-2006, at 18:02, Christopher Barker wrote: >> >> Which brings up a question. Is it possible to build universal >> binaries >> with gcc 3.*? I'd love to see a Universal SciPy package! > > I don't know if it is directly possible, but at the very least you > could do the 'build intel binary', 'build ppc binary' and 'glue > them together using lipo' dance that Apple describes in several > documents. With some luck Apple's gcc 3.* port at > opensource.apple.com already contains the code that allows you to > use multiple -arch flags, that would make building universal > binaries trivial. > > BTW. Does gcc 3.* work at all on OSX/intel? gcc3.3 works fine on OS X Intel, but only if you give it -arch i386. The Xcode one doesn't ship with an i386 cc1. $ gcc-3.3 -o tmp tmp.c gcc-3.3: installation problem, cannot exec `cc1': No such file or directory -bob From john at hazen.net Wed May 10 01:16:12 2006 From: john at hazen.net (John Hazen) Date: Tue, 9 May 2006 16:16:12 -0700 Subject: [Pythonmac-SIG] ical.py loose in the wild In-Reply-To: <17391.58844.13400.495098@montanaro.dyndns.org> References: <17391.58844.13400.495098@montanaro.dyndns.org> Message-ID: <20060509231612.GA22502@gate2.hazen.net> * skip at pobox.com [2006-02-12 17:31]: > My little iCal event/todo manipulator is loose and available from my Python > Bits page: > > http://orca.mojam.com/~skip/python/ I had a look at this, but I think I need something different. Basically, I've got email messages with iCalendar (.ics) file attachments. I can use python and procmail to get the attachment, and save the file somewhere. I was hoping to use the AppleScript Utility to set up a watch on that directory, and tell iCal to import those files. I can't seem to find the way in the iCal dictionary to make it import a file (the "open" command thinks it's an iCal calendar, and errors out). I could use ical.py, combined with some way of parsing the ics file (which is from Exchange), and generate the event, but that seems like a lot of extra work, and likely to incur translation errors. I've tested the import of the .ics file using the Menu in iCal, and it understands the files perfectly. Is there some way to do this under script control? Thanks- John P.S. I'd prefer to do this with python, but this is essentially an applescript question. Sorry if it's too OT. From pthibault33 at yahoo.ca Tue May 9 18:32:13 2006 From: pthibault33 at yahoo.ca (Pierre Thibault) Date: Tue, 09 May 2006 12:32:13 -0400 Subject: [Pythonmac-SIG] py2App Message-ID: <4460C40D.9040206@yahoo.ca> Hello, Is py2App still working or is it an obsolete thing? I am unable to use it with the Python 2.4.3 that I have in '/Library/Frameworks/Python.framework/Versions/2.4/bin/python' but I can use it with the Darwin port of Python 2.4.2 in '/opt/local/bin' of my machine. With '/opt/local/bin/python' I can do an import of the py2app module but I cannot do the same with my default python in '/Library/Frameworks/Python.framework/Versions/2.4/bin/python' because the module is not found. I made a copy of the py2app folder located in the 'site_packages' folder from the 'opt' install to the standard 'Library' install at the root of my drive but the import is still not working. Can I use this method to make an install in '/Library' or should I do more than that? Are using py2app with Python 2.4.3? -- A+ Pierre From bob at redivi.com Wed May 10 10:50:04 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 10 May 2006 01:50:04 -0700 Subject: [Pythonmac-SIG] py2App In-Reply-To: <4460C40D.9040206@yahoo.ca> References: <4460C40D.9040206@yahoo.ca> Message-ID: <80CE32DF-F69A-473C-9C6A-2E02BAA42562@redivi.com> On May 9, 2006, at 9:32 AM, Pierre Thibault wrote: > Hello, > > Is py2App still working or is it an obsolete thing? I am unable to use > it with the Python 2.4.3 that I have in > '/Library/Frameworks/Python.framework/Versions/2.4/bin/python' but > I can > use it with the Darwin port of Python 2.4.2 in '/opt/local/bin' of my > machine. > > With '/opt/local/bin/python' I can do an import of the py2app > module but > I cannot do the same with my default python in > '/Library/Frameworks/Python.framework/Versions/2.4/bin/python' because > the module is not found. You need to install it (and anything else) for each Python you use. -bob From hengist.podd at virgin.net Wed May 10 19:41:32 2006 From: hengist.podd at virgin.net (has) Date: Wed, 10 May 2006 18:41:32 +0100 Subject: [Pythonmac-SIG] AE/PyObjC: how to use event loops to process AE Message-ID: Daniel Lord wrote: >A PyObjC application using Appkit starts and event loop in AppHelper >thus: > > AppHelper.runEventLoop() > >But, the examples I have seen using Apple Events in Python (not >PyObjC) install their own handlers and then call the event loop: > > CarbonEvt.RunApplicationEventLoop() > >Unfortunately and unsurprisingly, trying to inject the handlers from >different methods in my PyObjC class inheriting from >NibClassBuilder.AutoBaseClass and then expecting them to be called >doesn't seem to work. Makes no difference if your app uses a Carbon or Cocoa event loop. You should be able to install your own Apple event handlers without any problem. You can use NSAppleEventManager, aemreceive or Cocoa Scripting; even Carbon.AE if you want (although there's no real reason to do so). Examples: 1. Using NSAppleEventManager (you'll need to do your own packing and unpacking of event descriptors, mind): from AppKit import * from PyObjCTools import NibClassBuilder, AppHelper import struct NibClassBuilder.extractClasses('MainMenu.nib') def aeKeyword(fourCharCode): return struct.unpack('L', fourCharCode)[0] class MyAppDelegate(NibClassBuilder.AutoBaseClass): def applicationWillFinishLaunching_(self, aNotification): aem = NSAppleEventManager.sharedAppleEventManager() aem.setEventHandler_andSelector_forEventClass_andEventID_( self, 'someEvent:reply:', aeKeyword('Some'), aeKeyword('Evnt')) def someEvent_reply_(self, event, reply): result = NSAppleEventDescriptor.descriptorWithInt32_(42) reply.setParamDescriptor_forKeyword_(result, aeKeyword('----')) if __name__ == '__main__': AppHelper.runEventLoop() 2. Using aemreceive (you need to put function wrappers around PyObjC method calls, otherwise aemreceive's magic clashes with PyObjC's magic): from AppKit import * from PyObjCTools import NibClassBuilder, AppHelper import aemreceive NibClassBuilder.extractClasses('MainMenu.nib') class MyAppDelegate(NibClassBuilder.AutoBaseClass): def applicationWillFinishLaunching_(self, aNotification): aemreceive.installeventhandler( lambda:self.someEvent(), 'SomeEvnt') def someEvent(self): return 42 if __name__ == '__main__': AppHelper.runEventLoop() For doing it with Cocoa Scripting, follow Apple's documentation on implementing scriptability in Cocoa apps, translating to PyObjC as necessary. And remember to add any Info.plist settings and terminology resources as needed, of course. has -- http://freespace.virgin.net/hamish.sanderson/ From hengist.podd at virgin.net Wed May 10 19:41:38 2006 From: hengist.podd at virgin.net (has) Date: Wed, 10 May 2006 18:41:38 +0100 Subject: [Pythonmac-SIG] ical.py loose in the wild In-Reply-To: <20060509231612.GA22502@gate2.hazen.net> References: <17391.58844.13400.495098@montanaro.dyndns.org> <20060509231612.GA22502@gate2.hazen.net> Message-ID: John Hazen wrote: >Basically, I've got email messages with iCalendar (.ics) file >attachments. > >I can't seem to find the way in the iCal dictionary to make it import a >file (the "open" command thinks it's an iCal calendar, and errors out). If you can drag-n-drop the .ics file onto iCal's icon all right then 'tell app "iCal" to open alias "path:to:file.ics"' will work as well. Seems to on iCal 2.0 (OS 10.4); can't vouch for iCal 1.x. >I've tested the import of the .ics file using the Menu in iCal, and it >understands the files perfectly. Is there some way to do this under >script control? GUI Scripting (part of System Events). It's kludgy, tedious and fragile, but if you want to manipulate a GUI application directly and its scripting interface isn't up to snuff then manipulating its GUI objects is better than nothing. Probably best to ask on one of the AppleScript forums for help there; there'll be more folks there familiar with using it. >P.S. I'd prefer to do this with python, but this is essentially an >applescript question. Sorry if it's too OT. Python has very good application scripting support: http://freespace.virgin.net/hamish.sanderson/appscript.html Alternatively, I imagine you could bypass iCal and work directly with its iCalendar files; Google for Python+iCalendar. has -- http://freespace.virgin.net/hamish.sanderson/ From beau at open-source-staffing.com Wed May 10 22:43:56 2006 From: beau at open-source-staffing.com (Beau Gould) Date: Wed, 10 May 2006 16:43:56 -0400 Subject: [Pythonmac-SIG] [JOB] Python/Mac Developer, NYC Message-ID: My client is one of the world's premier auction houses. They are looking for a Python/Mac Developer with experience in all phases of development and, ideally, experience as a technical lead and architect. This is a full time, on-site, salaried job paying 60-90k dep on exp. More for the right guy/gal. They might allow some on-site and some off-site, but you must live within commutable distance to NYC. To be considered please submit resume and salary requirements to beau at open-source-staffing.com Thank you, Beau J. Gould Open Source Staffing www.open-source-staffing.com beau at open-source-staffing.com From kquirk at solidworks.com Thu May 11 02:14:45 2006 From: kquirk at solidworks.com (Kent Quirk) Date: Wed, 10 May 2006 20:14:45 -0400 Subject: [Pythonmac-SIG] py2app corrupting libraries Message-ID: Hi, all. We have a large mixed Python and C++ application with about a dozen frameworks which cross-reference one another. We've been shipping it for almost a year on PPC Macs using py2app to package things - so we know we have the py2app stuff approximately correct. We've been trying off and on to get a fat version of the app working. All the C++ code compiles and links cleanly on both architectures. We've installed fat Python 2.4.3 (the April 7 version). When we run the current (0.2-maint) branch of py2app on our Intel Mac, somewhere along the way, it tells us that it's "Thinning" our "Events" library to the i386 part only...then, later on, it tries to thin the same library to both the ppc and i386 versions...but doesn't find the ppc version anymore and crashes. Possibly of interest, but possibly a red herring: py2app spends a fair amount of time building the dependency graph and doing many operations over and over (the graph of our library dependencies is basically a web, not a hierarchy, and it seems to be doing a pretty exhaustive walk of the graph). We tried going into the macholib/util.py and stubbing out the thin_to_archs() function. As we only build the two architectures we care about, and we want both, we figured this should be safe. But then py2app crashes with an unrecognized magic number in some of the libraries. So we changed thin_to_archs() so that it always used both architectures, no matter what it was asked to build...and got the same (magic) problem. We even tried reversing the order of the two in case there was an order dependency somewhere. I know the macholib stuff is fairly tricky and at this point we're kinda stumped. Below are the stack traces from the two types of crashes. Any advice or suggestions would be appreciated. Kent First one, unmodified py2app: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Thinning /Users/cb/blobs/trunk/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events to ppc, i386 /usr/bin/lipo: -extract ppc specified but fat file: /Users/cb/blobs/trunk/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events does not contain that architecture Traceback (most recent call last): File "setup.py", line 145, in ? argv_emulation=True, File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/distut ils/core.py", line 149, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/distut ils/dist.py", line 946, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/distut ils/dist.py", line 966, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/py2app/build_app.py", line 373, in run self._run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/py2app/build_app.py", line 494, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/py2app/build_app.py", line 554, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/py2app/build_app.py", line 652, in create_binaries platfiles = mm.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/macholib/MachOStandalone.py", line 147, in run thin_to_archs(filename, nodearchs) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/macholib/util.py", line 146, in thin_to_archs raise ValueError, 'Error %d returned by: %s' % (retval, ''.join(["'%s'" % arg for arg in command])) ValueError: Error 1 returned by: '/usr/bin/lipo''/Users/cb/blobs/trunk/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events''-outpu t''/tmp/tmpxlJYOq''-extract''ppc''-extract''i386' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Second one, thin_to_archs() body commented out, is the same as the third try, with body of thin_to_archs() restored but archs param forced to ("ppc", "i386"), and also the same as the fourth try with the args reversed: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - Graphing /Users/cb/blobs/trunk/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events (ppc) Traceback (most recent call last): File "setup.py", line 145, in ? argv_emulation=True, File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/distut ils/core.py", line 149, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/distut ils/dist.py", line 946, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/distut ils/dist.py", line 966, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/py2app/build_app.py", line 373, in run self._run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/py2app/build_app.py", line 494, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/py2app/build_app.py", line 554, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/py2app/build_app.py", line 652, in create_binaries platfiles = mm.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/macholib/MachOStandalone.py", line 101, in run mm.run_file(fn) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/macholib/MachOGraph.py", line 62, in run_file m = MachO(pathname) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/macholib/MachO.py", line 254, in __init__ self.load() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/macholib/MachO.py", line 287, in load self.archs = self.load_fat(fat, fh) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pa ckages/py2app/macholib/MachO.py", line 273, in load_fat raise ValueError, "got unrecognized magic of %08x" % (header.magic, MH_MAGIC, MH_CIGAM) TypeError: not all arguments converted during string formatting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060510/4953aacc/attachment-0001.html From bob at redivi.com Thu May 11 02:33:58 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 10 May 2006 17:33:58 -0700 Subject: [Pythonmac-SIG] py2app corrupting libraries In-Reply-To: References: Message-ID: <5D20EC5B-4FDA-4F13-B0C9-D04807B84B18@redivi.com> On May 10, 2006, at 5:14 PM, Kent Quirk wrote: > We have a large mixed Python and C++ application with about a dozen > frameworks which cross-reference one another. > > > > We?ve been shipping it for almost a year on PPC Macs using py2app > to package things ? so we know we have the py2app stuff > approximately correct. We?ve been trying off and on to get a fat > version of the app working. All the C++ code compiles and links > cleanly on both architectures. We?ve installed fat Python 2.4.3 > (the April 7 version). > > > > When we run the current (0.2-maint) branch of py2app on our Intel > Mac, somewhere along the way, it tells us that it?s ?Thinning? our > ?Events? library to the i386 part only?then, later on, it tries to > thin the same library to both the ppc and i386 versions?but doesn?t > find the ppc version anymore and crashes. > > > > Possibly of interest, but possibly a red herring: py2app spends a > fair amount of time building the dependency graph and doing many > operations over and over (the graph of our library dependencies is > basically a web, not a hierarchy, and it seems to be doing a pretty > exhaustive walk of the graph). > > > > We tried going into the macholib/util.py and stubbing out the > thin_to_archs() function. As we only build the two architectures we > care about, and we want both, we figured this should be safe. But > then py2app crashes with an unrecognized magic number in some of > the libraries. So we changed thin_to_archs() so that it always used > both architectures, no matter what it was asked to build?and got > the same (magic) problem. We even tried reversing the order of the > two in case there was an order dependency somewhere. This probably isn't going to get fixed unless a patch or a set of binaries to reproduce this issue is available. I'm pretty much out of commission for the rest of the month though, so even with binaries I'm not going to get anywhere with it any time soon. -bob From frank at niessink.com Fri May 12 22:08:21 2006 From: frank at niessink.com (Frank Niessink) Date: Fri, 12 May 2006 22:08:21 +0200 Subject: [Pythonmac-SIG] py2app corrupting libraries In-Reply-To: <5D20EC5B-4FDA-4F13-B0C9-D04807B84B18@redivi.com> References: <5D20EC5B-4FDA-4F13-B0C9-D04807B84B18@redivi.com> Message-ID: <4464EB35.5040008@niessink.com> Bob Ippolito: > On May 10, 2006, at 5:14 PM, Kent Quirk wrote: >> We?ve been shipping it for almost a year on PPC Macs using py2app >> to package things ? so we know we have the py2app stuff >> approximately correct. We?ve been trying off and on to get a fat >> version of the app working. All the C++ code compiles and links >> cleanly on both architectures. We?ve installed fat Python 2.4.3 >> (the April 7 version). >> >> When we run the current (0.2-maint) branch of py2app on our Intel >> Mac, somewhere along the way, it tells us that it?s ?Thinning? our >> ?Events? library to the i386 part only?then, later on, it tries to >> thin the same library to both the ppc and i386 versions?but doesn?t >> find the ppc version anymore and crashes. You are probably aware of this, and even if not I'm not sure whether it helps, but here it goes anyway: did you add an "archs='ppc,i386'" to the py2app options? Before I did that too much stuff got thinned away for me too. Example options from setup.py: if sys.argv[1] == 'py2app': import py2app setupOptions.update(dict(app=['taskcoach.py'], options=dict(py2app=dict(archs='ppc,i386', argv_emulation=True, compressed=True, dist_dir=builddir, optimize=2, iconfile='icons.in/taskcoach.icns', packages=['i18n'])))) Hope that is of use, Frank From scottyv at media.mit.edu Sat May 13 02:18:54 2006 From: scottyv at media.mit.edu (Scotty Vercoe) Date: Fri, 12 May 2006 20:18:54 -0400 Subject: [Pythonmac-SIG] Carbon/QuickTime help Message-ID: I am building a media application for OS X, using QuickTime to display a movie file with a different audio track. Both my audio and video threads are working fine, but I need to be able to load movie segments, given start time and duration (or end time). To accomplish this, should I... 1) load the segment instead of the entire movie file, or 2) load the movie file, then specify the start/end times What Qt components are necessary? Does anyone know any (even preliminary) documentation for the undocumented Carbon modules? other resources? Thanks in advance! Scotty From zbir at urbanape.com Sat May 13 12:34:27 2006 From: zbir at urbanape.com (Zachery Bir) Date: Sat, 13 May 2006 06:34:27 -0400 Subject: [Pythonmac-SIG] Wrapping CoreGraphics with Universal Python? Message-ID: Has anyone taken a shot at wrapping CoreGraphics for Universal Python? I know Apple's CG bindings invent new, undocumented APIs for dealing with the underlying libraries, but I don't have any experience wrapping libraries with Python, and since CoreGraphics isn't Cocoa, it's not a simple operation for PyObjC. Where to begin? Thanks, Zac From robert.kern at gmail.com Sat May 13 21:28:22 2006 From: robert.kern at gmail.com (Robert Kern) Date: Sat, 13 May 2006 14:28:22 -0500 Subject: [Pythonmac-SIG] Wrapping CoreGraphics with Universal Python? In-Reply-To: References: Message-ID: <44663356.7040200@gmail.com> Zachery Bir wrote: > Has anyone taken a shot at wrapping CoreGraphics for Universal Python? > > I know Apple's CG bindings invent new, undocumented APIs for dealing > with the underlying libraries, but I don't have any experience > wrapping libraries with Python, and since CoreGraphics isn't Cocoa, > it's not a simple operation for PyObjC. > > Where to begin? Here: http://svn.enthought.com/enthought/browser/trunk/src/lib/enthought/kiva/mac I haven't tried it with Universal Python, yet, and some work needs to be done to connect it up to Cocoa NSViews, but most of the CoreGraphics API is wrapped. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From marcink at ieee.org Sun May 14 14:21:28 2006 From: marcink at ieee.org (Marcin Komorowski) Date: Sun, 14 May 2006 08:21:28 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X Message-ID: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> Does anyone know what that status is of porting PyObjC to run on the new Intel Macs? I know that there has already been some amount of work done, but my attempts to run it on the new platform have failed. Should I be trying to be digging deeper into what I might be doing wrong, or is the port not complete? Thank You, Marcin From daniellord at mac.com Sun May 14 16:38:16 2006 From: daniellord at mac.com (Daniel Lord) Date: Sun, 14 May 2006 07:38:16 -0700 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> Message-ID: <61B5A9F0-A4E7-4308-8557-53D7B98EFF2B@mac.com> On May 14, 2006, at 5:21, Marcin Komorowski wrote: > Does anyone know what that status is of porting PyObjC to run on the > new Intel Macs? > > I know that there has already been some amount of work done, but my > attempts to run it on the new platform have failed. > > Should I be trying to be digging deeper into what I might be doing > wrong, or is the port not complete? I have been able to my small projects on my Intel-based MacBook Pro without incident. So while that doesn't mean the port is perfect, it is fairly complete and solid. There are a few endian issue in a few dark corners of the port which are being found and fixed. A bit more specificity on the problems you are encountering on the Intel platform you didn't with the power-pc platform would be helpful. It is hard to address a general complaint/query without specifics. Further, remember, no port is perfect--there are always bugs which decline in number and the frequency with which they are encountered but some are always there they are just the more obscure ones. Daniel Lord daniellord at mac.com --- "You will never regret getting up too early, and you'll always regret getting up too late, but sometimes you may regret giving up too late." -- Mountaineer's Adage From ronaldoussoren at mac.com Sun May 14 17:31:24 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 14 May 2006 17:31:24 +0200 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> Message-ID: <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> On 14-mei-2006, at 14:21, Marcin Komorowski wrote: > Does anyone know what that status is of porting PyObjC to run on the > new Intel Macs? > > I know that there has already been some amount of work done, but my > attempts to run it on the new platform have failed. > > Should I be trying to be digging deeper into what I might be doing > wrong, or is the port not complete? The current version in subversion should work correctly, PyObjC's unittests also run the unittests for libffi and all except two of those pass. The tests that fail have to do with very small structures (1 or 2 bytes in size) and those aren't used in Cocoa APIs. If you do find something that doesn't work as expected in PyObjC or py2app I'm definitely interested to here about it. A small program that demonstrates the problem would make it easier to reproduce any problems, and hence increase the likelyhood of timely fixes. Ronald From bob at redivi.com Sun May 14 19:43:23 2006 From: bob at redivi.com (Bob Ippolito) Date: Sun, 14 May 2006 19:43:23 +0200 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> Message-ID: <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> On May 14, 2006, at 5:31 PM, Ronald Oussoren wrote: > > On 14-mei-2006, at 14:21, Marcin Komorowski wrote: > >> Does anyone know what that status is of porting PyObjC to run on the >> new Intel Macs? >> >> I know that there has already been some amount of work done, but my >> attempts to run it on the new platform have failed. >> >> Should I be trying to be digging deeper into what I might be doing >> wrong, or is the port not complete? > > The current version in subversion should work correctly, PyObjC's > unittests also run the unittests for libffi and all except two of > those pass. The tests that fail have to do with very small structures > (1 or 2 bytes in size) and those aren't used in Cocoa APIs. > > If you do find something that doesn't work as expected in PyObjC or > py2app I'm definitely interested to here about it. A small program > that demonstrates the problem would make it easier to reproduce any > problems, and hence increase the likelyhood of timely fixes. The binary package at http://pythonmac.org/packages/py24-fat/ is recent too, I updated it a day or two ago. -bob From zbir at urbanape.com Mon May 15 13:42:18 2006 From: zbir at urbanape.com (Zachery Bir) Date: Mon, 15 May 2006 07:42:18 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> Message-ID: <8B3296D6-BEAF-4F62-9106-4D2E03206A93@urbanape.com> On May 14, 2006, at 8:21 AM, Marcin Komorowski wrote: > Does anyone know what that status is of porting PyObjC to run on the > new Intel Macs? > > I know that there has already been some amount of work done, but my > attempts to run it on the new platform have failed. > > Should I be trying to be digging deeper into what I might be doing > wrong, or is the port not complete? I've been successfully building Universal PyObjC apps for a while now. I've been tracking the head of PyObjC's SVN and using the Universal Python 2.4.3 installer from python.org. Zac From monsterkodi at gmx.net Mon May 15 14:07:04 2006 From: monsterkodi at gmx.net (Thorsten Kohnhorst) Date: Mon, 15 May 2006 14:07:04 +0200 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <8B3296D6-BEAF-4F62-9106-4D2E03206A93@urbanape.com> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <8B3296D6-BEAF-4F62-9106-4D2E03206A93@urbanape.com> Message-ID: <44686EE8.1070304@gmx.net> Zachery Bir wrote: > I've been successfully building Universal PyObjC apps for a while > now. I've been tracking the head of PyObjC's SVN and using the > Universal Python 2.4.3 installer from python.org. > Yes, me too! The pyobjc bridge is an awsome piece of software and the trunk version works flawlessly on my new intel mac. Thanks a lot to all the developers for making it available! Yours kodi From monsterkodi at gmx.net Mon May 15 19:09:01 2006 From: monsterkodi at gmx.net (Thorsten Kohnhorst) Date: Mon, 15 May 2006 19:09:01 +0200 Subject: [Pythonmac-SIG] Application without py2app? Message-ID: Hello, I would like to know if it is possible to create an Cocoa application without using py2app. I want to start the application from the main python script instead (the one that starts the event loop). So far I managed to load the nib from a path by calling NibClassBuilder._nibInfo._extractClassesFromNibFromPath(nibFilePath) instead of NibClassBuilder.extractClasses(nibFile) But the application exits with the following message: Python[310] No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting This is probably because the Pythons bundle is used. Does anybody know how to tell the application to use another bundle? Thanks in advance, Yours kodi From ronaldoussoren at mac.com Mon May 15 19:20:04 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 15 May 2006 19:20:04 +0200 Subject: [Pythonmac-SIG] Application without py2app? In-Reply-To: References: Message-ID: On 15-mei-2006, at 19:09, Thorsten Kohnhorst wrote: > Hello, > > I would like to know if it is possible to create an Cocoa application > without using py2app. Sure, you can build the .app bundle by hand. Apple's website documents the structure of bundles. > I want to start the application from the main python script instead > (the one that starts the > event loop). So far I managed to load the nib from a path by calling > > NibClassBuilder._nibInfo._extractClassesFromNibFromPath(nibFilePath) > > instead of > > NibClassBuilder.extractClasses(nibFile) That's wrong, methods starting with underscores should be considered private. Furthermore this has nothing to do with py2app. > > But the application exits with the following message: > > Python[310] No Info.plist file in application bundle or no > NSPrincipalClass in the Info.plist file, exiting > > This is probably because the Pythons bundle is used. > Does anybody know how to tell the application to use another bundle? Which brings us to the main point: I have no idea what you are trying to accomplish. If I had to guess I'd guess that you want to create a python GUI without using an .app bundle. That is possible, but not recommended (hence the lack of details about how to do this ;-)) Ronald From monsterkodi at gmx.net Mon May 15 19:54:12 2006 From: monsterkodi at gmx.net (Thorsten Kohnhorst) Date: Mon, 15 May 2006 19:54:12 +0200 Subject: [Pythonmac-SIG] Application without py2app? In-Reply-To: References: Message-ID: <99016B66-295B-4DD7-9B04-0266000133C7@gmx.net> Hello Ronald, thanks for the fast reply. >> I would like to know if it is possible to create an Cocoa application >> without using py2app. > > Sure, you can build the .app bundle by hand. Apple's website documents > the structure of bundles. Well, I am happy with the bundle that was generated by py2app. I just want to start the application from the python script and not from the generated executable (see below). >> So far I managed to load the nib from a path by calling >> >> NibClassBuilder._nibInfo._extractClassesFromNibFromPath(nibFilePath) >> >> instead of >> >> NibClassBuilder.extractClasses(nibFile) > > That's wrong, methods starting with underscores should be > considered private. Furthermore this has nothing to do with py2app. Yes, I know. I already found out that I can accomplish the same by specifying the bundle explicitly: bundle = NSBundle.bundleWithPath_("./build/Development/krix.app") info = bundle.infoDictionary()[u'PyObjCXcode'] for nibFile in info[u'NIBFiles']: NibClassBuilder.extractClasses(nibFile, bundle) But the app still exits with this message: >> Python[310] No Info.plist file in application bundle or no >> NSPrincipalClass in the Info.plist file, exiting >> >> This is probably because the Pythons bundle is used. >> Does anybody know how to tell the application to use another bundle? > > Which brings us to the main point: I have no idea what you are > trying to accomplish. > > If I had to guess I'd guess that you want to create a python GUI > without using an .app bundle. That is possible, but not recommended > (hence the lack of details about how to do this ;-)) No, I am fine using an application bundle. It's just that the IDE I am trying to use (SPE) seems to know nothing about executables. And I guess that the included debugger might only work if the application is started from a python script. If there was another way to use a python IDE with a debugger I won't care about how exactly the app is started. I hope I made myself clearer now. Thanks again for your fast reply. Yours kodi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060515/c2484fc6/attachment.htm From ronaldoussoren at mac.com Mon May 15 22:13:30 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 15 May 2006 22:13:30 +0200 Subject: [Pythonmac-SIG] Application without py2app? In-Reply-To: <99016B66-295B-4DD7-9B04-0266000133C7@gmx.net> References: <99016B66-295B-4DD7-9B04-0266000133C7@gmx.net> Message-ID: <6E112029-AA97-4BF6-99D1-12FE636CDB5A@mac.com> On 15-mei-2006, at 19:54, Thorsten Kohnhorst wrote: > > No, I am fine using an application bundle. > It's just that the IDE I am trying to use (SPE) seems to know > nothing about executables. > And I guess that the included debugger might only work if the > application is started from a python script. > > If there was another way to use a python IDE with a debugger I > won't care about how exactly the app is started. > > I hope I made myself clearer now. > Thanks again for your fast reply. The best solution would be to teach SPE about application bundles, but I don't know how hard that would be. Bundle support in Cocoa/CoreFoundation uses the C-level argv[0] (*) to calculate the default location for bundles. Bundlebuilder (py2app's predecessor(sp?)) uses a copy of the python interpreter inside the directory Foo.app/Contents/MacOS to run the user's application. The bundle application (Foo.app/Conents/MacOS/Foo) is a python script that sets up the right environment and then calls the embedded python interpreter. You could try to use something like that to run your application from SPE. Ronald (*) Technically it doesn't even use that, but the first argument to the execv that was used to start the application. > > Yours kodi > > > From monsterkodi at gmx.net Tue May 16 01:36:27 2006 From: monsterkodi at gmx.net (Thorsten Kohnhorst) Date: Tue, 16 May 2006 01:36:27 +0200 Subject: [Pythonmac-SIG] Application without py2app? In-Reply-To: <6E112029-AA97-4BF6-99D1-12FE636CDB5A@mac.com> References: <99016B66-295B-4DD7-9B04-0266000133C7@gmx.net> <6E112029-AA97-4BF6-99D1-12FE636CDB5A@mac.com> Message-ID: <691724C7-3AB0-46EA-A95D-01986CB44303@gmx.net> Hello Ronald, you made my day :-) >> No, I am fine using an application bundle. >> It's just that the IDE I am trying to use (SPE) seems to know >> nothing about executables. >> And I guess that the included debugger might only work if the >> application is started from a python script. >> >> If there was another way to use a python IDE with a debugger I >> won't care about how exactly the app is started. >> >> I hope I made myself clearer now. >> Thanks again for your fast reply. > > The best solution would be to teach SPE about application bundles, > but I don't know how hard that would be. > > Bundle support in Cocoa/CoreFoundation uses the C-level argv[0] (*) > to calculate the default location for bundles. Bundlebuilder > (py2app's predecessor(sp?)) uses a copy of the python interpreter > inside the directory Foo.app/Contents/MacOS to run the user's > application. The bundle application (Foo.app/Conents/MacOS/Foo) is > a python script that sets up the right environment and then calls > the embedded python interpreter. You could try to use something > like that to run your application from SPE. > (*) Technically it doesn't even use that, but the first argument to > the execv that was used to start the application. This was exactly the information I was looking for. After some hours of trial and error I have a perfect working environment now. I used the Bundlebuilder script to set up a working application bundle based on a python executable. Then I decided to drop SPE and installed the latest Eclipse with PyDev instead. The tricky part was to get Eclipse to use the Python executable inside the bundle for debugging and launching. But I found out that this could easily be done with a symlink. Now I can set a breakpoint anywhere and step through my code with a decent IDE. Very nice. Thanks a lot for your help. Yours kodi From phdecora at yahoo.com Tue May 16 03:41:42 2006 From: phdecora at yahoo.com (don bright) Date: Mon, 15 May 2006 18:41:42 -0700 (PDT) Subject: [Pythonmac-SIG] InstallApplicationEventHandler and/or InstallEventHandler Message-ID: <20060516014142.39268.qmail@web52112.mail.yahoo.com> Dear Pythonians, I'm trying to detect when a process starts/stops. I'm contemplating this excellent example from Apple, 'observing process lifetimes without polling' http://developer.apple.com/technotes/tn/tn2050.html However, it uses a function called InstallApplicationEventHandler. I guess this is from Carbon? The closest thing I can find in the python source code is some files in _CarbonEvtModule.c: http://pxr.openlook.org/pxr/source/Mac/Modules/carbonevt/_CarbonEvtmodule.c However, I can't seem to figure out how or if I can use it. >>> import Carbon >>> import Carbon.CarbonEvt >>> Carbon.CarbonEvt.InstallEventHandler Traceback (most recent call last): File "", line 1, in ? AttributeError: 'module' object has no attribute 'InstallEventHandler' --- If this can't work I will try kvm_open() and kvm_getprocs(), but I can't seem to figure out how to make those work from python either. I tried to use ctypes to open the dynamic c library but when I called kvm_open() it always returns '0' instead of a pointer like it should. ---- I guess I could try writing an extension but I'd rather not. Any help is appreciated. Thanks. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From marcink at ieee.org Tue May 16 04:11:33 2006 From: marcink at ieee.org (Marcin Komorowski) Date: Mon, 15 May 2006 22:11:33 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> Message-ID: Thanks to all who have replied with information, and especially to Bob for pointing me to a location where I can find a bunch of recent universal binary builds of python components. I have not found a link to this page on the Internet before, hopefully your post will help search engines find it. Here is a bit of extra information, what I got to work and the question I still have: - I am a recent Mac convertee (what took me so long?), and I am setting up PyObjC on my iMac for the first time - I originally tried PyObjC v1.3.7, the latest package I found at http://pyobjc.sourceforge.net/ and of course that did not work With the help of the wonderful people on this list: - I have checked out the latest PyObjC using subversion (here comes my CVS-to-subversion conversion) and built it with Python 2.3.5, which comes pre-installed with OS X 10.4 I have managed to do a build, install the package, and than used XCode to build a sample PyObjC application - awesome. Now, are there any side affects of switching the system over to use python 2.4? I have played around a bit with installing MacPython 2.4 (once again thanks to Bob's link) but I found that XCode picks up / bin/python (which is 2.3.5) and not /usr/local/bin/python, which is where MacPython 2.4 installs a link to its binary. Being new to Mac I must ask - is it safe to just point python binary links in /bin to match those found in /usr/local/bin or should I be weary of some side affects? Thank You, Marcin On 14-May-06, at 1:43 PM, Bob Ippolito wrote: > > On May 14, 2006, at 5:31 PM, Ronald Oussoren wrote: > >> >> On 14-mei-2006, at 14:21, Marcin Komorowski wrote: >> >>> Does anyone know what that status is of porting PyObjC to run on the >>> new Intel Macs? >>> >>> I know that there has already been some amount of work done, but my >>> attempts to run it on the new platform have failed. >>> >>> Should I be trying to be digging deeper into what I might be doing >>> wrong, or is the port not complete? >> >> The current version in subversion should work correctly, PyObjC's >> unittests also run the unittests for libffi and all except two of >> those pass. The tests that fail have to do with very small structures >> (1 or 2 bytes in size) and those aren't used in Cocoa APIs. >> >> If you do find something that doesn't work as expected in PyObjC or >> py2app I'm definitely interested to here about it. A small program >> that demonstrates the problem would make it easier to reproduce any >> problems, and hence increase the likelyhood of timely fixes. > > The binary package at http://pythonmac.org/packages/py24-fat/ is > recent too, I updated it a day or two ago. > > -bob From janssen at parc.com Tue May 16 04:40:24 2006 From: janssen at parc.com (Bill Janssen) Date: Mon, 15 May 2006 19:40:24 PDT Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: Your message of "Mon, 15 May 2006 19:11:33 PDT." Message-ID: <06May15.194025pdt."58641"@synergy1.parc.xerox.com> > Being new to Mac > I must ask - is it safe to just point python binary links in /bin to > match those found in /usr/local/bin or should I be weary of some side > affects? Looks like the answer to this question isn't in enough places yet :-). I've updated the FAQ with the answer: Don't try this. Bill From daniellord at mac.com Tue May 16 05:02:08 2006 From: daniellord at mac.com (Daniel Lord) Date: Mon, 15 May 2006 20:02:08 -0700 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> Message-ID: On May 15, 2006, at 19:11, Marcin Komorowski wrote: > Thanks to all who have replied with information, and especially to > Bob for pointing me to a location where I can find a bunch of recent > universal binary builds of python components. I have not found a > link to this page on the Internet before, hopefully your post will > help search engines find it. > > Here is a bit of extra information, what I got to work and the > question I still have: > > - I am a recent Mac convertee (what took me so long?), and I am > setting up PyObjC on my iMac for the first time > - I originally tried PyObjC v1.3.7, the latest package I found at > http://pyobjc.sourceforge.net/ and of course that did not work > > With the help of the wonderful people on this list: > - I have checked out the latest PyObjC using subversion (here comes > my CVS-to-subversion conversion) and built it with Python 2.3.5, > which comes pre-installed with OS X 10.4 > I have managed to do a build, install the package, and than used > XCode to build a sample PyObjC application - awesome. > > Now, are there any side affects of switching the system over to use > python 2.4? I have played around a bit with installing MacPython 2.4 > (once again thanks to Bob's link) but I found that XCode picks up / > bin/python (which is 2.3.5) and not /usr/local/bin/python, which is > where MacPython 2.4 installs a link to its binary. Being new to Mac > I must ask - is it safe to just point python binary links in /bin to > match those found in /usr/local/bin or should I be weary of some side > affects? Marcin, As Bill said _DON'T DO THIS_(TM). Please save yourself grief. The best thing to do is let the Third-Party Python installer put Python 2.4 in /usr/local/bin and then ensure your $PATH place /usr/ local/bin before /usr/bin sequentially thus causing the Python 2.4 to be found first when searching for the 'python' command. In this way, 'things' expecting to find Python 2.3 using absolute paths of /usr/ bin and Apple's installation don't break. While 'things' created to utilize Python 2.4 in /usr/local/bin function as expected. I, while no 'power-user', have been using this scheme successfully fr months now with no undesirable side effects so far. Daniel "Ever tried. Ever failed. No matter. Try again. Fail again. Fail better." ?Samuel Beckett From marcink at ieee.org Tue May 16 05:54:17 2006 From: marcink at ieee.org (Marcin Komorowski) Date: Mon, 15 May 2006 23:54:17 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> Message-ID: <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> Daniel, Bill, Thanks for your prompt replies, and Bill, yes, I should have read the FAQ before asking the question. I suspected there might be something relying on particular version within OS X itself, which is why I asked. Although, the entries in / bin are done in a 'revisioned' linked manner. What I mean is that the /bin/python is a link to /usr/bin/python, which than links to / usr/bin/python23, which than links to the actual binary in the installation directory. It could be argued that if there are version dependent scripts in OSX they really should use /usr/bin/python23 to ensure the correct version of the interpreter. However, I will agree, that it would not be a safe bet to rely on this. Daniel, I did let the installer put python 2.4 binaries in /usr/local/ bin and I can change the path in my shell strartup script to pull in the 2.4 binary, but how do I make XCode use python 2.4? Thanks, Marcin On 15-May-06, at 11:02 PM, Daniel Lord wrote: > > On May 15, 2006, at 19:11, Marcin Komorowski wrote: > >> Thanks to all who have replied with information, and especially to >> Bob for pointing me to a location where I can find a bunch of recent >> universal binary builds of python components. I have not found a >> link to this page on the Internet before, hopefully your post will >> help search engines find it. >> >> Here is a bit of extra information, what I got to work and the >> question I still have: >> >> - I am a recent Mac convertee (what took me so long?), and I am >> setting up PyObjC on my iMac for the first time >> - I originally tried PyObjC v1.3.7, the latest package I found at >> http://pyobjc.sourceforge.net/ and of course that did not work >> >> With the help of the wonderful people on this list: >> - I have checked out the latest PyObjC using subversion (here comes >> my CVS-to-subversion conversion) and built it with Python 2.3.5, >> which comes pre-installed with OS X 10.4 >> I have managed to do a build, install the package, and than used >> XCode to build a sample PyObjC application - awesome. >> >> Now, are there any side affects of switching the system over to use >> python 2.4? I have played around a bit with installing MacPython 2.4 >> (once again thanks to Bob's link) but I found that XCode picks up / >> bin/python (which is 2.3.5) and not /usr/local/bin/python, which is >> where MacPython 2.4 installs a link to its binary. Being new to Mac >> I must ask - is it safe to just point python binary links in /bin to >> match those found in /usr/local/bin or should I be weary of some side >> affects? > > Marcin, > > As Bill said _DON'T DO THIS_(TM). Please save yourself grief. > > The best thing to do is let the Third-Party Python installer put > Python 2.4 in /usr/local/bin and then ensure your $PATH place /usr/ > local/bin before /usr/bin sequentially thus causing the Python 2.4 > to be found first when searching for the 'python' command. In this > way, 'things' expecting to find Python 2.3 using absolute paths of / > usr/bin and Apple's installation don't break. While 'things' > created to utilize Python 2.4 in /usr/local/bin function as > expected. I, while no 'power-user', have been using this scheme > successfully fr months now with no undesirable side effects so far. > > Daniel > > "Ever tried. Ever failed. No matter. Try again. Fail again. Fail > better." > ?Samuel Beckett > > > > From strawman at astraw.com Tue May 16 06:49:02 2006 From: strawman at astraw.com (Andrew Straw) Date: Mon, 15 May 2006 21:49:02 -0700 Subject: [Pythonmac-SIG] Carbon/QuickTime help In-Reply-To: References: Message-ID: <446959BE.4060901@astraw.com> You could leverage off the work I've recently done with ctypes and QuickTime. Here's part of the code, you should be able to find the rest from there: http://visionegg.org/cgi-bin/viewcvs.cgi/trunk/visionegg/src/qtmovie.py?rev=1375&view=markup Caveats: I don't know how well this will work on the Mac at this point -- I wrote the ctypes stuff to get it working on Windows and probably broke the Mac stuff, which used the quicktime module included with MacPython. It would be great to make a ctypes/QuickTime interface (semi)-automatically from the header files, but my needs were too minimal to invest the effort. I don't know how well this will work with a universal binary. Scotty Vercoe wrote: >I am building a media application for OS X, using QuickTime to >display a movie file with a different audio track. Both my audio and >video threads are working fine, but I need to be able to load movie >segments, given start time and duration (or end time). > >To accomplish this, should I... >1) load the segment instead of the entire movie file, or >2) load the movie file, then specify the start/end times > >What Qt components are necessary? Does anyone know any (even >preliminary) documentation for the undocumented Carbon modules? other >resources? > >Thanks in advance! >Scotty >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG at python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > From monsterkodi at gmx.net Tue May 16 11:04:59 2006 From: monsterkodi at gmx.net (Thorsten Kohnhorst) Date: Tue, 16 May 2006 11:04:59 +0200 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> Message-ID: <446995BB.7040804@gmx.net> Marcin Komorowski wrote: > Daniel, I did let the installer put python 2.4 binaries in /usr/local/ > bin and I can change the path in my shell strartup script to pull in > the 2.4 binary, but how do I make XCode use python 2.4? I am not sure if it is the best and only solution, but I used the method described here: http://pythonmac.org/wiki/FAQ#head-30475a182e1542629d526567e3799ce8463517e6 and here: http://developer.apple.com/qa/qa2001/qa1067.html Hope that helps, Yours kodi From hengist.podd at virgin.net Tue May 16 14:01:23 2006 From: hengist.podd at virgin.net (has) Date: Tue, 16 May 2006 13:01:23 +0100 Subject: [Pythonmac-SIG] InstallApplicationEventHandler and/or InstallEventHandler In-Reply-To: <20060516014142.39268.qmail@web52112.mail.yahoo.com> References: <20060516014142.39268.qmail@web52112.mail.yahoo.com> Message-ID: don bright wrote: >I'm trying to detect when a process starts/stops. I'm >contemplating this excellent example from Apple, >'observing process lifetimes without polling' > >http://developer.apple.com/technotes/tn/tn2050.html > >However, it uses a function called >InstallApplicationEventHandler. I guess this is from >Carbon? The closest thing I can find in the python >source code is some files in _CarbonEvtModule.c: > >http://pxr.openlook.org/pxr/source/Mac/Modules/carbonevt/_CarbonEvtmodule.c > >However, I can't seem to figure out how or if I can >use it. Python's Carbon extensions tend to wrap up Carbon ADTs as Python types, although some of the wrappings can be pretty counterintuitive. In this case, InstallEventHandler is a method on the EventTargetRef type, so you need to get one of those first. Quoting from here: http://developer.apple.com/documentation/Carbon/Conceptual/Carbon_Event_Manager/Tasks/chapter_3_section_4.html """ A similar macro, InstallApplicationEventHandler, needs no parameter to identify the application itself as the target; the call InstallApplicationEventHandler (handlerUPP, numTypes, typeList, userData, &handlerRef); is equivalent to theTarget = GetApplicationEventTarget(); InstallEventHandler (theTarget, handlerUPP, numTypes, typeList, userData, &handlerRef); """ So start with Carbon.CarbonEvt.GetApplicationEventTarget() and work from there. Another option would be to use use PyObjC, of course. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From marcink at ieee.org Tue May 16 14:49:08 2006 From: marcink at ieee.org (Marcin Komorowski) Date: Tue, 16 May 2006 08:49:08 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <446995BB.7040804@gmx.net> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> <446995BB.7040804@gmx.net> Message-ID: Thanks Thorsten. OK, I think I will read the FAQ cover-to-cover so to speak before asking another question :). Cheers, Marcin On 16-May-06, at 5:04 AM, Thorsten Kohnhorst wrote: > Marcin Komorowski wrote: >> Daniel, I did let the installer put python 2.4 binaries in /usr/ >> local/ bin and I can change the path in my shell strartup script >> to pull in the 2.4 binary, but how do I make XCode use python 2.4? > I am not sure if it is the best and only solution, but I used the > method described here: > > http://pythonmac.org/wiki/ > FAQ#head-30475a182e1542629d526567e3799ce8463517e6 > > and here: > > http://developer.apple.com/qa/qa2001/qa1067.html > > Hope that helps, > Yours kodi From Chris.Barker at noaa.gov Tue May 16 18:48:17 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 16 May 2006 09:48:17 -0700 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> Message-ID: <446A0251.2040202@noaa.gov> Marcin Komorowski wrote: > It could be argued that if there are version > dependent scripts in OSX they really should use /usr/bin/python23 to > ensure the correct version of the interpreter. Yes, it could, and has, and it's a strong argument. > However, I will > agree, that it would not be a safe bet to rely on this. Quite right. It's not. I have never seen a vendor do it. For some bizarre reason, it seems whenever an OS vendor decides to use Python, it doesn't dawn upon them that their users might want to use it also, including different versions. So far, I've seen RedHat, IBM and Apple all do the same thing: use "python", or maybe "/usr/bin/python", and not one of them has specified the version. It's just plain weird. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Tue May 16 18:52:19 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 16 May 2006 09:52:19 -0700 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <446995BB.7040804@gmx.net> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> <446995BB.7040804@gmx.net> Message-ID: <446A0343.10109@noaa.gov> Thorsten Kohnhorst wrote: > Marcin Komorowski wrote: >> how do I make XCode use python 2.4? > I am not sure if it is the best and only solution, but I used the method > described here: > > http://pythonmac.org/wiki/FAQ#head-30475a182e1542629d526567e3799ce8463517e6 but that sets user-wide environment variables, such as PATH. There are two problems with this approach: 1) you might not want ALL apps to use /usr/local/bin first 2) XCode might be pointing to /usr/bin/python, and then PATH will have no effect. Isn't there a way to tell XCode specifically what python you want it to use? I don't use XCode, so I have no idea. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Tue May 16 18:55:17 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 16 May 2006 09:55:17 -0700 Subject: [Pythonmac-SIG] Application without py2app? In-Reply-To: <6E112029-AA97-4BF6-99D1-12FE636CDB5A@mac.com> References: <99016B66-295B-4DD7-9B04-0266000133C7@gmx.net> <6E112029-AA97-4BF6-99D1-12FE636CDB5A@mac.com> Message-ID: <446A03F5.9060306@noaa.gov> Ronald Oussoren wrote: > The best solution would be to teach SPE about application bundles, > but I don't know how hard that would be. I'm confused. Do you need to run PyObjC apps from within a bundle? Why not debug by running your scripts with pythonw, like we all do for non-gui programs, wxPython, etc. SPE (or Eclipse) should be able to do that just fine. Or are you trying to debug a problem that only shows up after you've made a bundle from your scripts? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From daniellord at mac.com Tue May 16 22:56:31 2006 From: daniellord at mac.com (Daniel Lord) Date: Tue, 16 May 2006 13:56:31 -0700 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <446A0343.10109@noaa.gov> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> <446995BB.7040804@gmx.net> <446A0343.10109@noaa.gov> Message-ID: <530D9719-F70E-4675-BDDF-FE44A60C49C5@mac.com> On May 16, 2006, at 9:52, Christopher Barker wrote: > Isn't there a way to tell XCode specifically what python you want > it to > use? I don't use XCode, so I have no idea. Since my impression is the XCode 'philosophy' to design it as a tool 'shell' using scripting to leverage command-line tools. I suspect one can go into the Python Xcode templates and modify the scripts. They are not always easy to locate through the IDE though there may be more straight-forward ways (for a UNIX developer anyway) to access and modify them. I'll take a look at this at some point, but I have not since the only part of the Xcode tool chain I use for Python/ObjC development is Interface Builder. XCode can integrate Ant for Java builds so I would think one can do it for. If worse came to worse, I suppose you could write a script to set the the Path in a shell and export it or in the OSX plist, , invoke XCode from the command line, 'do your business', and then reset everything if necessary with another script. A bit of a hack, but perhaps it could be made fairly painless. Question for the group: if I modify the environment through os.environ ['PATH'], will Finder applications pick that up or is it just for the shell? Yes I need to RTFM and try it, but this is a stream-of- consciousness email over lunch and I have a full plate for this afternoon. Besides, what's a community for anyway? ;-) Daniel "Few people are capable of expressing with equanimity opinions which differ from the prejudices of their social environment. Most people are not even capable of forming such opinions." - Einstein From daniellord at mac.com Wed May 17 00:35:06 2006 From: daniellord at mac.com (Daniel Lord) Date: Tue, 16 May 2006 15:35:06 -0700 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> <446995BB.7040804@gmx.net> Message-ID: <127F43F8-C9C1-4F69-82B2-C149DC36A502@mac.com> On May 16, 2006, at 5:49, Marcin Komorowski wrote: > Thanks Thorsten. > > OK, I think I will read the FAQ cover-to-cover so to speak before > asking another question :). Now _that's_ good Mac Python Community citizenship. Nice to know some will actually read all that hard work of so many. Thanks ;-) Daniel "I have never won a debate with an ignorant person." -Ali ibn Abi Talib From janssen at parc.com Wed May 17 01:00:20 2006 From: janssen at parc.com (Bill Janssen) Date: Tue, 16 May 2006 16:00:20 PDT Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: Your message of "Tue, 16 May 2006 15:35:06 PDT." <127F43F8-C9C1-4F69-82B2-C149DC36A502@mac.com> Message-ID: <06May16.160021pdt."58641"@synergy1.parc.xerox.com> > > OK, I think I will read the FAQ cover-to-cover so to speak before > > asking another question :). > > Now _that's_ good Mac Python Community citizenship. Of course, it's a Wiki, so the next question is: Have you read it lately? Bill From brownr at ucalgary.ca Wed May 17 01:42:58 2006 From: brownr at ucalgary.ca (Robert Brown) Date: Tue, 16 May 2006 17:42:58 -0600 Subject: [Pythonmac-SIG] Building Numeric or Numpy Universal Message-ID: <98F91123-5C55-4348-B6D6-268D6524D0E8@ucalgary.ca> I've installed the universal Python on my Macbook Pro... now I want to build either (preferably both) Numeric and Numpy. I tried "python setup.py build" but I get errors. It looks like all the standard C/+ + includes aren't found, including stdio.h. Building a hello world program works fine. Any ideas? Is this a problem with the universal Python package? --------------------------------------------------- Robb Brown Seaman Family MR Research Centre Calgary, Alberta, Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060516/bd6f547f/attachment.htm From daniellord at mac.com Wed May 17 02:07:32 2006 From: daniellord at mac.com (Daniel Lord) Date: Tue, 16 May 2006 17:07:32 -0700 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <06May16.160021pdt.58641@synergy1.parc.xerox.com> References: <06May16.160021pdt.58641@synergy1.parc.xerox.com> Message-ID: On May 16, 2006, at 16:00, Bill Janssen wrote: >>> OK, I think I will read the FAQ cover-to-cover so to speak before >>> asking another question :). >> >> Now _that's_ good Mac Python Community citizenship. > > Of course, it's a Wiki, so the next question is: Have you read it > lately? > > Bill I read it when I have a problem to solve. Maybe, you are hinting, I should read it like a newspaper on a regular schedule? Oh, would that I had the time, the time yes, the time. To devote one's life to all things Pythonic, now that would be something ;-) Daniel "Ever tried. Ever failed. No matter. Try again. Fail again. Fail better." ?Samuel Beckett From monsterkodi at gmx.net Wed May 17 02:13:48 2006 From: monsterkodi at gmx.net (Thorsten Kohnhorst) Date: Wed, 17 May 2006 02:13:48 +0200 Subject: [Pythonmac-SIG] Application without py2app? In-Reply-To: <446A03F5.9060306@noaa.gov> References: <99016B66-295B-4DD7-9B04-0266000133C7@gmx.net> <6E112029-AA97-4BF6-99D1-12FE636CDB5A@mac.com> <446A03F5.9060306@noaa.gov> Message-ID: <5244BBDA-974E-4C58-84BC-7528EDAA1C47@gmx.net> Hello Chris, > Ronald Oussoren wrote: >> The best solution would be to teach SPE about application bundles, >> but I don't know how hard that would be. > > I'm confused. Do you need to run PyObjC apps from within a bundle? Why > not debug by running your scripts with pythonw, like we all do for > non-gui programs, wxPython, etc. SPE (or Eclipse) should be able to do > that just fine. > > Or are you trying to debug a problem that only shows up after you've > made a bundle from your scripts? I am writing an application that is quite GUI centered. Being able to break at arbitrary methods helps me to understand the "flow" of all the notifications and delegate invocations and examine the state of the system at a certain point of time or event. Since the GUI is created with Interface Builder and not programmatically I have to start it from a bundle because the AppKit/Cocoa classes depend on it. At least thats how I understand it so far. I hope that answers your question, yours kodi From marcink at ieee.org Wed May 17 02:43:54 2006 From: marcink at ieee.org (Marcin Komorowski) Date: Tue, 16 May 2006 20:43:54 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: References: Message-ID: > (...) since the only part of the Xcode tool chain I use for Python/ > ObjC development is Interface Builder. > Hey Daniel, What do you than use for your Python/ObjC development on a Mac? Thanks, Marcin From brownr at ucalgary.ca Wed May 17 03:48:07 2006 From: brownr at ucalgary.ca (Robert Brown) Date: Tue, 16 May 2006 19:48:07 -0600 Subject: [Pythonmac-SIG] Building Numeric or Numpy Universal In-Reply-To: <98F91123-5C55-4348-B6D6-268D6524D0E8@ucalgary.ca> References: <98F91123-5C55-4348-B6D6-268D6524D0E8@ucalgary.ca> Message-ID: Never mind... I was apparently too quick to hit the send button. I discovered Bob's article on the state of Universal Python and the note to make sure you install the Universal SDK. That fixes things. On 16-May-06, at 5:42 PM, Robert Brown wrote: > I've installed the universal Python on my Macbook Pro... now I want > to build either (preferably both) Numeric and Numpy. I tried > "python setup.py build" but I get errors. It looks like all the > standard C/++ includes aren't found, including stdio.h. > > Building a hello world program works fine. > > Any ideas? Is this a problem with the universal Python package? > > > --------------------------------------------------- > Robb Brown > Seaman Family MR Research Centre > Calgary, Alberta, Canada > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig --------------------------------------------------- Robb Brown Seaman Family MR Research Centre Calgary, Alberta, Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060516/f8e7d74e/attachment.htm From zbir at urbanape.com Wed May 17 03:50:52 2006 From: zbir at urbanape.com (Zachery Bir) Date: Tue, 16 May 2006 21:50:52 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: References: Message-ID: <9A48D2BA-D92C-4406-8191-83B1671C782E@urbanape.com> On May 16, 2006, at 8:43 PM, Marcin Komorowski wrote: >> (...) since the only part of the Xcode tool chain I use for Python/ >> ObjC development is Interface Builder. > > Hey Daniel, > > What do you than use for your Python/ObjC development on a Mac? Can't speak for Daniel, but I do all my development in Interface Builder and Carbon Emacs. Zac From marcink at ieee.org Wed May 17 04:27:08 2006 From: marcink at ieee.org (Marcin Komorowski) Date: Tue, 16 May 2006 22:27:08 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <9A48D2BA-D92C-4406-8191-83B1671C782E@urbanape.com> References: <9A48D2BA-D92C-4406-8191-83B1671C782E@urbanape.com> Message-ID: <50EE5366-33C4-4E42-9C36-A84A34331D9C@ieee.org> What about PyOXIDE or just outright Eclipse? Marcin On 16-May-06, at 9:50 PM, Zachery Bir wrote: > On May 16, 2006, at 8:43 PM, Marcin Komorowski wrote: > >>> (...) since the only part of the Xcode tool chain I use for Python/ >>> ObjC development is Interface Builder. >> >> Hey Daniel, >> >> What do you than use for your Python/ObjC development on a Mac? > > Can't speak for Daniel, but I do all my development in Interface > Builder and Carbon Emacs. > > Zac From zbir at urbanape.com Wed May 17 04:42:20 2006 From: zbir at urbanape.com (Zachery Bir) Date: Tue, 16 May 2006 22:42:20 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <50EE5366-33C4-4E42-9C36-A84A34331D9C@ieee.org> References: <9A48D2BA-D92C-4406-8191-83B1671C782E@urbanape.com> <50EE5366-33C4-4E42-9C36-A84A34331D9C@ieee.org> Message-ID: <03D054A4-49F7-4459-B22E-F2A178E42D87@urbanape.com> On May 16, 2006, at 10:27 PM, Marcin Komorowski wrote: > What about PyOXIDE or just outright Eclipse? Never used either. I just don't work too well inside an IDE. Zac From saggau at gmail.com Wed May 17 04:58:54 2006 From: saggau at gmail.com (Saggau) Date: Tue, 16 May 2006 22:58:54 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <446A0343.10109@noaa.gov> References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> <446995BB.7040804@gmx.net> <446A0343.10109@noaa.gov> Message-ID: I've had some success editing the custom build command in Xcode under the Project -> Edit Active Target Build Tool: /usr/bin/env Arguments: python2.3 "$(SOURCE_ROOT)/setup.py" py2app --alias This gives me python2.3 when I want to go that route. I usually don't need it to use python2.3 now that I've got python2.4 to compile without using dynload_next... but that's a horse of a different color. On 5/16/06, Christopher Barker wrote: > > Thorsten Kohnhorst wrote: > > Marcin Komorowski wrote: > >> how do I make XCode use python 2.4? > > I am not sure if it is the best and only solution, but I used the method > > described here: > > > > > http://pythonmac.org/wiki/FAQ#head-30475a182e1542629d526567e3799ce8463517e6 > > but that sets user-wide environment variables, such as PATH. There are > two problems with this approach: > > 1) you might not want ALL apps to use /usr/local/bin first > > 2) XCode might be pointing to /usr/bin/python, and then PATH will have > no effect. > > Isn't there a way to tell XCode specifically what python you want it to > use? I don't use XCode, so I have no idea. > > -Chris > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > NOAA/OR&R/HAZMAT (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060516/a4a9a6cd/attachment.html From marcink at ieee.org Wed May 17 05:28:52 2006 From: marcink at ieee.org (Marcin Komorowski) Date: Tue, 16 May 2006 23:28:52 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <03D054A4-49F7-4459-B22E-F2A178E42D87@urbanape.com> References: <9A48D2BA-D92C-4406-8191-83B1671C782E@urbanape.com> <50EE5366-33C4-4E42-9C36-A84A34331D9C@ieee.org> <03D054A4-49F7-4459-B22E-F2A178E42D87@urbanape.com> Message-ID: On 16-May-06, at 10:42 PM, Zachery Bir wrote: > On May 16, 2006, at 10:27 PM, Marcin Komorowski wrote: > >> What about PyOXIDE or just outright Eclipse? > > Never used either. I just don't work too well inside an IDE. Hehe... I know what you mean. I have been using VIM for all of my coding (and much Much MUCH more) for over ten years now, and having the power of an advanced text editor under your fingertips, where you do not have to think about how to do the editing, just what you want to do, in unparalleled. However, I have seen a python IDE in action, with a built-in object explorer, where for any object it lists the available methods/ properties on the fly, and since I am just learning python this seams rather attractive. My friends also keep on telling me that once I experience 'refactoring' in a modern IDE, I will not want to go back. I am torn between all the benefits that modern IDEs seam to offer and the simplicity and power of a good text editor like VIM (or Emacs). Before "getting enlightened" and buying a Mac I looked into Eclipse, and it seams to be promising a balance between the two - it support advanced 'IDE' functions for many languages including python, and there is a 'VI' editing plug-in available (there is also an Emacs plugin for Eclipse). I am yet to see how well Eclipse plays on a Mac. Cheers, Marcin From daniellord at mac.com Wed May 17 05:49:09 2006 From: daniellord at mac.com (Daniel Lord) Date: Tue, 16 May 2006 20:49:09 -0700 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: References: Message-ID: On May 16, 2006, at 17:43, Marcin Komorowski wrote: > > What do you than use for your Python/ObjC development on a Mac? Honestly, I use BBEdit as the overall text editor and I test complex Python non-GUI modules as 'stand-alone' modules using Komodo Professional (great debugger) or if they are C (rarely so far since performance is not key right now), then BBEdit/Make. I code Java as well using Ant/BBEdit. Eclipse is supposed to be great but its too much work to learn. The fable about the woodsman not stopping to sharpen his saw because he was too busy slowly cutting tress with a dull blade probably makes since and I should probably 'sharpen my saw' and learn Eclipse for Java. But I'll cling to my stone knives and bear skins a while longer if I can. So many trees and so little time ;-) Komodo is a commercial product I know but I bought Photoshop and I figured I get more use out of Komodo so I might as well buy it. No regrets. What Larry Wall says about his creation PERL: "there's more than one way to do it." applies here (and that's about all the PERL I'll speak in this forum lest I be banished forever;-). Seriously, there is no 'right' way. For me, IDEs like Eclipse seem to get in my way and have to be 'bent' to work with Python in particular. While I am sure one can craft a very productive environment from those tools, I just keep it simple. I use BBEdit for XHTML/CSS also. It is familiar and I just like it. No Dreamweaver just an advanced text editor. That's why some use Emacs--its familiar, powerful enough, and they just like it. Just find what is most efficient for you. There is no 'right' answer as far as most choices in tools. Vive la difference. From just at letterror.com Wed May 17 08:40:13 2006 From: just at letterror.com (Just van Rossum) Date: Wed, 17 May 2006 08:40:13 +0200 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: Message-ID: Marcin Komorowski wrote: > > (...) since the only part of the Xcode tool chain I use for Python/ > > ObjC development is Interface Builder. > > > > Hey Daniel, > > What do you than use for your Python/ObjC development on a Mac? TextMate + Terminal + py2app. Oh wait, my name's not Daniel. Never mind! :) Just From piet at cs.uu.nl Wed May 17 11:33:06 2006 From: piet at cs.uu.nl (Piet van Oostrum) Date: Wed, 17 May 2006 11:33:06 +0200 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: <530D9719-F70E-4675-BDDF-FE44A60C49C5@mac.com> (Daniel Lord's message of "Tue, 16 May 2006 13:56:31 -0700") References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> <446995BB.7040804@gmx.net> <446A0343.10109@noaa.gov> <530D9719-F70E-4675-BDDF-FE44A60C49C5@mac.com> Message-ID: >>>>> Daniel Lord (DL) wrote: >DL> Question for the group: if I modify the environment through os.environ >DL> ['PATH'], will Finder applications pick that up or is it just for the >DL> shell? Yes I need to RTFM and try it, but this is a stream-of- >DL> consciousness email over lunch and I have a full plate for this >DL> afternoon. Besides, what's a community for anyway? ;-) Changes to os.environ only apply to the process in which it will be executed and to its children. This applies to all changes to the environment variables, no matter how they are accomplished. So to set the environment for the Finder can only be done before (or while) launching the Finder. -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: piet at vanoostrum.org From daniellord at mac.com Wed May 17 17:11:05 2006 From: daniellord at mac.com (Daniel Lord) Date: Wed, 17 May 2006 08:11:05 -0700 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: References: <8D11D4E8-57FC-4764-890E-E06088405D8E@ieee.org> <84E7F150-0A81-42CB-91BB-67A34B51DDD7@mac.com> <3DAC5E31-A7EF-4248-A08E-EA5ECE9E3E60@redivi.com> <3F10AD43-19D5-4067-A124-F3CEC0888CA8@ieee.org> <446995BB.7040804@gmx.net> <446A0343.10109@noaa.gov> <530D9719-F70E-4675-BDDF-FE44A60C49C5@mac.com> Message-ID: <34417225-75B6-4A94-80D7-BDADDF27B88B@mac.com> On May 17, 2006, at 2:33, Piet van Oostrum wrote: >>>>>> Daniel Lord (DL) wrote: > >> DL> Question for the group: if I modify the environment through >> os.environ >> DL> ['PATH'], will Finder applications pick that up or is it just >> for the >> DL> shell? Yes I need to RTFM and try it, but this is a stream-of- >> DL> consciousness email over lunch and I have a full plate for this >> DL> afternoon. Besides, what's a community for anyway? ;-) > > Changes to os.environ only apply to the process in which it will be > executed and to its children. This applies to all changes to the > environment variables, no matter how they are accomplished. So to > set the > environment for the Finder can only be done before (or while) > launching the > Finder. Piet thanks, but I knew that about environment UNIX inheritance my questions is bit more arcane and I'll have to research it myself because I am ignorant in this area (I suppsoe the documentation for Launch Services or something has the answer right up front): If I launch an app from the shell with the 'open' command , not by double-clicking in the FInder, which environment is used: the Finder's or the Shells or is there some combination of the two with some mapping and precedence scheme? That's what I meant to ask ;-) (the Real daniel, not 'just' a Dutch impostor ;-) Daniel From woklist at kyngchaos.com Thu May 18 05:29:03 2006 From: woklist at kyngchaos.com (William Kyngesburye) Date: Wed, 17 May 2006 22:29:03 -0500 Subject: [Pythonmac-SIG] customize distutils universal extension build? Message-ID: <058F385F-E23A-49C4-AA55-2C32C4E656AF@kyngchaos.com> Is there some way to customize or override the build flags for building a Python extension (a C library wrapper)? My main problem is that it adds the -g debug flag, ballooning the size of the module. I want to build WITHOUT the -g flag. Here's what I get from running the setup.py for the extension: compile: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd - fno-common -dynamic -DNDEBUG -g -O3 ... ... link: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup ... Note that I'm just building this extension, I don't do any of the programming for it, and I haven't got around to learning much Python yet (someday...). ----- William Kyngesburye http://www.kyngchaos.com/ "Oh, look, I seem to have fallen down a deep, dark hole. Now what does that remind me of? Ah, yes - life." - Marvin From ronaldoussoren at mac.com Thu May 18 09:14:01 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 18 May 2006 09:14:01 +0200 Subject: [Pythonmac-SIG] customize distutils universal extension build? In-Reply-To: <058F385F-E23A-49C4-AA55-2C32C4E656AF@kyngchaos.com> References: <058F385F-E23A-49C4-AA55-2C32C4E656AF@kyngchaos.com> Message-ID: On 18-mei-2006, at 5:29, William Kyngesburye wrote: > Is there some way to customize or override the build flags for > building a Python extension (a C library wrapper)? > > My main problem is that it adds the -g debug flag, ballooning the > size of the module. I want to build WITHOUT the -g flag. It is possible to add additonal flags, but that won't help you because you want to remove an existing flag and that is not possible. GCC also doesn't have a flag that negates the -g flag. If you want to remove the debugging information you can use the strip command to remove this from the compiled extension. But, why do care about the size of the compiled extension? Disk space is cheap these days ;-). Furthermore, if you redistribute the extension as part of an applicationt that is build using py2app the extension will be stripped when it is stuffed inside the application bundle. Ronald From woklist at kyngchaos.com Thu May 18 16:11:21 2006 From: woklist at kyngchaos.com (William Kyngesburye) Date: Thu, 18 May 2006 09:11:21 -0500 Subject: [Pythonmac-SIG] customize distutils universal extension build? In-Reply-To: References: <058F385F-E23A-49C4-AA55-2C32C4E656AF@kyngchaos.com> Message-ID: On May 18, 2006, at 2:14 AM, Ronald Oussoren wrote: > > On 18-mei-2006, at 5:29, William Kyngesburye wrote: > >> Is there some way to customize or override the build flags for >> building a Python extension (a C library wrapper)? >> >> My main problem is that it adds the -g debug flag, ballooning the >> size of the module. I want to build WITHOUT the -g flag. > > It is possible to add additonal flags, but that won't help you > because you want to remove an existing flag and that is not > possible. GCC also doesn't have a flag that negates the -g flag. > > If you want to remove the debugging information you can use the > strip command to remove this from the compiled extension. > I've had mostly bad luck with stripping libraries - it would sometimes create an unstable or broken library. I'd prefer not using -g in the first place. Is there maybe a python config file with the flags that distutils uses? I looked around a bit in the framework but didn't see anything. Or is that built into the python binary/library? > But, why do care about the size of the compiled extension? Disk > space is cheap these days ;-). Disk space is cheap, but not always download bandwidth. I build and package this for others. And I'm a frugal person and like things compact, with little bloat. One library I've built was a difference of 20MB with debug or 2MB optimized (and that's one of those where I had problems stripping it). An application (in constant development) was something like 150MB or 35MB. Add to that the doubling affect of universal builds now... > Furthermore, if you redistribute the extension as part of an > applicationt that is build using py2app the extension will be > stripped when it is stuffed inside the application bundle. > It's not really meant for application use, but as a part of using Python for web serving. Another reason for being small - less to load, and reload..., into memory for the webserver. Tho that's an interesting possibility - I've seen a question about that on the software's mailing list before. ----- William Kyngesburye http://www.kyngchaos.com/ "Time is an illusion - lunchtime doubly so." - Ford Prefect From ronaldoussoren at mac.com Thu May 18 16:36:15 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 18 May 2006 16:36:15 +0200 Subject: [Pythonmac-SIG] customize distutils universal extension build? In-Reply-To: References: <058F385F-E23A-49C4-AA55-2C32C4E656AF@kyngchaos.com> Message-ID: <1BABA25A-8C15-4A12-AFCB-3AE7572B19FA@mac.com> On 18-mei-2006, at 16:11, William Kyngesburye wrote: > > On May 18, 2006, at 2:14 AM, Ronald Oussoren wrote: > >> >> On 18-mei-2006, at 5:29, William Kyngesburye wrote: >> >>> Is there some way to customize or override the build flags for >>> building a Python extension (a C library wrapper)? >>> >>> My main problem is that it adds the -g debug flag, ballooning the >>> size of the module. I want to build WITHOUT the -g flag. >> >> It is possible to add additonal flags, but that won't help you >> because you want to remove an existing flag and that is not >> possible. GCC also doesn't have a flag that negates the -g flag. >> >> If you want to remove the debugging information you can use the >> strip command to remove this from the compiled extension. >> > I've had mostly bad luck with stripping libraries - it would > sometimes create an unstable or broken library. I'd prefer not > using -g in the first place. > > Is there maybe a python config file with the flags that distutils > uses? I looked around a bit in the framework but didn't see > anything. Or is that built into the python binary/library? The build flags are in /Library/Frameworks/Python.framework/Versions/ Current/lib/python2.4/config/Makefile (BASECFLAGS and LDFLAGS) > > >> But, why do care about the size of the compiled extension? Disk >> space is cheap these days ;-). > > Disk space is cheap, but not always download bandwidth. I build > and package this for others. > > And I'm a frugal person and like things compact, with little > bloat. One library I've built was a difference of 20MB with debug > or 2MB optimized (and that's one of those where I had problems > stripping it). An application (in constant development) was > something like 150MB or 35MB. Add to that the doubling affect of > universal builds now... Ouch, that is a very significant difference. > > >> Furthermore, if you redistribute the extension as part of an >> applicationt that is build using py2app the extension will be >> stripped when it is stuffed inside the application bundle. >> > It's not really meant for application use, but as a part of using > Python for web serving. Another reason for being small - less to > load, and reload..., into memory for the webserver. That's not really an issue, the loader will only load the parts of the extension that are actually used, which excludes debugging information. Ronald From woklist at kyngchaos.com Thu May 18 17:14:50 2006 From: woklist at kyngchaos.com (William Kyngesburye) Date: Thu, 18 May 2006 10:14:50 -0500 Subject: [Pythonmac-SIG] customize distutils universal extension build? In-Reply-To: <1BABA25A-8C15-4A12-AFCB-3AE7572B19FA@mac.com> References: <058F385F-E23A-49C4-AA55-2C32C4E656AF@kyngchaos.com> <1BABA25A-8C15-4A12-AFCB-3AE7572B19FA@mac.com> Message-ID: On May 18, 2006, at 9:36 AM, Ronald Oussoren wrote: > > On 18-mei-2006, at 16:11, William Kyngesburye wrote: > >> >> On May 18, 2006, at 2:14 AM, Ronald Oussoren wrote: >> >>> >>> On 18-mei-2006, at 5:29, William Kyngesburye wrote: >>> >>>> Is there some way to customize or override the build flags for >>>> building a Python extension (a C library wrapper)? >>>> >>>> My main problem is that it adds the -g debug flag, ballooning the >>>> size of the module. I want to build WITHOUT the -g flag. >>> >>> It is possible to add additonal flags, but that won't help you >>> because you want to remove an existing flag and that is not >>> possible. GCC also doesn't have a flag that negates the -g flag. >>> >>> If you want to remove the debugging information you can use the >>> strip command to remove this from the compiled extension. >>> >> I've had mostly bad luck with stripping libraries - it would >> sometimes create an unstable or broken library. I'd prefer not >> using -g in the first place. >> >> Is there maybe a python config file with the flags that distutils >> uses? I looked around a bit in the framework but didn't see >> anything. Or is that built into the python binary/library? > > The build flags are in /Library/Frameworks/Python.framework/ > Versions/Current/lib/python2.4/config/Makefile (BASECFLAGS and > LDFLAGS) So, distutils loads the flags from that makefile? Didn't think of that. I'll give it a try tonight. thanks >> And I'm a frugal person and like things compact, with little >> bloat. One library I've built was a difference of 20MB with debug >> or 2MB optimized (and that's one of those where I had problems >> stripping it). An application (in constant development) was >> something like 150MB or 35MB. Add to that the doubling affect of >> universal builds now... >> > > Ouch, that is a very significant difference. yeah. Though this python extension isn't so bad - 3.5MB vs. 2MB (judging from the CGI and PHP versions of the library), universal. ----- William Kyngesburye http://www.kyngchaos.com/ Theory of the Universe There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened. -Hitchhiker's Guide to the Galaxy 2nd season intro From troy_lists at rpsystems.net Thu May 18 18:53:00 2006 From: troy_lists at rpsystems.net (Troy Rollins) Date: Thu, 18 May 2006 12:53:00 -0400 Subject: [Pythonmac-SIG] Status of PyObjC port to Intel OS X In-Reply-To: References: Message-ID: <65C532FE-9D7B-45E5-B157-A5F32EC33453@rpsystems.net> On May 16, 2006, at 11:49 PM, Daniel Lord wrote: > Komodo is a commercial product I know but I bought Photoshop and I > figured I get more use out of Komodo so I might as well buy it. No > regrets. I have to agree. Komodo is a pretty sweet IDE. Eclipse is kind of a pig on the Mac, Komodo flies, and has the best tools for dynamic languages of any IDE - without being slowed down by unneeded features. And the debugger is top-notch. Just a satisfied user who trial-tested every available choice on the Mac. -- Troy RPSystems, Ltd. http://www.rpsystems.net From ronaldoussoren at mac.com Fri May 19 15:51:13 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 19 May 2006 15:51:13 +0200 Subject: [Pythonmac-SIG] tkinter and tcl console window Message-ID: Hi, Does anyone here know how I can surpress the annoying feature for aqua tk to open a tcl console window when stdin is an empty file. This feature results in an additional window when opening IDLE.app... If all else fails I'll implement an awful hack, but I'd like to find the proper solution first. The aqua tk FAQ page doesn't mention such a solution though. Ronald From kw at kevin-walzer.com Fri May 19 16:12:41 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Fri, 19 May 2006 10:12:41 -0400 Subject: [Pythonmac-SIG] tkinter and tcl console window In-Reply-To: References: Message-ID: <446DD259.3040303@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ronald Oussoren wrote: > Hi, > > Does anyone here know how I can surpress the annoying feature for > aqua tk to open a tcl console window when stdin is an empty file. > This feature results in an additional window when opening IDLE.app... In Tcl, the command is "console hide." Apparently others have had this question as well. I ran across this Python snippet on the Pythonmac list via Google: if hasattr(sys, 'frozen'): app.top.tk.call('console', 'hide') (see http://mail.python.org/pipermail/pythonmac-sig/2005-November/015375.html for details) Perhaps this could be a starting point for you. > > If all else fails I'll implement an awful hack, but I'd like to find > the proper solution first. The aqua tk FAQ page doesn't mention such > a solution though. > Re: the Aqua Tk FAQ--are you referring to http://wiki.tcl.tk/12987? There's a reference there to "console show," but not "console hide." I'll update that later today--thanks for pointing it out. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEbdJYrTC5hIgjqTMRAvWnAJ9pWxByWK1swSuDhuYTszR9eXpwggCfa/Mv 3Ujn/D5YzG9k0DfXGBxGOsc= =Pj2x -----END PGP SIGNATURE----- From ronaldoussoren at mac.com Fri May 19 16:26:58 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 19 May 2006 16:26:58 +0200 Subject: [Pythonmac-SIG] tkinter and tcl console window In-Reply-To: <446DD259.3040303@kevin-walzer.com> References: <446DD259.3040303@kevin-walzer.com> Message-ID: <2FB9A82A-D746-4AE2-8AE9-D628E237A2C3@mac.com> On 19-mei-2006, at 16:12, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Ronald Oussoren wrote: >> Hi, >> >> Does anyone here know how I can surpress the annoying feature for >> aqua tk to open a tcl console window when stdin is an empty file. >> This feature results in an additional window when opening IDLE.app... > > In Tcl, the command is "console hide." > > Apparently others have had this question as well. I ran across this > Python snippet on the Pythonmac list via Google: > > if hasattr(sys, 'frozen'): > app.top.tk.call('console', 'hide') Thanks for that. I had already implemented my awful hack: sneakily ensure that sys.stdin points to the current script, that way tk won't think it has to show the console :-). I'm going to replace my hack with this suggestion. > > (see > http://mail.python.org/pipermail/pythonmac-sig/2005-November/ > 015375.html > for details) > > Perhaps this could be a starting point for you. > > >> >> If all else fails I'll implement an awful hack, but I'd like to find >> the proper solution first. The aqua tk FAQ page doesn't mention such >> a solution though. >> > > Re: the Aqua Tk FAQ--are you referring to http://wiki.tcl.tk/12987? > There's a reference there to "console show," but not "console hide." > I'll update that later today--thanks for pointing it out. That's the one I meant. Now that I have the attention of someone that actually knows something about tk :-)... This[1] document mentions I can implement support for open events by implementing the tk function ::tk::mac::OpenDocument. Do you know how I can implement such a function in python? And a last question for now: is the look&feel of the latest tcltkaqua universal release[2] more OSX-HIG compliant than the version shipped with OSX? The L&F of IDLE really sucks right now, I have fixed the easy things (menus, statusbar) in my local tree, but know to little of tkinter/tcltkaqua to fix the rest (dialogs without title bars, foreign looking tabbed view in the preferences window, window background isn't striped, ...) in a reasonable time. Ronald [1] http://tk-components.sourceforge.net/aquify/index.html [2] I have downloaded but not yet installed: tk-installer- universal-8.4.13.pkg.dmg From kw at kevin-walzer.com Fri May 19 18:26:55 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Fri, 19 May 2006 12:26:55 -0400 Subject: [Pythonmac-SIG] tkinter and tcl console window In-Reply-To: <2FB9A82A-D746-4AE2-8AE9-D628E237A2C3@mac.com> References: <446DD259.3040303@kevin-walzer.com> <2FB9A82A-D746-4AE2-8AE9-D628E237A2C3@mac.com> Message-ID: <446DF1CF.4010604@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ronald Oussoren wrote: > > I'm going to replace my hack with this suggestion. Glad that worked. > > Now that I have the attention of someone that actually knows something > about tk :-)... This[1] document mentions I can implement support for > open events by implementing the tk function ::tk::mac::OpenDocument. Do > you know how I can implement such a function in python? I don't know the exact Python code, but the way I do this in Tcl is to define a procedure that opens a file and then link this procedure to the ::tk::mac::OpenDocument procedure; the ::tk::mac::OpenDocument call passes a list of files dropped on the Wish app icon to the actual code that opens and loads your documents. It looks something like this: proc openFile {file} { #do stuff here } proc ::tk::mac::OpenDocument {file} { openFile $file } Perhaps you could use something like this to wrap the raw Tk command: def macOpenDocument: app.top.tk.call('::tk::mac::OpenDocument') You'd still have to do the other part of the equation, that is, linking the macOpenDocument function to the other IDLE code that actually loads files for editing. Sorry if my Python isn't quite right here, but hopefully you get the idea. > > And a last question for now: is the look&feel of the latest tcltkaqua > universal release[2] more OSX-HIG compliant than the version shipped > with OSX? The L&F of IDLE really sucks right now, I have fixed the easy > things (menus, statusbar) in my local tree, but know to little of > tkinter/tcltkaqua to fix the rest (dialogs without title bars, foreign > looking tabbed view in the preferences window, window background isn't > striped, ...) in a reasonable time. > There are some improvements. Text entry fields have a proper blue "focus ring" on them, and there are other little things. The other parts are do-able, but would either require either rewriting a lot of IDLE's code (to correctly map dialog boxes to HIG-conformant ones), or using a binary extension called "Tile" (included with my installer). Tile solves a lot of basic Tk's deficiencies with the HIG, including the striped background, notebook tabs, etc. I don't think Tile has really made it to Tkinter yet in terms of use; there's an alpha-level wrapper of it, but the site is chronically off-line and, to my knowledge, no applications really make use of it yet. You mentioned earlier about making IDLE more HIG-conformant. Is this the kind of stuff you had in mind? I might be able to contribute something a bit later, after a couple of other projects I'm working on are complete. But some of these changes would be so extensive (adding Tile, for instance, which would also improve the L&F on Windows) that I anticipate getting them rolled back into the main Python tree would be hard: it would require Python to ship Tile as well as Tcl/Tk, for instance. So I'm not sure how much you'd want here. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEbfHOrTC5hIgjqTMRAnG3AKCDKOATZHf1/Rsi94TwDU5CAb0LLACgnXSz bF/zZr/EaIP9Y5S2aThtO/o= =4g0j -----END PGP SIGNATURE----- From ronaldoussoren at mac.com Fri May 19 19:01:59 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 19 May 2006 19:01:59 +0200 Subject: [Pythonmac-SIG] tkinter and tcl console window In-Reply-To: <446DF1CF.4010604@kevin-walzer.com> References: <446DD259.3040303@kevin-walzer.com> <2FB9A82A-D746-4AE2-8AE9-D628E237A2C3@mac.com> <446DF1CF.4010604@kevin-walzer.com> Message-ID: On 19-mei-2006, at 18:26, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Ronald Oussoren wrote: > >> >> I'm going to replace my hack with this suggestion. > > Glad that worked. > >> >> Now that I have the attention of someone that actually knows >> something >> about tk :-)... This[1] document mentions I can implement support for >> open events by implementing the tk >> function ::tk::mac::OpenDocument. Do >> you know how I can implement such a function in python? > > I don't know the exact Python code, but the way I do this in Tcl is to > define a procedure that opens a file and then link this procedure > to the > ::tk::mac::OpenDocument procedure; the ::tk::mac::OpenDocument call > passes a list of files dropped on the Wish app icon to the actual code > that opens and loads your documents. It looks something like this: > > proc openFile {file} { > #do stuff here > } > > proc ::tk::mac::OpenDocument {file} { > openFile $file > } > Perhaps you could use something like this to wrap the raw Tk command: > > > def macOpenDocument: > app.top.tk.call('::tk::mac::OpenDocument') > > You'd still have to do the other part of the equation, that is, > linking > the macOpenDocument function to the other IDLE code that actually > loads > files for editing. > > Sorry if my Python isn't quite right here, but hopefully you get > the idea. Getting the python right is easy, learning Tk through the mostly undocumented tkinter library is worrying me :-) You're suggestion doesn't help here though, I somehow need to define a new TCL proc from python. With some code browsing I've found how do do this: def doOpenFile(*args): print *args someTkObject.createcommand("::tk::mac::OpenDocument", doOpenFile) I could have known that it would be something simple :-) > >> >> And a last question for now: is the look&feel of the latest tcltkaqua >> universal release[2] more OSX-HIG compliant than the version shipped >> with OSX? The L&F of IDLE really sucks right now, I have fixed the >> easy >> things (menus, statusbar) in my local tree, but know to little of >> tkinter/tcltkaqua to fix the rest (dialogs without title bars, >> foreign >> looking tabbed view in the preferences window, window background >> isn't >> striped, ...) in a reasonable time. >> > > There are some improvements. Text entry fields have a proper blue > "focus > ring" on them, and there are other little things. The other parts are > do-able, but would either require either rewriting a lot of IDLE's > code > (to correctly map dialog boxes to HIG-conformant ones), or using a > binary extension called "Tile" (included with my installer). Tile > solves a lot of basic Tk's deficiencies with the HIG, including the > striped background, notebook tabs, etc. I don't think Tile has really > made it to Tkinter yet in terms of use; there's an alpha-level wrapper > of it, but the site is chronically off-line and, to my knowledge, no > applications really make use of it yet. > You mentioned earlier about making IDLE more HIG-conformant. Is > this the > kind of stuff you had in mind? I might be able to contribute > something a > bit later, after a couple of other projects I'm working on are > complete. > But some of these changes would be so extensive (adding Tile, for > instance, which would also improve the L&F on Windows) that I > anticipate > getting them rolled back into the main Python tree would be hard: it > would require Python to ship Tile as well as Tcl/Tk, for instance. So > I'm not sure how much you'd want here. This is indeed the kind of changes I had in mind. But those changes sound like a lot more work that I'm willing to do. If I am going to spend significant time on fixing IDLE I might as well write my own IDE :-) There would also need to be discussion on idle-dev and/or python-dev on the Tile-related changes (and other large changes), I wouldn't know if those would fly. My guess is that nobody will object if this results in a better L&F on Windows and Linux as well. Ronald From ronaldoussoren at mac.com Fri May 19 19:44:09 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 19 May 2006 19:44:09 +0200 Subject: [Pythonmac-SIG] tkinter and tcl console window In-Reply-To: <446DF1CF.4010604@kevin-walzer.com> References: <446DD259.3040303@kevin-walzer.com> <2FB9A82A-D746-4AE2-8AE9-D628E237A2C3@mac.com> <446DF1CF.4010604@kevin-walzer.com> Message-ID: <2D7C2165-E7AC-4C03-B1FB-2CD163FB6424@mac.com> On 19-mei-2006, at 18:26, Kevin Walzer wrote: > > You mentioned earlier about making IDLE more HIG-conformant. Is > this the > kind of stuff you had in mind? Python patch #1491759 is the current state of my changes to IDLE. Barring the minor issue of the general L&F of plain Tk and the default keybindings I'm done :-) Ronald From monsterkodi at gmx.net Sat May 20 03:44:54 2006 From: monsterkodi at gmx.net (Thorsten Kohnhorst) Date: Sat, 20 May 2006 03:44:54 +0200 Subject: [Pythonmac-SIG] python interpreter arguments? Message-ID: <708AE7D2-D2B8-4064-A61C-C2D8BC07CDC1@gmx.net> hello, maybe somebody can help me with the following problem: is there a way to retrieve the complete arguments that where given to the (Mac)Python interpreter (from within the first script that gets executed with it)? i would like to receive the -psn_* argument that was given to the python interpreter in my custom bundle: myApp.app/Contents/MacOS/Python # the python interpreter myApp.app/Contents/Resources/myApp.py # the script that is executed by the above interpreter i hope that inserting the -psn_* argument given to the interpreter into sys.argv or NSProcessInfo arguments before calling AppHelper.runEventLoop() will register my application with the dock and the window/menu manager thanks in advance for any help, yours kodi From ronaldoussoren at mac.com Sat May 20 07:39:05 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 20 May 2006 07:39:05 +0200 Subject: [Pythonmac-SIG] python interpreter arguments? In-Reply-To: <708AE7D2-D2B8-4064-A61C-C2D8BC07CDC1@gmx.net> References: <708AE7D2-D2B8-4064-A61C-C2D8BC07CDC1@gmx.net> Message-ID: On 20-mei-2006, at 3:44, Thorsten Kohnhorst wrote: > hello, > > maybe somebody can help me with the following problem: > > is there a way to retrieve the complete arguments that where given to > the (Mac)Python interpreter (from within the first script that gets > executed with it)? > > i would like to receive the -psn_* argument that was given to the > python interpreter in my custom > bundle: > > myApp.app/Contents/MacOS/Python # the python interpreter > myApp.app/Contents/Resources/myApp.py # the script that is executed > by the above interpreter > > i hope that inserting the -psn_* argument given to the interpreter > into sys.argv or NSProcessInfo arguments > before calling AppHelper.runEventLoop() will register my application > with the dock and the window/menu manager How are you building your application bundle? I've never had problems getting my application's icon in the dock, even before using py2app. Ronald From monsterkodi at gmx.net Sun May 21 01:31:35 2006 From: monsterkodi at gmx.net (Thorsten Kohnhorst) Date: Sun, 21 May 2006 01:31:35 +0200 Subject: [Pythonmac-SIG] python interpreter arguments? Message-ID: <9C99E4AB-2DFC-4AB6-B08D-3BE4D350A454@gmx.net> Hello Ronald, >> >> maybe somebody can help me with the following problem: >> >> is there a way to retrieve the complete arguments that where given to >> the (Mac)Python interpreter (from within the first script that gets >> executed with it)? >> >> i would like to receive the -psn_* argument that was given to the >> python interpreter in my custom >> bundle: >> >> myApp.app/Contents/MacOS/Python # the python interpreter >> myApp.app/Contents/Resources/myApp.py # the script that is executed >> by the above interpreter >> >> i hope that inserting the -psn_* argument given to the interpreter >> into sys.argv or NSProcessInfo arguments >> before calling AppHelper.runEventLoop() will register my application >> with the dock and the window/menu manager >> > > > How are you building your application bundle? I've never had > problems getting my application's icon in the dock, even before > using py2app. > My bundle is a modification of a bundle that was generated by Bundlebuilder. The difference is that I don't spawn another interpreter process via os.execve but execute the interpreter with my main application script directly. Anyway, I found out that I made a false assumption. I thought that the interpreter is somehow hiding the -psn_* argument from me. But I found out that this argument is only appended if the executable in myApp.app/Contents/MacOS/ is called myApp. After renaming the interpreter I got the desired behavior. Nevertheless, thanks for your offer to help, yours kodi From isha at MIT.EDU Sun May 21 03:21:06 2006 From: isha at MIT.EDU (Ishwinder Kaur Banga) Date: Sat, 20 May 2006 21:21:06 -0400 Subject: [Pythonmac-SIG] question about ic.py on Mac OS X Message-ID: MAC OS version 10.4.6 Python Version 2.4.1 Problem is that the url is valid but the python icglue tells me that it is not found Please help Error -------------------- Traceback (most recent call last): File "dialect.py", line 166, in ? test("http://diveintopython.org/odbchelper_list.html") File "dialect.py", line 163, in test webbrowser.open_new(outfile) File "/usr/local/lib/python2.4/webbrowser.py", line 46, in open_new get().open(url, 1) File "/usr/local/lib/python2.4/webbrowser.py", line 315, in open ic.launchurl(url) File "/usr/local/lib/python2.4/plat-mac/ic.py", line 235, in launchurl return _dft_ic.launchurl(url, hint) File "/usr/local/lib/python2.4/plat-mac/ic.py", line 202, in launchurl self.ic.ICLaunchURL(hint, url, 0, len(url)) MacOS.Error: (-673, 'no URL found') ------------------- From njriley at uiuc.edu Sun May 21 07:27:14 2006 From: njriley at uiuc.edu (Nicholas Riley) Date: Sun, 21 May 2006 00:27:14 -0500 Subject: [Pythonmac-SIG] question about ic.py on Mac OS X In-Reply-To: References: Message-ID: <20060521052714.GA54934@uiuc.edu> On Sat, May 20, 2006 at 09:21:06PM -0400, Ishwinder Kaur Banga wrote: > MAC OS version 10.4.6 > Python Version 2.4.1 > > Problem is that the url is valid but the python icglue tells me that > it is not found Are you on PPC or x86? Does this happen with the current Python 2.4.3 or the built-in Python 2.3.5? Does this happen when opening URLs using Launch Services, or with Internet Config in other apps? (You can try my 'launch' tool - with the -l option it uses IC, without it, it uses LS). -- Nicholas Riley | From a.molenaar at yirdis.nl Mon May 22 08:43:57 2006 From: a.molenaar at yirdis.nl (Arjan Molenaar) Date: Mon, 22 May 2006 08:43:57 +0200 Subject: [Pythonmac-SIG] Use py2app: GTK+-based application/adding generated files/X11 Message-ID: <20060522084357.uc3foasdusg8c0ok@server> Hi, I'm maintainer of Gaphor , a UML modeling tool written in Python. Recently I'm trying to build a Mac App for this application. This seems to work for a great deal using py2app (thanks Bob). However, I have a few questions: * Does anyone have experience with packaging GTK+ applications this way? * GTK+ requires X11. How can I start X11? What's the best way to launch Gaphor inside X11? * Gaphor generates some files from its setup.py. What's the best way to add those to the application package? Thanks in advance, Arjan Molenaar From david.warde.farley at utoronto.ca Mon May 22 09:42:38 2006 From: david.warde.farley at utoronto.ca (David Warde-Farley) Date: Mon, 22 May 2006 03:42:38 -0400 Subject: [Pythonmac-SIG] Use py2app: GTK+-based application/adding generated files/X11 In-Reply-To: <20060522084357.uc3foasdusg8c0ok@server> References: <20060522084357.uc3foasdusg8c0ok@server> Message-ID: Hiya, Running the shell command open -a X11 || open -a XDarwin Will get X11 started for the majority of users (who have it installed, of course). Documentation of the open command: http://www.hmug.org/man/1/open.php There's also an open-x11 shell command that will start Apple's X11, but not people using XDarwin (which is generally users of < 10.2, if I remember correctly). I'm not sure how exactly it behaves if Apple X11 isn't installed. Of course, you want to have some fallback mechanism if this fails (to tell your users something went wrong). Gimp.app installs some custom Carbon event handlers to accomplish this, somehow (see http://gimp- app.sf.net/ ). Dave On 22-May-06, at 2:43 AM, Arjan Molenaar wrote: > Hi, > > I'm maintainer of Gaphor , a UML > modeling tool written in Python. > > Recently I'm trying to build a Mac App for this application. This > seems to work for a great deal using py2app (thanks Bob). > > However, I have a few questions: > > * Does anyone have experience with packaging GTK+ applications > this way? > > * GTK+ requires X11. How can I start X11? What's the best way to > launch > Gaphor inside X11? > > * Gaphor generates some files from its setup.py. What's the best > way to add > those to the application package? > > > Thanks in advance, > > Arjan Molenaar > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From ronaldoussoren at mac.com Mon May 22 11:05:16 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 22 May 2006 11:05:16 +0200 Subject: [Pythonmac-SIG] Use py2app: GTK+-based application/addinggenerated files/X11 In-Reply-To: References: <20060522084357.uc3foasdusg8c0ok@server> Message-ID: <12551218.1148288716836.JavaMail.ronaldoussoren@mac.com> There's also gtk-osx (http://gtk-osx.sourceforge.net/), which is a native port of GTK+. IIRC there's also another port, but the name and homepage escape me at the moment. If have no idea how well these work, but if they do work you'd get something that looks a lot more like a "real" osx application. Ronald On Monday, May 22, 2006, at 10:17AM, David Warde-Farley wrote: >Hiya, > >Running the shell command > > open -a X11 || open -a XDarwin > >Will get X11 started for the majority of users (who have it >installed, of course). > >Documentation of the open command: http://www.hmug.org/man/1/open.php > >There's also an open-x11 shell command that will start Apple's X11, >but not people using XDarwin (which is generally users of < 10.2, if >I remember correctly). I'm not sure how exactly it behaves if Apple >X11 isn't installed. > >Of course, you want to have some fallback mechanism if this fails (to >tell your users something went wrong). Gimp.app installs some custom >Carbon event handlers to accomplish this, somehow (see http://gimp- >app.sf.net/ ). > >Dave > >On 22-May-06, at 2:43 AM, Arjan Molenaar wrote: > >> Hi, >> >> I'm maintainer of Gaphor , a UML >> modeling tool written in Python. >> >> Recently I'm trying to build a Mac App for this application. This >> seems to work for a great deal using py2app (thanks Bob). >> >> However, I have a few questions: >> >> * Does anyone have experience with packaging GTK+ applications >> this way? >> >> * GTK+ requires X11. How can I start X11? What's the best way to >> launch >> Gaphor inside X11? >> >> * Gaphor generates some files from its setup.py. What's the best >> way to add >> those to the application package? >> >> >> Thanks in advance, >> >> Arjan Molenaar >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG at python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > From a.molenaar at yirdis.nl Mon May 22 11:23:10 2006 From: a.molenaar at yirdis.nl (Arjan Molenaar) Date: Mon, 22 May 2006 11:23:10 +0200 Subject: [Pythonmac-SIG] Use py2app: GTK+-based application/addinggenerated files/X11 In-Reply-To: <12551218.1148288716836.JavaMail.ronaldoussoren@mac.com> References: <20060522084357.uc3foasdusg8c0ok@server> <12551218.1148288716836.JavaMail.ronaldoussoren@mac.com> Message-ID: <20060522112310.cczlnd056ockg4k4@server> Hi Ronald, Ronald Oussoren wrote: > There's also gtk-osx (http://gtk-osx.sourceforge.net/), which is a > native port of GTK+. This is a port of GTK+ 1.0, which is not compattible with GTK+ 2. > IIRC there's also another port, but the name and homepage escape me > at the moment. If have no idea how well these work, but if they do > work you'd get something that looks a lot more like a "real" osx > application. Indeed the folks at http://developer.imendio.com/wiki/Gtk_Mac_OS_X have ported GTK+ 2 to the Mac. I have it on my still-give-it-a-try list. Regards, Arjan > Ronald > > On Monday, May 22, 2006, at 10:17AM, David Warde-Farley > wrote: > >> Hiya, >> >> Running the shell command >> >> open -a X11 || open -a XDarwin >> >> Will get X11 started for the majority of users (who have it >> installed, of course). >> >> Documentation of the open command: http://www.hmug.org/man/1/open.php >> >> There's also an open-x11 shell command that will start Apple's X11, >> but not people using XDarwin (which is generally users of < 10.2, if >> I remember correctly). I'm not sure how exactly it behaves if Apple >> X11 isn't installed. >> >> Of course, you want to have some fallback mechanism if this fails (to >> tell your users something went wrong). Gimp.app installs some custom >> Carbon event handlers to accomplish this, somehow (see http://gimp- >> app.sf.net/ ). >> >> Dave >> >> On 22-May-06, at 2:43 AM, Arjan Molenaar wrote: >> >>> Hi, >>> >>> I'm maintainer of Gaphor , a UML >>> modeling tool written in Python. >>> >>> Recently I'm trying to build a Mac App for this application. This >>> seems to work for a great deal using py2app (thanks Bob). >>> >>> However, I have a few questions: >>> >>> * Does anyone have experience with packaging GTK+ applications >>> this way? >>> >>> * GTK+ requires X11. How can I start X11? What's the best way to >>> launch >>> Gaphor inside X11? >>> >>> * Gaphor generates some files from its setup.py. What's the best >>> way to add >>> those to the application package? >>> >>> >>> Thanks in advance, >>> >>> Arjan Molenaar >>> >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > From janssen at parc.com Mon May 22 19:14:36 2006 From: janssen at parc.com (Bill Janssen) Date: Mon, 22 May 2006 10:14:36 PDT Subject: [Pythonmac-SIG] Use py2app: GTK+-based application/addinggenerated files/X11 In-Reply-To: Your message of "Mon, 22 May 2006 02:23:10 PDT." <20060522112310.cczlnd056ockg4k4@server> Message-ID: <06May22.101438pdt."58641"@synergy1.parc.xerox.com> > Indeed the folks at http://developer.imendio.com/wiki/Gtk_Mac_OS_X > have ported GTK+ 2 to the Mac. I have it on my still-give-it-a-try list. The sources for this have been folded back into the regular GTK+ source tree. But looking at the gtk-dev mailing list, it looks like it's not quite a finished product yet. Bill From janssen at parc.com Mon May 22 19:37:48 2006 From: janssen at parc.com (Bill Janssen) Date: Mon, 22 May 2006 10:37:48 PDT Subject: [Pythonmac-SIG] Use py2app: GTK+-based application/adding generated files/X11 In-Reply-To: Your message of "Sun, 21 May 2006 23:43:57 PDT." <20060522084357.uc3foasdusg8c0ok@server> Message-ID: <06May22.103753pdt."58641"@synergy1.parc.xerox.com> > * GTK+ requires X11. How can I start X11? What's the best way to launch > Gaphor inside X11? Note that by default, X11 is not available on a Mac. It's an optional install. Bill From david.warde.farley at utoronto.ca Mon May 22 21:14:52 2006 From: david.warde.farley at utoronto.ca (David Warde-Farley) Date: Mon, 22 May 2006 15:14:52 -0400 Subject: [Pythonmac-SIG] Use py2app: GTK+-based application/adding generated files/X11 In-Reply-To: <06May22.103753pdt."58641"@synergy1.parc.xerox.com> References: <06May22.103753pdt."58641"@synergy1.parc.xerox.com> Message-ID: On 22-May-06, at 1:37 PM, Bill Janssen wrote: > Note that by default, X11 is not available on a Mac. It's an > optional install. Yup, but it's easy enough to direct your users on the download page to install X11 off the Apple CDs. They're not paying anything for Gaphor so they shouldn't whine :) Lots of projects do this, like Gimp.app, Inkscape and OpenOffice. Gimp.app even themes its GTK to look Cocoa-ish, which is kind of neat. As I said earlier you might also consider putting together a little AppleScript (or PyObjC voodoo) that pops up an error dialog if X11 fails to launch. Dave From a.molenaar at yirdis.nl Tue May 23 08:31:53 2006 From: a.molenaar at yirdis.nl (Arjan Molenaar) Date: Tue, 23 May 2006 08:31:53 +0200 Subject: [Pythonmac-SIG] Use py2app: GTK+-based application/addinggenerated files/X11 In-Reply-To: <06May22.101438pdt."58641"@synergy1.parc.xerox.com> References: <06May22.101438pdt."58641"@synergy1.parc.xerox.com> Message-ID: <20060523083153.vjkkk2o6ck0skwgk@server> Bill Janssen wrote: >> Indeed the folks at http://developer.imendio.com/wiki/Gtk_Mac_OS_X >> have ported GTK+ 2 to the Mac. I have it on my still-give-it-a-try list. > > The sources for this have been folded back into the regular GTK+ > source tree. But looking at the gtk-dev mailing list, it looks like > it's not quite a finished product yet. I managed to build and install the native Mac port of GTK+. They already did a great job. I even got pygtk running on top (had to comment out some X11-specific fuctions). .. But it crashed after some interaction... I think it's a serious option, within half a year or so. Regards, Arjan > Bill > From a.molenaar at yirdis.nl Tue May 23 08:36:22 2006 From: a.molenaar at yirdis.nl (Arjan Molenaar) Date: Tue, 23 May 2006 08:36:22 +0200 Subject: [Pythonmac-SIG] Use py2app: GTK+-based application/adding generated files/X11 In-Reply-To: References: <06May22.103753pdt."58641"@synergy1.parc.xerox.com> Message-ID: <20060523083622.gjk8ii5m8soockcw@server> David Warde-Farley wrote: > On 22-May-06, at 1:37 PM, Bill Janssen wrote: > >> Note that by default, X11 is not available on a Mac. It's an >> optional install. > > Yup, but it's easy enough to direct your users on the download page to > install X11 off the Apple CDs. They're not paying anything for Gaphor > so they shouldn't whine :) Well said ;-) > Lots of projects do this, like Gimp.app, > Inkscape and OpenOffice. Gimp.app even themes its GTK to look > Cocoa-ish, which is kind of neat. > > As I said earlier you might also consider putting together a little > AppleScript (or PyObjC voodoo) that pops up an error dialog if X11 > fails to launch. That brings me back to my last question: > * Gaphor generates some files from its setup.py. What's the best > way to add those to the application package? I have to add some generated files (one of which is the data model of Gaphor) into the py2app distribution. The file is generated (as part of the build target), but is not added to the .app. What's the proper way to tell py2app to take those files into consideration? Regards, Arjan > Dave From kquirk at solidworks.com Tue May 23 14:56:45 2006 From: kquirk at solidworks.com (Kent Quirk) Date: Tue, 23 May 2006 08:56:45 -0400 Subject: [Pythonmac-SIG] py2app corrupting libraries -- patch for bug in py2app 2.5 Message-ID: This is a patch and explanation (written by one of my co-workers) related to a question I posted to this list on 5/10. We have a Python application with a number of C++ extension modules, some of which dynamically load other C++ modules, all of which reference additional C++ frameworks we've built. The module dependency graph gets complex. We've recently begun building those C++ pieces as Universal, and have upgraded to py2app 2.5 to construct a Universal app bundle. We're passing: setup( app=['blobs.py'], data_files=[...], options=dict( py2app=dict( archs="ppc,i386", ...))) However, we're getting an error of the form: Thinning /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events to ppc, i386 /usr/bin/lipo: -extract ppc specified but fat file: /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events does not contain that architecture Examining previous output shows this some 25 lines above: Thinning /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/MacOS/../Frameworks/Events.framework/Versions/A/Event s to i386 That shouldn't be happening. We inserted a test in util.thin_to_archs() to detect the case of a call that fails to specify both 'ppc' and 'i386', and tracked it back up into MachOStandalone.run(). That function constructs an archs dict that maps filenames to lists of architecture keywords. Then it looks up the architecture list for each file of interest. Among the entries in that dict are: '/Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events': ['ppc', 'i386'], ... '/Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/MacOS/../Frameworks/Events.framework/Versions/A/Event s': ['i386'], with other similar duplications. I'm guessing that it should work better to call os.path.realpath() on the filenames, both when constructing and when accessing that archs dict. For instance: *** /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac kages/py2app/macholib/MachOStandalone.py~ Thu May 18 14:26:59 2006 --- /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac kages/py2app/macholib/MachOStandalone.py Mon May 22 15:14:43 2006 *************** *** 117,130 **** mm = self.mms[arch] for node in mm.flatten(has_filename_filter): machfiles[node.filename] = node ! archs.setdefault(node.filename, []) ! archs[node.filename].append(arch) dest = os.path.join(contents, node.filename[len(skipcontents):]) changemap[node.filename] = dest for node in machfiles.itervalues(): filename = node.filename ! nodearchs = archs[node.filename] changed = False for arch in nodearchs: mm = self.mms[arch] --- 117,129 ---- mm = self.mms[arch] for node in mm.flatten(has_filename_filter): machfiles[node.filename] = node ! archs.setdefault(os.path.realpath(node.filename), []).append(arch) dest = os.path.join(contents, node.filename[len(skipcontents):]) changemap[node.filename] = dest for node in machfiles.itervalues(): filename = node.filename ! nodearchs = archs[os.path.realpath(node.filename)] changed = False for arch in nodearchs: mm = self.mms[arch] Unfortunately this starts producing: Thinning /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/Frameworks/MathUtils.framework/Versions/A/MathUtils to ppc, i386, i386 Thinning /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/MacOS/../MacOS/../Frameworks/Python.framework/Version s/2.4/Python to ppc, ppc, ppc, i386, i386, i386 /usr/bin/lipo: -extract ppc specified multiple times ValueError: Error 1 returned by: '/usr/bin/lipo' '/Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/MacOS/../MacOS/../Frameworks/Python.framework/Version s/2.4/Python' '-output' '/tmp/tmpoYncVt' '-extract' 'ppc' '-extract' 'ppc' '-extract' 'ppc' '-extract' 'i386' '-extract' 'i386' '-extract' 'i386' So maybe it would work better if, instead of a list of architectures, we were to use a set instead: *** /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac kages/py2app/macholib/MachOStandalone.py~ Thu May 18 14:26:59 2006 --- /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac kages/py2app/macholib/MachOStandalone.py Mon May 22 15:25:19 2006 *************** *** 117,130 **** mm = self.mms[arch] for node in mm.flatten(has_filename_filter): machfiles[node.filename] = node ! archs.setdefault(node.filename, []) ! archs[node.filename].append(arch) dest = os.path.join(contents, node.filename[len(skipcontents):]) changemap[node.filename] = dest for node in machfiles.itervalues(): filename = node.filename ! nodearchs = archs[node.filename] changed = False for arch in nodearchs: mm = self.mms[arch] --- 117,129 ---- mm = self.mms[arch] for node in mm.flatten(has_filename_filter): machfiles[node.filename] = node ! archs.setdefault(os.path.realpath(node.filename), set()).add(arch) dest = os.path.join(contents, node.filename[len(skipcontents):]) changemap[node.filename] = dest for node in machfiles.itervalues(): filename = node.filename ! nodearchs = list(archs[os.path.realpath(node.filename)]) changed = False for arch in nodearchs: mm = self.mms[arch] With those changes, we can now get past this problem and produce a working app bundle. Please consider incorporating some such fix into the distributed version of py2app. Thank you. From ronaldoussoren at mac.com Tue May 23 16:09:10 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 23 May 2006 16:09:10 +0200 Subject: [Pythonmac-SIG] py2app corrupting libraries -- patch for bug in py2app 2.5 In-Reply-To: References: Message-ID: <708B2E6D-28A3-40ED-A0CC-C2C624E11494@mac.com> On 23-mei-2006, at 14:56, Kent Quirk wrote: > This is a patch and explanation (written by one of my co-workers) > related to a question I posted to this list on 5/10. It might be just me, but I don't really understand why py2app tries to thin architectures in the first place. The only file it may have to thin is its own executable stub, because the OS uses that to decide if an application can run natively or not (that's not entirely true, but good enough). I want to do a new release of PyObjC soon, but want to check the universal binary support in py2app first. That code seems to have some rough edges at the moment. Ronald From Chris.Barker at noaa.gov Tue May 23 18:00:49 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 23 May 2006 09:00:49 -0700 Subject: [Pythonmac-SIG] Latest Py2app? Message-ID: <447331B1.9090901@noaa.gov> Hi all (and particularly Bob) Where can I get the latest Py2app? This page is pretty out of date: http://undefined.org/python/py2app.html It sounds like we need to do a little more testing of Py2app with the Universal build, and I'd love to do that, plus, I need it! -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From bob at redivi.com Tue May 23 18:08:15 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 23 May 2006 16:08:15 +0000 Subject: [Pythonmac-SIG] py2app corrupting libraries -- patch for bug in py2app 2.5 In-Reply-To: <708B2E6D-28A3-40ED-A0CC-C2C624E11494@mac.com> References: <708B2E6D-28A3-40ED-A0CC-C2C624E11494@mac.com> Message-ID: <7129E96C-ECFE-4FFC-A0EF-E74B786205C3@redivi.com> On May 23, 2006, at 2:09 PM, Ronald Oussoren wrote: > > On 23-mei-2006, at 14:56, Kent Quirk wrote: > >> This is a patch and explanation (written by one of my co-workers) >> related to a question I posted to this list on 5/10. > > It might be just me, but I don't really understand why py2app tries > to thin architectures in the first place. The only file it may have > to thin is its own executable stub, because the OS uses that to > decide if an application can run natively or not (that's not entirely > true, but good enough). It doesn't even need to do that, because you can specify which architecture to use by way of an Info.plist key. I didn't write any of the universal support in that branch, so I'm not sure why it's doing what it's doing. I'd like to go through it and audit or rewrite, but I won't have time until at least after the need for speed sprint. BTW: have you looked at getting ctypes to build on Mac OS X i386? I was going to take a look at ctypes performance, but I can't build it on my MacBook Pro. -bob From bob at redivi.com Tue May 23 18:10:24 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 23 May 2006 16:10:24 +0000 Subject: [Pythonmac-SIG] Latest Py2app? In-Reply-To: <447331B1.9090901@noaa.gov> References: <447331B1.9090901@noaa.gov> Message-ID: <89B2D4E5-A77D-45A7-BB51-2EFE611A85EB@redivi.com> On May 23, 2006, at 4:00 PM, Christopher Barker wrote: > Hi all (and particularly Bob) > > Where can I get the latest Py2app? > > This page is pretty out of date: > > http://undefined.org/python/py2app.html > > It sounds like we need to do a little more testing of Py2app with the > Universal build, and I'd love to do that, plus, I need it! The universal branch of py2app is most easily obtained from the PyObjC trunk. The reason the page is "out of date" is because there isn't a new release. The universal branch clearly still has a bunch of issues, but it's here in svn if you want to grab it directly: http://svn.red-bean.com/bob/py2app/branches/py2app-0.2-maint -bob From ronaldoussoren at mac.com Tue May 23 18:21:15 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 23 May 2006 18:21:15 +0200 Subject: [Pythonmac-SIG] py2app corrupting libraries -- patch for bug in py2app 2.5 In-Reply-To: <7129E96C-ECFE-4FFC-A0EF-E74B786205C3@redivi.com> References: <708B2E6D-28A3-40ED-A0CC-C2C624E11494@mac.com> <7129E96C-ECFE-4FFC-A0EF-E74B786205C3@redivi.com> Message-ID: <2E4F7133-C498-47D5-BC3F-794C7C96D28C@mac.com> On 23-mei-2006, at 18:08, Bob Ippolito wrote: > > On May 23, 2006, at 2:09 PM, Ronald Oussoren wrote: > >> >> On 23-mei-2006, at 14:56, Kent Quirk wrote: >> >>> This is a patch and explanation (written by one of my co-workers) >>> related to a question I posted to this list on 5/10. >> >> It might be just me, but I don't really understand why py2app tries >> to thin architectures in the first place. The only file it may have >> to thin is its own executable stub, because the OS uses that to >> decide if an application can run natively or not (that's not entirely >> true, but good enough). > > It doesn't even need to do that, because you can specify which > architecture to use by way of an Info.plist key. > > I didn't write any of the universal support in that branch, so I'm > not sure why it's doing what it's doing. I'd like to go through it > and audit or rewrite, but I won't have time until at least after > the need for speed sprint. I'll probably have a look this thursday. > > BTW: have you looked at getting ctypes to build on Mac OS X i386? I > was going to take a look at ctypes performance, but I can't build > it on my MacBook Pro. I haven't looked at this yet, I'm trying to keep python2.5 working first. It should be possible to use a copy of the libffi in pyobjc to get ctypes going, or at least the object files that pyobjc generates. Ronald From cwmoad at gmail.com Tue May 23 19:52:20 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Tue, 23 May 2006 13:52:20 -0400 Subject: [Pythonmac-SIG] [Matplotlib-users] Matplotlib Universal Package In-Reply-To: References: <6382066a0605031909y68721928t41c983f9541c3910@mail.gmail.com> Message-ID: <6382066a0605231052r6c5d4350p669137efda915ab0@mail.gmail.com> Yeah, mpl 0.87.2 was built with numpy 0.9.6. I don't think a new matplotlib release is in the near future unless the new numpy warrants a minor bump. - Charlie On 5/23/06, Samuel M. Smith wrote: > Charlie, > > I finally had some time to update my python matplotlib installation. > > I installed > Universal Python 2.4.3-2006-04-07.dmg > numpy 0.9.8 from source > wxPython2.6-osx-unicode-2.6.3.2rc2-universal10.4-py.2.4.dmg > wxPython2.6-osx-ansi-2.6.3.2rc2-universal10.4.py2.4.dmg > > Iipython 0.7.1.fix1 was already installed > > I tried a test of matplotlib using ipython and get a segmentation > fault. > > ipython -pylab > loaded rc file /Users/smithsm/.matplotlib/matplotlibrc > matplotlib version 0.87.2 > verbose.level helpful > interactive is False > platform is darwin > numerix numpy 0.9.8 > Segmentation fault > > I am guessing that you used a different version of numpy? > > If I just do python from terminal and import matplotlob then no > segmentation fault > > >>> import matplotlib > loaded rc file /Users/smithsm/.matplotlib/matplotlibrc > matplotlib version 0.87.2 > verbose.level helpful > interactive is False > platform is darwin > > Anybody have any ideas what is happening? > > On 03 May, 2006, at 20:09, Charlie Moad wrote: > > > I posted a universal build of matplotlib 0.87.2 on sourceforge in > > egg and mpkg format. It is compiled against the latest numarray, > > numpy, and Numeric as well as Tk and the new wxPython-rc2 > > universal. Libpng and freetype2 are statically linked in. Please > > post or link to > > either/both at "http://pythonmac.org/packages/py24-fat/". > > > > http://sourceforge.net/project/showfiles.php? > > group_id=80706&package_id=82474 > > > From smithsm at samuelsmith.org Tue May 23 19:49:22 2006 From: smithsm at samuelsmith.org (Samuel M. Smith) Date: Tue, 23 May 2006 11:49:22 -0600 Subject: [Pythonmac-SIG] [Matplotlib-users] Matplotlib Universal Package In-Reply-To: <6382066a0605031909y68721928t41c983f9541c3910@mail.gmail.com> References: <6382066a0605031909y68721928t41c983f9541c3910@mail.gmail.com> Message-ID: Charlie, I finally had some time to update my python matplotlib installation. I installed Universal Python 2.4.3-2006-04-07.dmg numpy 0.9.8 from source wxPython2.6-osx-unicode-2.6.3.2rc2-universal10.4-py.2.4.dmg wxPython2.6-osx-ansi-2.6.3.2rc2-universal10.4.py2.4.dmg Iipython 0.7.1.fix1 was already installed I tried a test of matplotlib using ipython and get a segmentation fault. ipython -pylab loaded rc file /Users/smithsm/.matplotlib/matplotlibrc matplotlib version 0.87.2 verbose.level helpful interactive is False platform is darwin numerix numpy 0.9.8 Segmentation fault I am guessing that you used a different version of numpy? If I just do python from terminal and import matplotlob then no segmentation fault >>> import matplotlib loaded rc file /Users/smithsm/.matplotlib/matplotlibrc matplotlib version 0.87.2 verbose.level helpful interactive is False platform is darwin Anybody have any ideas what is happening? On 03 May, 2006, at 20:09, Charlie Moad wrote: > I posted a universal build of matplotlib 0.87.2 on sourceforge in > egg and mpkg format. It is compiled against the latest numarray, > numpy, and Numeric as well as Tk and the new wxPython-rc2 > universal. Libpng and freetype2 are statically linked in. Please > post or link to > either/both at "http://pythonmac.org/packages/py24-fat/". > > http://sourceforge.net/project/showfiles.php? > group_id=80706&package_id=82474 > From monsterkodi at gmx.net Tue May 23 21:38:24 2006 From: monsterkodi at gmx.net (Thorsten Kohnhorst) Date: Tue, 23 May 2006 21:38:24 +0200 Subject: [Pythonmac-SIG] NSView.adjustScroll_ crashes Message-ID: <535CA3C1-D4A4-41E8-9628-599688D61676@gmx.net> Hello, I am trying to adjust the scrolling of a custom NSTableView within the adjustScroll_ method. But my App crashes sooner or later when I overwrite this method (it crashes sooner if I draw a lot of NSBezierPaths in the table cells). I tried to return a newly created NSRect as well as a tuple of tuples with the adjusted values. But both fails. If somebody had the same problems or has an idea what could possibly go wrong, please let me know. Thanks in advance for any help, yours kodi From smithsm at samuelsmith.org Wed May 24 01:48:32 2006 From: smithsm at samuelsmith.org (Samuel M. Smith) Date: Tue, 23 May 2006 17:48:32 -0600 Subject: [Pythonmac-SIG] [Matplotlib-users] Matplotlib Universal Package In-Reply-To: <6382066a0605231052r6c5d4350p669137efda915ab0@mail.gmail.com> References: <6382066a0605031909y68721928t41c983f9541c3910@mail.gmail.com> <6382066a0605231052r6c5d4350p669137efda915ab0@mail.gmail.com> Message-ID: <7E5AFBE6-F0AB-40B4-BAB5-E3E7277A1549@samuelsmith.org> So I could either regress numpy or build Matplotlib from source. Since I like being able to get the latest bug fixes for Matplotlib and the last time I build it from svn it went without a hitch, I decided to try to build Matplotlib from source. Unfortunately it didn't work this time. I get the error shown below. I have a powerbook g4 with 10.4.6 and Universal Python 2.4.3-2006-04-07.dmg. What am I missing? svn co https://svn.sourceforge.net/svnroot/matplotlib/trunk/ matplotlib matplotlib Checked out revision 2411. edit darwin path in setupext.py basedir = { 'win32' : ['win32_static',], 'linux2' : ['/usr/local', '/usr',], 'linux' : ['/usr/local', '/usr',], 'cygwin' : ['/usr/local', '/usr',], 'darwin' : ['/usr/local','/opt/local','/usr'], 'freebsd4' : ['/usr/local', '/usr'], 'freebsd5' : ['/usr/local', '/usr'], 'freebsd6' : ['/usr/local', '/usr'], 'sunos5' : [os.getenv('MPLIB_BASE') or '/usr/local',], 'gnukfreebsd5' : ['/usr/local', '/usr'], 'gnukfreebsd6' : ['/usr/local', '/usr'], } from terminal export WX_CONFIG="usr/local/lib/wxPython-ansi-2.6.3.2rc2/bin/wx-config" cd matplotlib python setup.py build gcc: src/_ns_cntr.c In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/ 2.4/include/python2.4/pyport.h:90, from /Library/Frameworks/Python.framework/Versions/ 2.4/include/python2.4/Python.h:55, from src/_ns_cntr.c:17: /usr/include/architecture/ppc/math.h:477: warning: conflicting types for built-in function 'scalb' In file included from src/_ns_cntr.c:28: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:139: error: redefinition of typedef 'ushort' /usr/include/sys/types.h:85: error: previous declaration of 'ushort' was here /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:140: error: redefinition of typedef 'uint' /usr/include/sys/types.h:86: error: previous declaration of 'uint' was here In file included from src/_ns_cntr.c:28: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:139: error: redefinition of typedef 'ushort' /usr/include/sys/types.h:85: error: previous declaration of 'ushort' was here /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:140: error: redefinition of typedef 'uint' /usr/include/sys/types.h:86: error: previous declaration of 'uint' was here lipo: can't figure out the architecture type of: /var/tmp//ccR0VtyV.out In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/ 2.4/include/python2.4/pyport.h:90, from /Library/Frameworks/Python.framework/Versions/ 2.4/include/python2.4/Python.h:55, from src/_ns_cntr.c:17: /usr/include/architecture/ppc/math.h:477: warning: conflicting types for built-in function 'scalb' In file included from src/_ns_cntr.c:28: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:139: error: redefinition of typedef 'ushort' /usr/include/sys/types.h:85: error: previous declaration of 'ushort' was here /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:140: error: redefinition of typedef 'uint' /usr/include/sys/types.h:86: error: previous declaration of 'uint' was here In file included from src/_ns_cntr.c:28: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:139: error: redefinition of typedef 'ushort' /usr/include/sys/types.h:85: error: previous declaration of 'ushort' was here /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:140: error: redefinition of typedef 'uint' /usr/include/sys/types.h:86: error: previous declaration of 'uint' was here lipo: can't figure out the architecture type of: /var/tmp//ccR0VtyV.out error: Command "gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/ MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/Library/ Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ numpy/core/include -I/usr/local/include -I/opt/local/include -I/usr/ include -I. -I/Library/Frameworks/Python.framework/Versions/2.4/ include/python2.4 -c src/_ns_cntr.c -o build/temp.macosx-10.4-fat-2.4/ src/_ns_cntr.o -DSCIPY=1" failed with exit status 1 albook:smithsm$ On 23 May, 2006, at 11:52, Charlie Moad wrote: > Yeah, mpl 0.87.2 was built with numpy 0.9.6. I don't think a new > matplotlib release is in the near future unless the new numpy warrants > a minor bump. > > - Charlie > > On 5/23/06, Samuel M. Smith wrote: >> Charlie, >> >> I finally had some time to update my python matplotlib installation. >> >> I installed >> Universal Python 2.4.3-2006-04-07.dmg >> numpy 0.9.8 from source >> wxPython2.6-osx-unicode-2.6.3.2rc2-universal10.4-py.2.4.dmg >> wxPython2.6-osx-ansi-2.6.3.2rc2-universal10.4.py2.4.dmg >> >> Iipython 0.7.1.fix1 was already installed >> >> I tried a test of matplotlib using ipython and get a segmentation >> fault. >> >> ipython -pylab >> loaded rc file /Users/smithsm/.matplotlib/matplotlibrc >> matplotlib version 0.87.2 >> verbose.level helpful >> interactive is False >> platform is darwin >> numerix numpy 0.9.8 >> Segmentation fault >> >> I am guessing that you used a different version of numpy? >> >> If I just do python from terminal and import matplotlob then no >> segmentation fault >> >> >>> import matplotlib >> loaded rc file /Users/smithsm/.matplotlib/matplotlibrc >> matplotlib version 0.87.2 >> verbose.level helpful >> interactive is False >> platform is darwin >> >> Anybody have any ideas what is happening? >> >> On 03 May, 2006, at 20:09, Charlie Moad wrote: >> >> > I posted a universal build of matplotlib 0.87.2 on >> sourceforge in >> > egg and mpkg format. It is compiled against the latest numarray, >> > numpy, and Numeric as well as Tk and the new wxPython-rc2 >> > universal. Libpng and freetype2 are statically linked in. Please >> > post or link to >> > either/both at "http://pythonmac.org/packages/py24-fat/". >> > >> > http://sourceforge.net/project/showfiles.php? >> > group_id=80706&package_id=82474 >> > >> > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost and > Risk! > Fully trained technicians. The highest number of Red Hat > certifications in > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642 > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ********************************************************************** Samuel M. Smith Ph.D. 2966 Fort Hill Road Eagle Mountain, Utah 84043 801-768-2768 voice 801-768-2769 fax ********************************************************************** "The greatest source of failure and unhappiness in the world is giving up what we want most for what we want at the moment" ********************************************************************** From smithsm at samuelsmith.org Wed May 24 03:04:44 2006 From: smithsm at samuelsmith.org (Samuel M. Smith) Date: Tue, 23 May 2006 19:04:44 -0600 Subject: [Pythonmac-SIG] [Matplotlib-users] Matplotlib Universal Package In-Reply-To: <7E5AFBE6-F0AB-40B4-BAB5-E3E7277A1549@samuelsmith.org> References: <6382066a0605031909y68721928t41c983f9541c3910@mail.gmail.com> <6382066a0605231052r6c5d4350p669137efda915ab0@mail.gmail.com> <7E5AFBE6-F0AB-40B4-BAB5-E3E7277A1549@samuelsmith.org> Message-ID: <725A7949-C84A-4FBF-8A1C-44CE4C2F59A0@samuelsmith.org> Well, I gave up. I regressed and installed numpy 0.9.6 from the package installer and looks like matplotlib works now. It sure blows my confidence when two months go by and there are enough changes that I can't install from source anymore. I would like to try again but it would be nice to know what you did to get it to work since what I did last time no longer works. Sam From robinang81 at yahoo.com.sg Wed May 24 12:18:43 2006 From: robinang81 at yahoo.com.sg (Robin Ang) Date: Wed, 24 May 2006 18:18:43 +0800 (CST) Subject: [Pythonmac-SIG] Wxsftp Message-ID: <20060524101843.37088.qmail@web38808.mail.mud.yahoo.com> Hi people, i been trying to get wxsftp to work on my mac installed with wxpython 2.6. The problem is that the program would start with a minimize window with only showing the upload and download arrows....nothing else could be seen..... i am running macosx 10.4 as well.... anyone can provide me with some solution? Any help would be appreciated Thanks Regards, Robin __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 1GB free storage! http://sg.whatsnew.mail.yahoo.com From jerry.levan at eku.edu Wed May 24 21:39:48 2006 From: jerry.levan at eku.edu (Jerry LeVan) Date: Wed, 24 May 2006 15:39:48 -0400 Subject: [Pythonmac-SIG] WhereAmI ? Message-ID: <288CB594-D83A-4317-87B5-7C71941FBB9B@eku.edu> Hi, I am porting one of my Tcl/Tk apps to Python and am having a bit of a problem with one detail. The structure of the app is that the main program sits in a folder and local resources live in a subFolder named Resources. I can easily pick up modules living in Resources, but I can't see how to find pure "data" files living in the the Resources folder. In Tcl I can find the path to a script with the info command. I tried looking at "sys.path" but the "current directory" seems to be specified by '' ( instead of the the full path name). Is there anyway I can discover the pathname of an running python script? Thanks, Jerry From jerry.levan at eku.edu Wed May 24 22:02:55 2006 From: jerry.levan at eku.edu (Jerry LeVan) Date: Wed, 24 May 2006 16:02:55 -0400 Subject: [Pythonmac-SIG] WhereAmI ? In-Reply-To: <288CB594-D83A-4317-87B5-7C71941FBB9B@eku.edu> References: <288CB594-D83A-4317-87B5-7C71941FBB9B@eku.edu> Message-ID: Sigh, Nevermind, when I looked at sys.path in an actual program the first element was actually the path to the script, not '' (got '' from the command line execution of python). Jerry On May 24, 2006, at 3:39 PM, Jerry LeVan wrote: > Hi, > > I am porting one of my Tcl/Tk apps to Python and am having > a bit of a problem with one detail. > > The structure of the app is that the main program > sits in a folder and local resources live in a > subFolder named Resources. > > I can easily pick up modules living in Resources, but > I can't see how to find pure "data" files living in the > the Resources folder. > > In Tcl I can find the path to a script with the info command. > > I tried looking at "sys.path" but the "current directory" seems > to be specified by '' ( instead of the the full path name). > > Is there anyway I can discover the pathname of an running > python script? > > Thanks, > > Jerry From alex at tweedly.net Wed May 24 22:49:28 2006 From: alex at tweedly.net (Alex Tweedly) Date: Wed, 24 May 2006 21:49:28 +0100 Subject: [Pythonmac-SIG] WhereAmI ? In-Reply-To: <288CB594-D83A-4317-87B5-7C71941FBB9B@eku.edu> References: <288CB594-D83A-4317-87B5-7C71941FBB9B@eku.edu> Message-ID: <4474C6D8.9080303@tweedly.net> Jerry LeVan wrote: >Hi, > >I am porting one of my Tcl/Tk apps to Python and am having >a bit of a problem with one detail. > >The structure of the app is that the main program >sits in a folder and local resources live in a >subFolder named Resources. > >I can easily pick up modules living in Resources, but >I can't see how to find pure "data" files living in the >the Resources folder. > >In Tcl I can find the path to a script with the info command. > >I tried looking at "sys.path" but the "current directory" seems >to be specified by '' ( instead of the the full path name). > >Is there anyway I can discover the pathname of an running >python script? > > You can do something like def pathToExecutable(): dir, file = os.path.split(sys.executable) if file == "my application name": return dir dir, file = os.path.split(sys.argv[0]) return dir If you want a more general version to handle any application name, then you need to deal with determining whether the app is being run from a script or has been frozen (with py2exe or py2app or freeze or ...) -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.7.0/346 - Release Date: 23/05/2006 From strawman at astraw.com Wed May 24 23:19:39 2006 From: strawman at astraw.com (Andrew Straw) Date: Wed, 24 May 2006 14:19:39 -0700 Subject: [Pythonmac-SIG] [Matplotlib-users] Matplotlib Universal Package In-Reply-To: <725A7949-C84A-4FBF-8A1C-44CE4C2F59A0@samuelsmith.org> References: <6382066a0605031909y68721928t41c983f9541c3910@mail.gmail.com> <6382066a0605231052r6c5d4350p669137efda915ab0@mail.gmail.com> <7E5AFBE6-F0AB-40B4-BAB5-E3E7277A1549@samuelsmith.org> <725A7949-C84A-4FBF-8A1C-44CE4C2F59A0@samuelsmith.org> Message-ID: <4474CDEB.2000709@astraw.com> Dear Sam, Could you please try the following patch? I think it will fix the issue, but I'm not sure -- I don't have this problem on my linux system. If it works, I'll commit it to svn. (Robert Kern suggested modifying the setup.py to include a compiler command-line directive. IMO this is better because it will be in the source file and is thus more visible to anyone who wants to re-use the code. Additionally, it will modify the file, triggering a re-build.) Samuel M. Smith wrote: >Well, I gave up. I regressed and installed numpy 0.9.6 from the >package installer and looks like matplotlib works now. >It sure blows my confidence when two months go by and there are >enough changes that I can't install from source anymore. >I would like to try again but it would be nice to know what you did >to get it to work since what I did last time no longer works. > >Sam > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG at python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > -------------- next part -------------- A non-text attachment was scrubbed... Name: numpy_names.patch Type: text/x-patch Size: 1656 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060524/e910a297/attachment.bin From Chris.Barker at noaa.gov Thu May 25 19:09:32 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 25 May 2006 10:09:32 -0700 Subject: [Pythonmac-SIG] WhereAmI ? In-Reply-To: <4474C6D8.9080303@tweedly.net> References: <288CB594-D83A-4317-87B5-7C71941FBB9B@eku.edu> <4474C6D8.9080303@tweedly.net> Message-ID: <4475E4CC.2060609@noaa.gov> > Jerry LeVan wrote: >> Is there anyway I can discover the pathname of an running >> python script? As a note: in general, this is not a great way to locate resources. There is no completely foolproof way to locate the path tot he executable on all platforms, so it's better to define your resourced directory in a different way. I'm pretty sure, if you're using Py2app, that there is a standard place to store stuff in the Application bundle, and a standard way to access it. Search this list, the Py2App docs, or, if you get lucky someone will chime in and tell you what it is! -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From rowen at cesmail.net Thu May 25 20:15:02 2006 From: rowen at cesmail.net (Russell E. Owen) Date: Thu, 25 May 2006 11:15:02 -0700 Subject: [Pythonmac-SIG] py2app quirk Message-ID: I'm using py2app to bundle a Tkinter application. The one package explicitly included is matplotlib (which is a bit of a pain due to the need to explicitly add its data files). Anyway, I stumbled across a new wrinkle today: one of my scripts that uses matplotlib would not load because the module FileDialog (from lib-tk) was not available. Simply adding it to the module list fixed the problem but it seems odd that it would be needed. Based on the traceback it was clearly matplotlib trying to load FileDialog (I never use it myself since I have a custom class for this). This is just a heads up. I have no idea if there's anything that could or should be changed in py2app. At least the error message is clear and the solution obvious. -- Russell P.S. configuration: py2app 0.2, ActivePython 2.4.3 (build 11 for PPC) and MacOS X 10.4.6. From robin.meier at free.fr Fri May 26 02:42:27 2006 From: robin.meier at free.fr (robin meier) Date: Fri, 26 May 2006 02:42:27 +0200 Subject: [Pythonmac-SIG] webbrowser module bug on os x? Message-ID: <12ECAA80-63A5-487A-A912-7D5D64B483D2@free.fr> hi it seems to me like the webbrowser command webbrowser.open('http://...', new=0) does not work as advertised: all the urls open in seperate windows regardless of the default browser (safari, firefox, mozilla). i did not encounter this problem on windows xp. can anyone help? what could i do, so new links are opened in the already existing browser window? thank you in advance. robin From jerry.levan at eku.edu Fri May 26 19:13:45 2006 From: jerry.levan at eku.edu (Jerry LeVan) Date: Fri, 26 May 2006 13:13:45 -0400 Subject: [Pythonmac-SIG] Launching Python Scripts? Message-ID: Hi, I am trying to get back into python... I am running version 2.4.3 and I generally use Komodo for my IDE. My initial line in my scripts #!/usr/bin/env python works fine from the command line or the IDE, however dragging such a script seems to choke the "PythonLauncher" If I change the initial line to #!/user/local/bin/python Then dragging the script on the launcher works but a yucky console window appears.... I really would like to be able to launch a script with the #!/usr/bin/env python initial line by dragging the file onto a launcher or double clicking the script Is such a task possible? If I use the #!/usr/local/bin/python as the initial line is there a way to suppress the appearance of the console window? Thanks, Jerry From jerry.levan at eku.edu Sat May 27 00:47:54 2006 From: jerry.levan at eku.edu (Jerry LeVan) Date: Fri, 26 May 2006 18:47:54 -0400 Subject: [Pythonmac-SIG] How can I say... Message-ID: <5F624C73-A13B-434B-BFF3-38E5D4170D2A@eku.edu> Hi, The following is from one of my tcl programs bind $ui_vars(code) { $ui_vars(code) yview scroll -5 units } bind $ui_vars(code) { $ui_vars(code) yview scroll +5 units } $ui_vars(code) is a reference to a Text object. The effect of the code is to enable wheel mouse scrolling (five lines per click). I can't figure out the magic words to do the same in Python ;( Can anyone help me? Jerry From jerry.levan at eku.edu Sat May 27 01:24:18 2006 From: jerry.levan at eku.edu (Jerry LeVan) Date: Fri, 26 May 2006 19:24:18 -0400 Subject: [Pythonmac-SIG] How can I say... In-Reply-To: <5F624C73-A13B-434B-BFF3-38E5D4170D2A@eku.edu> References: <5F624C73-A13B-434B-BFF3-38E5D4170D2A@eku.edu> Message-ID: Hmmm, self.code.bind("",self.code.yview_scroll (-5 ,'units')) works on my linux box but does not appear to work on my mac... Jerry On May 26, 2006, at 6:47 PM, Jerry LeVan wrote: > Hi, > > The following is from one of my tcl programs > > bind $ui_vars(code) { $ui_vars(code) yview scroll > -5 units } > bind $ui_vars(code) { $ui_vars(code) yview scroll > +5 units } > > $ui_vars(code) is a reference to a Text object. > > The effect of the code is to enable wheel mouse scrolling (five > lines per click). > > I can't figure out the magic words to do the same in Python ;( > > Can anyone help me? > > Jerry From midtoad at yahoo.com Sat May 27 07:15:45 2006 From: midtoad at yahoo.com (Stewart Midwinter) Date: Sat, 27 May 2006 01:15:45 -0400 (EDT) Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 37, Issue 28 In-Reply-To: Message-ID: <20060527051545.96140.qmail@web53902.mail.yahoo.com> > > From: Jerry LeVan > To: pythonmac-sig at python.org > Date: Wed, 24 May 2006 15:39:48 -0400 > Subject: [Pythonmac-SIG] WhereAmI ? > I can easily pick up modules living in Resources, but > I can't see how to find pure "data" files living in the > the Resources folder. > Jerry, your current directory can be found from getting the full path to the running module: whereami = os.path.abspath(os.path.dirname(__file__)) HTH S __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From aleaxit at gmail.com Sat May 27 16:41:48 2006 From: aleaxit at gmail.com (Alex Martelli) Date: Sat, 27 May 2006 07:41:48 -0700 Subject: [Pythonmac-SIG] PyObj and XCode 2.3 Message-ID: <5A5C65D0-D58A-455A-AAB3-BFC3CF1CE909@gmail.com> So a guy on the Italian Mac newsgroup (it.comp.lang.macintosh) went to the trouble of downloading and installing the new XCode 2.3 -- almost a GB download!!! -- and now says PyObjC doesn't compile any more (so he's reverted XCode to 2.2.1). Unfortunately he didn't copy- and-paste the error and I'm reluctant to download a GB just to try and reproduce it (I don't really _need_ 2.3 myself, as it uses the same gcc 4.0.1 as 2.2.1 and I don't use the GUI tools much anyway). Perhaps somebody who needs XCode 2.3 anyway can help find out and fix this issue...? Alex From bob at redivi.com Sat May 27 16:51:51 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 27 May 2006 14:51:51 +0000 Subject: [Pythonmac-SIG] PyObj and XCode 2.3 In-Reply-To: <5A5C65D0-D58A-455A-AAB3-BFC3CF1CE909@gmail.com> References: <5A5C65D0-D58A-455A-AAB3-BFC3CF1CE909@gmail.com> Message-ID: <71BE7AD6-28B3-4770-AF15-8B802A380A65@redivi.com> On May 27, 2006, at 2:41 PM, Alex Martelli wrote: > So a guy on the Italian Mac newsgroup (it.comp.lang.macintosh) went > to the trouble of downloading and installing the new XCode 2.3 -- > almost a GB download!!! -- and now says PyObjC doesn't compile any > more (so he's reverted XCode to 2.2.1). Unfortunately he didn't copy- > and-paste the error and I'm reluctant to download a GB just to try > and reproduce it (I don't really _need_ 2.3 myself, as it uses the > same gcc 4.0.1 as 2.2.1 and I don't use the GUI tools much anyway). > Perhaps somebody who needs XCode 2.3 anyway can help find out and fix > this issue...? I'm pretty sure it builds fine here, with trunk anyway. Xcode updates never use the same build of gcc, but Apple doesn't update the GCC version number until GCC does. i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5250) i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5332) -bob From aleaxit at gmail.com Sat May 27 17:39:47 2006 From: aleaxit at gmail.com (Alex Martelli) Date: Sat, 27 May 2006 08:39:47 -0700 Subject: [Pythonmac-SIG] PyObj and XCode 2.3 In-Reply-To: <71BE7AD6-28B3-4770-AF15-8B802A380A65@redivi.com> References: <5A5C65D0-D58A-455A-AAB3-BFC3CF1CE909@gmail.com> <71BE7AD6-28B3-4770-AF15-8B802A380A65@redivi.com> Message-ID: On May 27, 2006, at 7:51 AM, Bob Ippolito wrote: > > On May 27, 2006, at 2:41 PM, Alex Martelli wrote: > >> So a guy on the Italian Mac newsgroup (it.comp.lang.macintosh) went >> to the trouble of downloading and installing the new XCode 2.3 -- >> almost a GB download!!! -- and now says PyObjC doesn't compile any >> more (so he's reverted XCode to 2.2.1). Unfortunately he didn't >> copy- >> and-paste the error and I'm reluctant to download a GB just to try >> and reproduce it (I don't really _need_ 2.3 myself, as it uses the >> same gcc 4.0.1 as 2.2.1 and I don't use the GUI tools much anyway). >> Perhaps somebody who needs XCode 2.3 anyway can help find out and fix >> this issue...? > > I'm pretty sure it builds fine here, with trunk anyway. I'm not sure what version that guy used, I suspect the last released one. > > Xcode updates never use the same build of gcc, but Apple doesn't > update the GCC version number until GCC does. > > i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. > build 5250) > i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. > build 5332) Ah, I see - the guy hadn't included the buildnumber. Since he's now uninstalled 2.3 (regressing to 2.2.1) I guess there's no real chance to find out the needed details any more. Ah well, no big deal, sorry for the false alarm. Alex From ronaldoussoren at mac.com Sat May 27 18:34:14 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 27 May 2006 18:34:14 +0200 Subject: [Pythonmac-SIG] PyObj and XCode 2.3 In-Reply-To: References: <5A5C65D0-D58A-455A-AAB3-BFC3CF1CE909@gmail.com> <71BE7AD6-28B3-4770-AF15-8B802A380A65@redivi.com> Message-ID: <1B2822B5-DABE-42A9-93C2-0BA91D71F1C6@mac.com> On 27-mei-2006, at 17:39, Alex Martelli wrote: > > On May 27, 2006, at 7:51 AM, Bob Ippolito wrote: > >> >> On May 27, 2006, at 2:41 PM, Alex Martelli wrote: >> >>> So a guy on the Italian Mac newsgroup (it.comp.lang.macintosh) went >>> to the trouble of downloading and installing the new XCode 2.3 -- >>> almost a GB download!!! -- and now says PyObjC doesn't compile any >>> more (so he's reverted XCode to 2.2.1). Unfortunately he didn't >>> copy- >>> and-paste the error and I'm reluctant to download a GB just to try >>> and reproduce it (I don't really _need_ 2.3 myself, as it uses the >>> same gcc 4.0.1 as 2.2.1 and I don't use the GUI tools much anyway). >>> Perhaps somebody who needs XCode 2.3 anyway can help find out and >>> fix >>> this issue...? >> >> I'm pretty sure it builds fine here, with trunk anyway. > > I'm not sure what version that guy used, I suspect the last released > one. The trunk builds fine for me, as does 1.3.7. I wonder why it failed for him. Ronald From ronaldoussoren at mac.com Sat May 27 18:38:49 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 27 May 2006 18:38:49 +0200 Subject: [Pythonmac-SIG] PyObj and XCode 2.3 In-Reply-To: <1B2822B5-DABE-42A9-93C2-0BA91D71F1C6@mac.com> References: <5A5C65D0-D58A-455A-AAB3-BFC3CF1CE909@gmail.com> <71BE7AD6-28B3-4770-AF15-8B802A380A65@redivi.com> <1B2822B5-DABE-42A9-93C2-0BA91D71F1C6@mac.com> Message-ID: On 27-mei-2006, at 18:34, Ronald Oussoren wrote: > The trunk builds fine for me, as does 1.3.7. I wonder why it > failed for him. Arghh, I wrote too soon, 1.3.7 doesn't build after all. I hadden't expected a failure in the framework wrappers. It's a buglet in the wrapper-generator script, it picks up a #define inside a comment. Ronald From aleaxit at gmail.com Sat May 27 18:57:42 2006 From: aleaxit at gmail.com (Alex Martelli) Date: Sat, 27 May 2006 09:57:42 -0700 Subject: [Pythonmac-SIG] PyObj and XCode 2.3 In-Reply-To: References: <5A5C65D0-D58A-455A-AAB3-BFC3CF1CE909@gmail.com> <71BE7AD6-28B3-4770-AF15-8B802A380A65@redivi.com> <1B2822B5-DABE-42A9-93C2-0BA91D71F1C6@mac.com> Message-ID: <8346F436-F162-4CC7-A283-DB675C616F58@gmail.com> On May 27, 2006, at 9:38 AM, Ronald Oussoren wrote: > > On 27-mei-2006, at 18:34, Ronald Oussoren wrote: > > >> The trunk builds fine for me, as does 1.3.7. I wonder why it >> failed for him. > > Arghh, I wrote too soon, 1.3.7 doesn't build after all. I hadden't > expected a failure in the framework wrappers. It's a buglet in the > wrapper-generator script, it picks up a #define inside a comment. Well, if it's fixed in the trunk, then I guess a new release is all it will take to fix the Xcode 2.3 issue. Alex From ronaldoussoren at mac.com Sat May 27 19:03:48 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 27 May 2006 19:03:48 +0200 Subject: [Pythonmac-SIG] PyObj and XCode 2.3 In-Reply-To: <8346F436-F162-4CC7-A283-DB675C616F58@gmail.com> References: <5A5C65D0-D58A-455A-AAB3-BFC3CF1CE909@gmail.com> <71BE7AD6-28B3-4770-AF15-8B802A380A65@redivi.com> <1B2822B5-DABE-42A9-93C2-0BA91D71F1C6@mac.com> <8346F436-F162-4CC7-A283-DB675C616F58@gmail.com> Message-ID: On 27-mei-2006, at 18:57, Alex Martelli wrote: > > On May 27, 2006, at 9:38 AM, Ronald Oussoren wrote: > >> >> On 27-mei-2006, at 18:34, Ronald Oussoren wrote: >> >> >>> The trunk builds fine for me, as does 1.3.7. I wonder why it >>> failed for him. >> >> Arghh, I wrote too soon, 1.3.7 doesn't build after all. I hadden't >> expected a failure in the framework wrappers. It's a buglet in the >> wrapper-generator script, it picks up a #define inside a comment. > > Well, if it's fixed in the trunk, then I guess a new release is all > it will take to fix the Xcode 2.3 issue. It is, but I'm not entirely happy with the current version of py2app (which is included in releases of pyobjc). I'm currently reading to py2app sources to see if I can get it to do what I want w.r.t. universal binaries. When that is resolved I'll do a new release. Ronald From marcink at ieee.org Sun May 28 06:26:36 2006 From: marcink at ieee.org (Marcin Komorowski) Date: Sun, 28 May 2006 00:26:36 -0400 Subject: [Pythonmac-SIG] Controlling Mail.app from Python Message-ID: <4CEE2F01-1AF4-42EC-B5CD-2F75AE04CDF0@ieee.org> Is there a way to control Mail.app application from within Python the way it can be controlled using AppleScript? Thanks, Marcin From marcink at ieee.org Sun May 28 06:29:13 2006 From: marcink at ieee.org (Marcin Komorowski) Date: Sun, 28 May 2006 00:29:13 -0400 Subject: [Pythonmac-SIG] MacPython vs ActivePython Message-ID: <452C3E87-BE3F-4FEB-984A-AF04C723E8B8@ieee.org> What are the pros and cons of using MacPython v.s. ActivePython on OS X Tiger? Thanks, Marcin From daniellord at mac.com Sun May 28 16:12:42 2006 From: daniellord at mac.com (Daniel Lord) Date: Sun, 28 May 2006 07:12:42 -0700 Subject: [Pythonmac-SIG] Controlling Mail.app from Python In-Reply-To: <4CEE2F01-1AF4-42EC-B5CD-2F75AE04CDF0@ieee.org> References: <4CEE2F01-1AF4-42EC-B5CD-2F75AE04CDF0@ieee.org> Message-ID: <56A2C3C0-4D6C-40ED-B66D-40F55761198F@mac.com> On May 27, 2006, at 21:26, Marcin Komorowski wrote: > Is there a way to control Mail.app application from within Python the > way it can be controlled using AppleScript? Explore the appscript module (http://freespace.virgin.net/ hamish.sanderson/appscript.html). I have found it to be powerful and very 'pythonic' once you understand the syntax which can be nearly every bit as arcane AppleScript itself since it must follow AppleScript. the site has a lot of examples and there is a wiki or sorts. I have successfully used it to control Mail, AddressBook, iTunes, BBEdit, and OminOutliner Pro. MS Excel has proven to be fairly problematic but I don't think it is appscript's fault--AE support is quite uneven and parochial from my experience--few outside of Apple implement it entirely correctly. Barebones, Late Night, Omnigroup, and Adobe seem to though. The one thing I haven't succeeded in doing was to create a pure Python mail filter. I had to write an AppleScript hack that used the last word in the mail filter title as the name of a Python script to run and pass it the rule name and message id on the command line. But that is more a limitation of Apple Mail's external script invocation capability than its AppleScript implementation. Daniel From david.warde.farley at utoronto.ca Sun May 28 19:58:39 2006 From: david.warde.farley at utoronto.ca (David Warde-Farley) Date: Sun, 28 May 2006 13:58:39 -0400 Subject: [Pythonmac-SIG] Controlling Mail.app from Python In-Reply-To: <56A2C3C0-4D6C-40ED-B66D-40F55761198F@mac.com> References: <4CEE2F01-1AF4-42EC-B5CD-2F75AE04CDF0@ieee.org> <56A2C3C0-4D6C-40ED-B66D-40F55761198F@mac.com> Message-ID: <8CB85024-4C4A-45C2-A345-90ED084D7921@utoronto.ca> On 28-May-06, at 10:12 AM, Daniel Lord wrote: > The one thing I haven't succeeded in doing was to create a pure > Python mail filter. I had to write an AppleScript hack that used the > last word in the mail filter title as the name of a Python script to > run and pass it the rule name and message id on the command line. But > that is more a limitation of Apple Mail's external script invocation > capability than its AppleScript implementation. Maybe for such complicated interactions a plugin would do the trick? (I'm not totally sure, I haven't explored their full capability). If you're interested see the tutorial at http://www.bazza.com/~eaganj/weblog/2006/03/29/demystifying-mail-app- plugins Coincidentally, the author uses Python. DWF From daniellord at mac.com Mon May 29 02:23:05 2006 From: daniellord at mac.com (Daniel Lord) Date: Sun, 28 May 2006 17:23:05 -0700 Subject: [Pythonmac-SIG] Controlling Mail.app from Python In-Reply-To: <8CB85024-4C4A-45C2-A345-90ED084D7921@utoronto.ca> References: <4CEE2F01-1AF4-42EC-B5CD-2F75AE04CDF0@ieee.org> <56A2C3C0-4D6C-40ED-B66D-40F55761198F@mac.com> <8CB85024-4C4A-45C2-A345-90ED084D7921@utoronto.ca> Message-ID: <6CBBBB8B-B69D-4436-9475-1F64A817B02B@mac.com> On May 28, 2006, at 10:58, David Warde-Farley wrote: > Maybe for such complicated interactions a plugin would do the > trick? (I'm not totally sure, I haven't explored their full > capability). > > If you're interested see the tutorial at > > http://www.bazza.com/~eaganj/weblog/2006/03/29/demystifying-mail- > app-plugins > > Coincidentally, the author uses Python. Thanks David. Just read through it. Its a cool hack, but unfortunately the author claims to uses a private API so it remains just a hack which may break suddenly with no deprecation warnings. I need to look at the GPG plugin since its open source to if its author used the private API as well. I want an official, non-hack if I can that won't break on me and I can run spam and other filters reliably . My ugly, coarse hack won't break with changes since it uses the official AppleScript method, it is just ugly and slow but how much mail do I filter at a time anyway? I could (big 'could' given all the other things to do) create a Python script to accept AE and send the message id and rule name as parameters via AE--cleaner and lighter in foot print perhaps particularly if I set the Python script up as a faceless background server that stays open as long as mail does once it is activated the first time. A project for a rainy day perhaps. Daniel "Few people are capable of expressing with equanimity opinions which differ from the prejudices of their social environment. Most people are not even capable of forming such opinions." - Einstein From ronaldoussoren at mac.com Mon May 29 07:53:39 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 29 May 2006 07:53:39 +0200 Subject: [Pythonmac-SIG] Controlling Mail.app from Python In-Reply-To: <6CBBBB8B-B69D-4436-9475-1F64A817B02B@mac.com> References: <4CEE2F01-1AF4-42EC-B5CD-2F75AE04CDF0@ieee.org> <56A2C3C0-4D6C-40ED-B66D-40F55761198F@mac.com> <8CB85024-4C4A-45C2-A345-90ED084D7921@utoronto.ca> <6CBBBB8B-B69D-4436-9475-1F64A817B02B@mac.com> Message-ID: On 29-mei-2006, at 2:23, Daniel Lord wrote: > > On May 28, 2006, at 10:58, David Warde-Farley wrote: > >> Maybe for such complicated interactions a plugin would do the >> trick? (I'm not totally sure, I haven't explored their full >> capability). >> >> If you're interested see the tutorial at >> >> http://www.bazza.com/~eaganj/weblog/2006/03/29/demystifying-mail- >> app-plugins >> >> Coincidentally, the author uses Python. > > Thanks David. Just read through it. Its a cool hack, but > unfortunately the author claims to uses a private API so it remains > just a hack which may break suddenly with no deprecation warnings. I > need to look at the GPG plugin since its open source to if its author > used the private API as well. I haven't look at the source of the GPG plugin, but yes they use a private API as well. Mail.app doesn't have a public extension API. Ronald From pthibault33 at yahoo.ca Mon May 29 16:58:31 2006 From: pthibault33 at yahoo.ca (Pierre Thibault) Date: Mon, 29 May 2006 10:58:31 -0400 Subject: [Pythonmac-SIG] Python group in Montreal Message-ID: <447B0C17.1010105@yahoo.ca> Hello, I would like to start a new Python user group in Montreal, Qc, Canada. If you have some interest, contact me by email. -- A+ Pierre From daniellord at mac.com Tue May 30 00:49:36 2006 From: daniellord at mac.com (Daniel Lord) Date: Mon, 29 May 2006 15:49:36 -0700 Subject: [Pythonmac-SIG] Another report on py2app error with Xcode 2.3 Message-ID: I don't know if this helps at all, but here is the error I get... [daniello at mercury.local]$ python setup.py py2app -A running py2app Traceback (most recent call last): File "setup.py", line 30, in ? app = [app_data] File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/py2app/py2app/build_app.py", line 354, in run self.initialize_plist() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/py2app/py2app/build_app.py", line 427, in initialize_plist plist = self.get_default_plist() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/py2app/py2app/build_app.py", line 306, in get_default_plist version = find_version(target.script) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/py2app/py2app/util.py", line 13, in find_version ast = compiler.parseFile(fn) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/compiler/transformer.py", line 48, in parseFile return parse(src) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/compiler/transformer.py", line 52, in parse return Transformer().parsesuite(buf) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/compiler/transformer.py", line 129, in parsesuite return self.transform(parser.suite(text)) File "", line 117 def magicNumber: ^ SyntaxError: invalid syntax [daniello at mercury.local]$ This built fine under Xcode 2.2.3 though. I should note my environment is: OSX 10.4.6 i386 on Macbook Pro Xcode 2.3 Python 2.4.3: Universal-MacPython-2.4.3-2006-04-07.dmg PyObjc: pyobjc-1.3.8a0-py2.4-macosx10.4.dmg "Ever tried. Ever failed. No matter. Try again. Fail again. Fail better." ?Samuel Beckett -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060529/956dfd1c/attachment.htm From daniellord at mac.com Tue May 30 03:18:39 2006 From: daniellord at mac.com (Daniel Lord) Date: Mon, 29 May 2006 18:18:39 -0700 Subject: [Pythonmac-SIG] NEVER MIND! Re: Another report on py2app error with Xcode 2.3 In-Reply-To: References: Message-ID: <5A174555-DA1F-4D96-8655-FBDA3A32D852@mac.com> Sheer stupidity on my part ;-) On May 29, 2006, at 15:49, Daniel Lord wrote: > I don't know if this helps at all, but here is the error I get... > > [daniello at mercury.local]$ python setup.py py2app -A > running py2app > Traceback (most recent call last): > File "setup.py", line 30, in ? > app = [app_data] > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/distutils/core.py", line 149, in setup > dist.run_commands() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/distutils/dist.py", line 946, in run_commands > self.run_command(cmd) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/distutils/dist.py", line 966, in run_command > cmd_obj.run() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/py2app/py2app/build_app.py", line 354, in run > self.initialize_plist() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/py2app/py2app/build_app.py", line 427, in > initialize_plist > plist = self.get_default_plist() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/py2app/py2app/build_app.py", line 306, in > get_default_plist > version = find_version(target.script) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/py2app/py2app/util.py", line 13, in > find_version > ast = compiler.parseFile(fn) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/compiler/transformer.py", line 48, in parseFile > return parse(src) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/compiler/transformer.py", line 52, in parse > return Transformer().parsesuite(buf) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/compiler/transformer.py", line 129, in parsesuite > return self.transform(parser.suite(text)) > File "", line 117 > def magicNumber: > ^ > SyntaxError: invalid syntax > [daniello at mercury.local]$ > > This built fine under Xcode 2.2.3 though. > > I should note my environment is: > OSX 10.4.6 i386 on Macbook Pro > Xcode 2.3 > Python 2.4.3: Universal-MacPython-2.4.3-2006-04-07.dmg > PyObjc: pyobjc-1.3.8a0-py2.4-macosx10.4.dmg > > "Ever tried. Ever failed. No matter. Try again. Fail again. Fail > better." > ?Samuel Beckett > > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig Daniel Lord daniellord at mac.com --- "You will never regret getting up too early, and you'll always regret getting up too late, but sometimes you may regret giving up too late." -- Mountaineer's Adage -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060529/73409820/attachment.html From whamoo at rknet.it Tue May 30 09:33:32 2006 From: whamoo at rknet.it (whamoo) Date: Tue, 30 May 2006 09:33:32 +0200 Subject: [Pythonmac-SIG] Python Unicode and NSString... Message-ID: Hi all! i'm at war with unicode python and cocoa, and seem that i cannot win... =) i've wrote this function: def makeNSString(self, oldString): try: oldString = NSString.stringWithUTF8String_(oldString) return oldString except Exception, e: print Exception, e return oldString And it work, now in my app i have all the ?,?,?,? correctly written, but it raise this exception each time: exceptions.Exception depythonifying 'charptr', got 'unicode' This is normal? what can i do? ;) Thanks a lot people Matteo Rattotti www.rknet.it Powered by: - MacOsX - Gnu / Linux Debian Sarge - Amiga Os 3.9 - Milk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060530/8b7612ca/attachment.html From njriley at uiuc.edu Tue May 30 10:07:07 2006 From: njriley at uiuc.edu (Nicholas Riley) Date: Tue, 30 May 2006 03:07:07 -0500 Subject: [Pythonmac-SIG] Python Unicode and NSString... In-Reply-To: References: Message-ID: <20060530080707.GA66675@uiuc.edu> On Tue, May 30, 2006 at 09:33:32AM +0200, whamoo wrote: > Hi all! > > i'm at war with unicode python and cocoa, and seem that i cannot > win... =) > > i've wrote this function: > > def makeNSString(self, oldString): > try: > oldString = NSString.stringWithUTF8String_(oldString) > return oldString > except Exception, e: > print Exception, e > return oldString > > And it work, now in my app i have all the ?,?,?,? correctly written, > but it raise this exception each time: > > exceptions.Exception depythonifying 'charptr', got 'unicode' > > This is normal? what can i do? ;) What are you trying to do? If the string is already Unicode, PyObjC will make it into a NSString for you. If you want to encode a Unicode string as UTF-8, then use oldString.encode('utf-8'). -- Nicholas Riley | From whamoo at rknet.it Tue May 30 10:58:06 2006 From: whamoo at rknet.it (whamoo) Date: Tue, 30 May 2006 10:58:06 +0200 Subject: [Pythonmac-SIG] Python Unicode and NSString... In-Reply-To: <20060530080707.GA66675@uiuc.edu> References: <20060530080707.GA66675@uiuc.edu> Message-ID: On 30/mag/06, at 10:07, Nicholas Riley wrote: > What are you trying to do? If the string is already Unicode, PyObjC > will make it into a NSString for you. Ok i have unicode python string, i was building a extra menu on run time, but if I pass the unicode python string for creating the menu, the letter like ?,?,? don't appear correctly like: ? this must be 'prov?' if i use the function i posted before all work as intended, but raise out that exception.... > If you want to encode a Unicode > string as UTF-8, then use oldString.encode('utf-8'). Ok i know, but how to put correctly character on menu and submenu'? (menu item seem work correctly i don't know why....) Thanks a lot Matteo Rattotti www.rknet.it Powered by: - MacOsX - Gnu / Linux Debian Sarge - Amiga Os 3.9 - Milk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060530/5816d66e/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: mmmmm.jpg Type: image/jpeg Size: 12687 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060530/5816d66e/attachment.jpg From bob at redivi.com Tue May 30 11:20:13 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 30 May 2006 02:20:13 -0700 Subject: [Pythonmac-SIG] Python Unicode and NSString... In-Reply-To: References: <20060530080707.GA66675@uiuc.edu> Message-ID: <9DA999E9-166A-4E62-AE4F-F444ECFCE2FA@redivi.com> On May 30, 2006, at 1:58 AM, whamoo wrote: > > On 30/mag/06, at 10:07, Nicholas Riley wrote: > >> What are you trying to do? If the string is already Unicode, PyObjC >> will make it into a NSString for you. > > Ok i have unicode python string, i was building a extra menu on run > time, but if I pass > the unicode python string for creating the menu, the letter like > ?,?,? don't appear correctly like: > > > > this must be 'prov?' > > if i use the function i posted before all work as intended, but > raise out that exception.... > Show some code. It's likely that you actually aren't using Python unicode at all given the screenshots. -bob From whamoo at rknet.it Tue May 30 12:21:16 2006 From: whamoo at rknet.it (whamoo) Date: Tue, 30 May 2006 12:21:16 +0200 Subject: [Pythonmac-SIG] Python Unicode and NSString... In-Reply-To: <9DA999E9-166A-4E62-AE4F-F444ECFCE2FA@redivi.com> References: <20060530080707.GA66675@uiuc.edu> <9DA999E9-166A-4E62-AE4F-F444ECFCE2FA@redivi.com> Message-ID: On 30/mag/06, at 11:20, Bob Ippolito wrote: > Show some code. It's likely that you actually aren't using Python > unicode at all given the screenshots. You have 100% reason, there was a problem in my handler for the del.icio.us API =P Sorry all and thanks a lot for the support, now i must release a new version of Delibar with the fix ;) Best Regards Matteo Rattotti www.rknet.it Powered by: - MacOsX - Gnu / Linux Debian Sarge - Amiga Os 3.9 - Milk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060530/c0607958/attachment.htm From ronaldoussoren at mac.com Tue May 30 12:39:39 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 30 May 2006 12:39:39 +0200 Subject: [Pythonmac-SIG] Python Unicode and NSString... In-Reply-To: References: Message-ID: On 30-mei-2006, at 9:33, whamoo wrote: > Hi all! > > i'm at war with unicode python and cocoa, and seem that i cannot > win... =) > > i've wrote this function: > > def makeNSString(self, oldString): > try: > oldString = NSString.stringWithUTF8String_(oldString) > return oldString > except Exception, e: > print Exception, e > return oldString Not teribly relevant, but there's a buglet in your exception dumping code. If you want to print the type of the exception you caught you should use "print e.__class__, e". I'll not comment on the actual issues as you seemm to have solved your problem already. Ronald From whamoo at rknet.it Tue May 30 13:04:00 2006 From: whamoo at rknet.it (whamoo) Date: Tue, 30 May 2006 13:04:00 +0200 Subject: [Pythonmac-SIG] Python Unicode and NSString... In-Reply-To: References: Message-ID: <1DA61EDB-E37E-4E65-8A3F-0F7F3C77FFB1@rknet.it> On 30/mag/06, at 12:39, Ronald Oussoren wrote: > > Not teribly relevant, but there's a buglet in your exception > dumping code. If you want to print the type of the exception you > caught you should use "print e.__class__, e". Yes i know =)) it's an old macro on my editor that i forgot always to change, now i'll have it changed thanks for the remind! > I'll not comment on the actual issues as you seemm to have solved > your problem already. ;D Matteo Rattotti www.rknet.it Powered by: - MacOsX - Gnu / Linux Debian Sarge - Amiga Os 3.9 - Milk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060530/33146e34/attachment.html From kevin at macosx.com Wed May 31 22:20:45 2006 From: kevin at macosx.com (kevin parks) Date: Wed, 31 May 2006 16:20:45 -0400 Subject: [Pythonmac-SIG] Pythonmac facelift In-Reply-To: References: Message-ID: <447DFA9D.6020802@macosx.com> there was all this talk here and the display of lovely new icons for months... looked great... but i downloaded and installed the universal installer of the latest greatest python and i just have the craptacular old icons... so, was this idea dropped & the icons scrapped or... does the lack of zexy new icons mean i have an old installer somehow? cheers, kevin From bob at redivi.com Wed May 31 22:30:15 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 31 May 2006 13:30:15 -0700 Subject: [Pythonmac-SIG] Pythonmac facelift In-Reply-To: <447DFA9D.6020802@macosx.com> References: <447DFA9D.6020802@macosx.com> Message-ID: <09EA3E09-8A29-42E9-BB3D-F44215AD1744@redivi.com> On May 31, 2006, at 1:20 PM, kevin parks wrote: > there was all this talk here and the display of lovely new icons for > months... looked great... but i downloaded and installed the universal > installer of the latest greatest python and i just have the > craptacular > old icons... so, was this idea dropped & the icons scrapped or... does > the lack of zexy new icons mean i have an old installer somehow? It means the installer hasn't been updated. I'm pretty sure the new icons are in svn, but we haven't made a release since that happened. -bob