From sflist at ihonk.com Thu Mar 1 07:11:35 2007 From: sflist at ihonk.com (Steve Freitas) Date: Wed, 28 Feb 2007 22:11:35 -0800 Subject: [Pythonmac-SIG] pyObjC and Plugins Message-ID: <1172729495.9608.51.camel@lothar> Hi all, I've spent all evening unsuccessfully trying to get the EnvironmentPrefs plugin working on my setup, and I hope you can help. I keep getting this: 2007-02-28 21:56:58.918 System Preferences[522] *** -[NSBundle load]: Error loading code /Users/steve/Library/PreferencePanes/Shell Environment.prefPane/Contents/MacOS/Shell Environment for bundle /Users/steve/Library/PreferencePanes/Shell Environment.prefPane, error code 2 (link edit error code 0, error number 0 ()) 2007-02-28 21:56:58.918 System Preferences[522] [NSPrefPaneBundle instantiatePrefPaneObject] (/Users/steve/Library/PreferencePanes/Shell Environment.prefPane): principalClass is nil. I found this earlier thread... http://mail.python.org/pipermail/pythonmac-sig//2006-October/018298.html ...in which apparently upgrading to a later version of py2app fixed by Ronald Oussoren did the trick. However, doing the same hasn't fixed it for me, and I'm guessing in the flurry of reinstallations I left something out. I installed Python 2.5 from Python.org on a fresh install of 10.4.8. I installed, from source, pyObjC 1.4. I did easy_install [module]==dev for altgraph, bdist_mpkg, macholib, modulegraph and py2app. >>> print altgraph.__version__, bdist_mpkg.__version__, \ macholib.__version__, modulegraph.__version__, py2app.__version__ 0.6.8 0.4.2 1.2 0.7.1 0.3.6 Now, I did a lot of uninstallation and reinstallation of all of these pieces, and it's possible something from an old install is still hanging around, since my uninstallation technique consisted of rm -Rf. However, I'm not yet ready to try a fresh 10.4.8 installation again without someone telling me that's the only way. At various points in my console I also got the "ImportError: No module named linecache", but not on every attempt -- I'm not sure why. I've been careful to close and reopen System Preferences between each attempt, and I delete build/ and dist/ in the EnvironmentPrefs dir as well. If anyone could suggest something, I'd sure appreciate it. Thanks! Steve From delza at livingcode.org Thu Mar 1 07:24:49 2007 From: delza at livingcode.org (Dethe Elza) Date: Wed, 28 Feb 2007 22:24:49 -0800 Subject: [Pythonmac-SIG] pyObjC and Plugins In-Reply-To: <1172729495.9608.51.camel@lothar> References: <1172729495.9608.51.camel@lothar> Message-ID: <7ED0394D-A584-4233-B04E-74E835AB9198@livingcode.org> Hi Steve, At some point py2app went from being bundled as part of PyObjC to being a separate install. I think at that time there was a requirement to uninstall the old py2app before installing the new one. I don't guarantee that is the solution to the problem you're having, but it's a possibility (your problem sounds very much like what I was facing, and this fixed it for me). Instructions for uninstalling (and reinstalling) py2app are here: http://svn.pythonmac.org/py2app/py2app/trunk/doc/ index.html#uninstalling-py2app-0-2-x-or-earlier Also, while it may help to remove older versions of and altgraph, bdist_mpkg, macholib, modulegraph, I'm pretty sure you don't have to install them explicitly. They should come along as part of the py2app install, if I recall correctly. The link above is to the py2app docs, so you should be able to find all the info there. Good luck, and let us know how it goes! --Dethe On 28-Feb-07, at 10:11 PM, Steve Freitas wrote: > Hi all, > > I've spent all evening unsuccessfully trying to get the > EnvironmentPrefs > plugin working on my setup, and I hope you can help. I keep getting > this: > > 2007-02-28 21:56:58.918 System Preferences[522] *** -[NSBundle load]: > Error loading code /Users/steve/Library/PreferencePanes/Shell > Environment.prefPane/Contents/MacOS/Shell Environment for > bundle /Users/steve/Library/PreferencePanes/Shell > Environment.prefPane, > error code 2 (link edit error code 0, error number 0 ()) > 2007-02-28 21:56:58.918 System Preferences[522] [NSPrefPaneBundle > instantiatePrefPaneObject] (/Users/steve/Library/PreferencePanes/Shell > Environment.prefPane): principalClass is nil. > > I found this earlier thread... > > http://mail.python.org/pipermail/pythonmac-sig//2006-October/ > 018298.html > > ...in which apparently upgrading to a later version of py2app fixed by > Ronald Oussoren did the trick. However, doing the same hasn't fixed it > for me, and I'm guessing in the flurry of reinstallations I left > something out. > > I installed Python 2.5 from Python.org on a fresh install of 10.4.8. I > installed, from source, pyObjC 1.4. I did easy_install [module] > ==dev for > altgraph, bdist_mpkg, macholib, modulegraph and py2app. > >>>> print altgraph.__version__, bdist_mpkg.__version__, \ > macholib.__version__, modulegraph.__version__, py2app.__version__ > 0.6.8 0.4.2 1.2 0.7.1 0.3.6 > > Now, I did a lot of uninstallation and reinstallation of all of these > pieces, and it's possible something from an old install is still > hanging > around, since my uninstallation technique consisted of rm -Rf. > However, > I'm not yet ready to try a fresh 10.4.8 installation again without > someone telling me that's the only way. > > At various points in my console I also got the "ImportError: No module > named linecache", but not on every attempt -- I'm not sure why. I've > been careful to close and reopen System Preferences between each > attempt, and I delete build/ and dist/ in the EnvironmentPrefs dir as > well. If anyone could suggest something, I'd sure appreciate it. > > Thanks! > > Steve > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig "Everyone has gotten so hung up on the legality of this they've forgotten the ethics." --Paul Saffo, on the H-P Scandal From sflist at ihonk.com Thu Mar 1 08:06:40 2007 From: sflist at ihonk.com (Steve Freitas) Date: Wed, 28 Feb 2007 23:06:40 -0800 Subject: [Pythonmac-SIG] pyObjC and Plugins In-Reply-To: <7ED0394D-A584-4233-B04E-74E835AB9198@livingcode.org> References: <1172729495.9608.51.camel@lothar> <7ED0394D-A584-4233-B04E-74E835AB9198@livingcode.org> Message-ID: <1172732800.9608.55.camel@lothar> On Wed, 2007-02-28 at 22:24 -0800, Dethe Elza wrote: > Hi Steve, > > At some point py2app went from being bundled as part of PyObjC to > being a separate install. I think at that time there was a > requirement to uninstall the old py2app before installing the new > one. I don't guarantee that is the solution to the problem you're > having, but it's a possibility (your problem sounds very much like > what I was facing, and this fixed it for me). Instructions for > uninstalling (and reinstalling) py2app are here: > > http://svn.pythonmac.org/py2app/py2app/trunk/doc/ > index.html#uninstalling-py2app-0-2-x-or-earlier Okay, I ignored that since I was never on 0.2 or earlier. That is, I think I wasn't. Now I remember it being part of an pyobjc install at one point... Okay, I'll go do that. > Also, while it may help to remove older versions of and altgraph, > bdist_mpkg, macholib, modulegraph, I'm pretty sure you don't have to > install them explicitly. They should come along as part of the > py2app install, if I recall correctly. The link above is to the > py2app docs, so you should be able to find all the info there. Perhaps another clue that something was wrong: When I did my py2app installation from svn, it wasn't bringing the prereqs with it. I'll check that out. > Good luck, and let us know how it goes! Thanks for the help, Dethe! Steve From sflist at ihonk.com Thu Mar 1 11:48:25 2007 From: sflist at ihonk.com (Steve Freitas) Date: Thu, 01 Mar 2007 02:48:25 -0800 Subject: [Pythonmac-SIG] pyObjC and Plugins In-Reply-To: <7ED0394D-A584-4233-B04E-74E835AB9198@livingcode.org> References: <1172729495.9608.51.camel@lothar> <7ED0394D-A584-4233-B04E-74E835AB9198@livingcode.org> Message-ID: <1172746105.320.8.camel@lothar> Hi Dethe, I attempted it again and unfortunately got the same error. I actually decided to do a fresh 10.4.8 install, did Xcode, Python 2.5 and setuptools 0.6c5. I installed PyObjC 1.4 from source (the stable download off the website), and told it to skip installing py2app. I then used easy_setup to install py2app==dev, which this time took care of all the dependencies, though I think it didn't take those from dev. Did "python setup.py py2app" to the example, copied the result out of dist/ to ~/Library/PreferencePanes, clicked on it and it died with: ===== Thursday, March 1, 2007 2:45:39 AM US/Pacific ===== 2007-03-01 02:45:41.627 System Preferences[1880] [NSPrefPaneBundle instantiatePrefPaneObject] (/Users/steve/Library/PreferencePanes/Shell Environment.prefPane): principalClass is nil. If you have any further ideas, I'd love to hear 'em. Thanks, Steve From ajassal at gmail.com Thu Mar 1 14:36:23 2007 From: ajassal at gmail.com (Amrit Jassal) Date: Thu, 1 Mar 2007 05:36:23 -0800 Subject: [Pythonmac-SIG] Dock menu Message-ID: <12657e140703010536y43fe4c01i1d8847d1e813a381@mail.gmail.com> I have a static dock menu created with Interface Builder (cocoa). Works great. I now have a requirement to add/remove items for this menu at run-time or enable/disable menu items at run-time. I cannot find a way to get a handle to the dock menu at run-time to get at the menu items that I want to enable/disable. Can I somehow get a reference to menu objects (NSMenu) at run-time? Or I cannot wire up the menu using IB and need to create the menu at run-time myself? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070301/a17bf7ea/attachment.htm From delza at livingcode.org Thu Mar 1 16:24:36 2007 From: delza at livingcode.org (Dethe Elza) Date: Thu, 1 Mar 2007 07:24:36 -0800 Subject: [Pythonmac-SIG] pyObjC and Plugins In-Reply-To: <1172746105.320.8.camel@lothar> References: <1172729495.9608.51.camel@lothar> <7ED0394D-A584-4233-B04E-74E835AB9198@livingcode.org> <1172746105.320.8.camel@lothar> Message-ID: Hi Steve, My first thought was to make sure that you were getting the python you just build when you type "python" at the command-line. I've had problems like this before when I had the wrong python in my Path. Then I thought, what if the problem is with the example code? I know I've built that example in the past--I have it running and just used the code yesterday to figure out how to set environmental variables globally in OS X for a friend. So I tried building and installing it, and I got the same problem you did. I haven't had a chance to pore over the log files or svn blame yet, but I would recommend a) trying a different example, and b) looking through the svn history to see what has changed recently in the EnvironmentalPrefs code. The only really recent change was when Ronald added a bundle identifier, but reverting to an version before that has the same problem so the change must be earlier. I have to get the kids (and myself) ready for the day, but I'll check in later if I figure anything else out. --Dethe On 1-Mar-07, at 2:48 AM, Steve Freitas wrote: > Hi Dethe, > > I attempted it again and unfortunately got the same error. > > I actually decided to do a fresh 10.4.8 install, did Xcode, Python 2.5 > and setuptools 0.6c5. I installed PyObjC 1.4 from source (the stable > download off the website), and told it to skip installing py2app. I > then > used easy_setup to install py2app==dev, which this time took care > of all > the dependencies, though I think it didn't take those from dev. Did > "python setup.py py2app" to the example, copied the result out of > dist/ > to ~/Library/PreferencePanes, clicked on it and it died with: > > ===== Thursday, March 1, 2007 2:45:39 AM US/Pacific ===== > 2007-03-01 02:45:41.627 System Preferences[1880] [NSPrefPaneBundle > instantiatePrefPaneObject] (/Users/steve/Library/PreferencePanes/Shell > Environment.prefPane): principalClass is nil. > > If you have any further ideas, I'd love to hear 'em. > > Thanks, > > Steve > It's like I'm living my own version of the Singularity. I both revel in it and am scared by it. I want to figure out how to crawl into a moment and expand it out so that I can fully experience it, but at the same time know that the rapid flow of events makes it's own experience. From delza at livingcode.org Thu Mar 1 16:34:11 2007 From: delza at livingcode.org (Dethe Elza) Date: Thu, 1 Mar 2007 07:34:11 -0800 Subject: [Pythonmac-SIG] pyObjC and Plugins In-Reply-To: <1172746105.320.8.camel@lothar> References: <1172729495.9608.51.camel@lothar> <7ED0394D-A584-4233-B04E-74E835AB9198@livingcode.org> <1172746105.320.8.camel@lothar> Message-ID: <768F833F-7E17-49E7-B318-6A682B015EFE@livingcode.org> Hmmm, I think I must have been a few revs behind. When I svn up'd to HEAD and tried again it built and loaded. Here's my setup: macholib-1.1-py2.5.egg modulegraph-0.7-py2.5.egg py2app-0.3.6.dev_r53-py2.5.egg setuptools-0.6c3-py2.5.egg bdist_mpkg-0.4.2-py2.5.egg pyobjc-1.4.1a0 Python 2.5 OS X (10.4.8) Intel example built from latest pyobjc svn. HTH --Dethe On 1-Mar-07, at 2:48 AM, Steve Freitas wrote: > Hi Dethe, > > I attempted it again and unfortunately got the same error. > > I actually decided to do a fresh 10.4.8 install, did Xcode, Python 2.5 > and setuptools 0.6c5. I installed PyObjC 1.4 from source (the stable > download off the website), and told it to skip installing py2app. I > then > used easy_setup to install py2app==dev, which this time took care > of all > the dependencies, though I think it didn't take those from dev. Did > "python setup.py py2app" to the example, copied the result out of > dist/ > to ~/Library/PreferencePanes, clicked on it and it died with: > > ===== Thursday, March 1, 2007 2:45:39 AM US/Pacific ===== > 2007-03-01 02:45:41.627 System Preferences[1880] [NSPrefPaneBundle > instantiatePrefPaneObject] (/Users/steve/Library/PreferencePanes/Shell > Environment.prefPane): principalClass is nil. > > If you have any further ideas, I'd love to hear 'em. > > Thanks, > > Steve > "No lesson seems to be so deeply inculcated by experience of life as that you should never trust experts. If you believe doctors, nothing is wholesome; if you believe theologians, nothing is innocent; if you believe soldiers, nothing is safe." --Lord Salisbury, 19th century British prime minister From delza at livingcode.org Thu Mar 1 18:35:24 2007 From: delza at livingcode.org (Dethe Elza) Date: Thu, 1 Mar 2007 09:35:24 -0800 Subject: [Pythonmac-SIG] Dock menu In-Reply-To: <12657e140703010536y43fe4c01i1d8847d1e813a381@mail.gmail.com> References: <12657e140703010536y43fe4c01i1d8847d1e813a381@mail.gmail.com> Message-ID: <756055AB-DA23-49C5-ACD5-5F841818DE49@livingcode.org> On 1-Mar-07, at 5:36 AM, Amrit Jassal wrote: > I have a static dock menu created with Interface Builder (cocoa). > Works great. > I now have a requirement to add/remove items for this menu at run- > time or enable/disable menu items at run-time. > > I cannot find a way to get a handle to the dock menu at run-time to > get at the menu items that I want to enable/disable. Can I somehow > get a reference to menu objects (NSMenu) at run-time? Sure, there are several ways. Your menu should already be hooked up to the NSApplication outlet dockMenu in Interface Builder. In theory you should be able to get a reference using NSApp().dockMenu(), but that doesn't appear to work. You could subclass NSApplication to add another outlet that behaves normally and gives you access to the menu. You could probably extract the menu from the Nib file, but that's beyond what I can explain in an email. > Or I cannot wire up the menu using IB and need to create the menu > at run-time myself? That's certainly an option. I'm not sure why the dockMenu outlet is not exposed in the API. There is an (undocumented) NSApp ().setDockMenu_(my_menu) call in AppKit, but no corresponding .dockMenu() unfortunately. You can either use the setDockMenu, or if your application delegate returns a menu from applicationDockMenu_(application) that menu will be used, over-riding any menu set in Interface Builder. HTH --Dethe You need to lay out the user interface components visually, by hand, with total control over where they go. Automated LayoutManagers don?t cut it. A corollary of this is that you can?t move a UI layout from one platform to another and have the computer make everything fit. Computers don?t lay out interfaces by themselves any better than they can translate French to English by themselves. -- Jens Alfke From ninad at nanorex.com Thu Mar 1 16:22:00 2007 From: ninad at nanorex.com (Ninad Sathaye) Date: Thu, 1 Mar 2007 10:22:00 -0500 Subject: [Pythonmac-SIG] Py2app: import errors while running the installed app (PyQt4.Qt imports) Message-ID: <001001c75c15$5c54abf0$8714a8c0@india> Hi, I have built a package using py2app on MACOSX 10.3.9. My application uses Qt4.2 (PyQt4.1.x) framework. When run the application (installed using the created package) it gives import errors. Example: " from PyQt4.Qt import QApplication ImportError : Cannot import name QApplication. " Py2app seems to break my PyQt4 directory into two parts and put them in different places : (A) the Qt.pyc into "/Contents/Resources/lib/python2.3/site-packages.zip/PyQt4" (B) and the .so files [Example: QtGui.so] into "/Contents/Resources/lib/python2.3/lib-dynload/PyQt4" Am I leaving out a necessary option? [ I tried manually copying .so files from (B) to (A) ..that resolved the import problems but then my app crashed.] ++++ Note: During the pkg building process, I got an error which seems identical to the one in this message -- "http://mail.python.org/pipermail/pythonmac-sig/2007-February/018659.html" -- " malformed object (unknown flavor for flavor number 0 in LC_UNIXTHREAD command 10 can't byte swap it) " But the package still got built. Could this be the underlying problem? +++ Specs -- *System: PowerPC G4, OSX 10.3.9. *Python version: Python2.3 *Py2app details: py2app-0.3.5, macholib-1.1, modulegraph-0.7, setuptools-0.6c3 ++++ Any help would be greatly appreciated. Best Regards, Ninad From smithsm at samuelsmith.org Fri Mar 2 00:08:43 2007 From: smithsm at samuelsmith.org (Samuel M. Smith) Date: Thu, 1 Mar 2007 16:08:43 -0700 Subject: [Pythonmac-SIG] Roundup Issue Tracker In-Reply-To: <17893.58261.127516.336045@montanaro.dyndns.org> References: <73F26077-6D36-42F2-A776-1A70B4BD362E@samuelsmith.org> <17893.58261.127516.336045@montanaro.dyndns.org> Message-ID: This worked. Thanks sudo python setup.py install --prefix=/Library/Frameworks/ Python.framework/Versions/2.5 On Feb 28, 2007, at 13:18 , skip at pobox.com wrote: > > Samuel> Anyone on this list installed the python based roundup > issue > Samuel> tracker with framework python2.5? > > Nope... > > Samuel> How did you use --prefix or --install_scripts with > setup.py? > > Something like > > python setup.py install --prefix=/alter/na/tive/dir > > Skip ********************************************************************** Samuel M. Smith Ph.D. 2966 Fort Hill Road Eagle Mountain, Utah 84005-4108 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 sflist at ihonk.com Fri Mar 2 00:32:20 2007 From: sflist at ihonk.com (Steve Freitas) Date: Thu, 01 Mar 2007 15:32:20 -0800 Subject: [Pythonmac-SIG] pyObjC and Plugins In-Reply-To: <768F833F-7E17-49E7-B318-6A682B015EFE@livingcode.org> References: <1172729495.9608.51.camel@lothar> <7ED0394D-A584-4233-B04E-74E835AB9198@livingcode.org> <1172746105.320.8.camel@lothar> <768F833F-7E17-49E7-B318-6A682B015EFE@livingcode.org> Message-ID: <1172791940.427.18.camel@lothar> On Thu, 2007-03-01 at 07:34 -0800, Dethe Elza wrote: > Hmmm, I think I must have been a few revs behind. When I svn up'd to > HEAD and tried again it built and loaded. > > Here's my setup: > macholib-1.1-py2.5.egg > modulegraph-0.7-py2.5.egg > py2app-0.3.6.dev_r53-py2.5.egg > setuptools-0.6c3-py2.5.egg > bdist_mpkg-0.4.2-py2.5.egg > pyobjc-1.4.1a0 > Python 2.5 > OS X (10.4.8) Intel > > example built from latest pyobjc svn. Rats. I installed pyobjc 1.4.1a0 from SVN (right over the top of 1.4, using "python setup.py bdist_mpkg --open"), and that didn't fix it either. I'm using py2app 0.3.6.dev_r54 and setuptools 0.6c5, and I'm on PPC, but other than that there are no differences in versions. I know everything's landing in Python 2.5 and building from there (when I type "python" at the prompt, it fires up my 2.5 install, whether I'm root or steve), so I don't think my stock Python 2.3 is causing any problems. py2app version 2.x has never been anywhere near this machine, so I think I'm okay there. I just tried the SillyBalls example, and I got this: 2007-03-01 15:30:09.335 System Preferences[1540] ScreenSaverModules: can't get principalClass for /Users/steve/Library/Screen Savers/SillyBalls.saver 2007-03-01 15:30:09.336 System Preferences[1540] *** +[NSPrefPaneBundle bundleAtPathIsNativeForSystem:]: selector not recognized 2007-03-01 15:30:09.337 System Preferences[1540] Exception raised during posting of notification. Ignored. exception: *** +[NSPrefPaneBundle bundleAtPathIsNativeForSystem:]: selector not recognized Steve From hengist.podd at virgin.net Thu Mar 1 22:48:08 2007 From: hengist.podd at virgin.net (has) Date: Thu, 1 Mar 2007 21:48:08 +0000 Subject: [Pythonmac-SIG] PyOSA preview Message-ID: <6C621260-40B3-4335-98EF-CF90E82993AA@virgin.net> Hi all, PyOSA, my second attempt at implementing a full Python OSA component, is starting to come together. This is an early version, may be buggy/ incomplete, use at own risk, etc. Most of the major features are working in the large - saving/loading (works on PPC, currently breaks on i386 due to OS bug), compiling, running, displaying results, event handling, appscript integration - so should give a good flavour of where it's going. You can grab the relevant files via subversion: - PyOSA (XCode project, readme, license and samples): svn checkout http://svn.macosforge.org/repository/appscript/py- osacomponent/trunk/ - py-appscript 0.17.2 unstable: svn checkout http://svn.macosforge.org/repository/appscript/py- appscript/branches/py-appscript-0.17.2-unstable/ See PyOSA's ReadMe file and sample scripts for more information. If Script Editor tries to compile your Python code as applescript (there are some known bugs in SE's language menu on 10.4), try setting the default language in SE's preferences. Failing that, osascript works just fine, or you could grab a demo copy of Script Debugger and temporarily use that. Enjoy, has p.s. For anyone interested in what's going on in the rest of the appscript world these days, Matt Neuburg's just done a very nice article at O'Reilly's MacDevCenter: . Not that you need to drop py-appscript and rush to the Dark Side - both bridges provide the same level of application scripting support - but it's great to see the word getting around. The ObjC port of appscript is also shaping up nicely; see my sig for the link. -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From berkowit at silcom.com Fri Mar 2 08:38:00 2007 From: berkowit at silcom.com (Paul Berkowitz) Date: Thu, 01 Mar 2007 23:38:00 -0800 Subject: [Pythonmac-SIG] PyOSA preview In-Reply-To: <6C621260-40B3-4335-98EF-CF90E82993AA@virgin.net> Message-ID: On 3/1/07 11:12 PM, I wrote: > " Error > > Internal Server Error > > The server encountered an internal error or misconfiguration and was > unable to complete your request." > Copying and pasting (since either your email client or the list's server butchered the URL into two pieces, rendering it unclickable) introduced a faulty space = %20. Removing that got me there. Very nice article! -- Paul Berkowitz From berkowit at silcom.com Fri Mar 2 08:12:48 2007 From: berkowit at silcom.com (Paul Berkowitz) Date: Thu, 01 Mar 2007 23:12:48 -0800 Subject: [Pythonmac-SIG] PyOSA preview In-Reply-To: <6C621260-40B3-4335-98EF-CF90E82993AA@virgin.net> Message-ID: On 3/1/07 1:48 PM, "has" wrote: > p.s. For anyone interested in what's going on in the rest of the > appscript world these days, Matt Neuburg's just done a very nice > article at O'Reilly's MacDevCenter: a/mac/2007/02/27/replacing-applescript-with-ruby.html>. " Error Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request." -- Paul Berkowitz From sflist at ihonk.com Fri Mar 2 11:35:28 2007 From: sflist at ihonk.com (Steve Freitas) Date: Fri, 02 Mar 2007 02:35:28 -0800 Subject: [Pythonmac-SIG] pyObjC and Plugins In-Reply-To: <1172791940.427.18.camel@lothar> References: <1172729495.9608.51.camel@lothar> <7ED0394D-A584-4233-B04E-74E835AB9198@livingcode.org> <1172746105.320.8.camel@lothar> <768F833F-7E17-49E7-B318-6A682B015EFE@livingcode.org> <1172791940.427.18.camel@lothar> Message-ID: <1172831728.7714.8.camel@lothar> On Thu, 2007-03-01 at 15:32 -0800, Steve Freitas wrote: > Rats. I installed pyobjc 1.4.1a0 from SVN (right over the top of 1.4, > using "python setup.py bdist_mpkg --open"), and that didn't fix it > either. I'm using py2app 0.3.6.dev_r54 and setuptools 0.6c5, and I'm on > PPC, but other than that there are no differences in versions. So now I've done easy_install ==dev for everything and that didn't change anything. Ronald, do you think your latest alteration might have anything to do with this? Any tips on where I can look for clues why this is failing? Thanks, Steve From mundial82 at gmail.com Fri Mar 2 15:06:20 2007 From: mundial82 at gmail.com (Mundial82) Date: Fri, 2 Mar 2007 15:06:20 +0100 Subject: [Pythonmac-SIG] Newbie troubles Message-ID: <37460EDA-3E7C-413C-B596-01C480BF9A32@gmail.com> Hi, I'm a newbie in using Python in the Mac, and I am having some troubles with Pygame. I am running Python 2.4.3 on a MacBook Pro, and I have installed pygame-1.8.0pre-py2.4. Nevertheless, at the time of running the examples that are bundled with Pygame, they don't run. These are two examples of crash reports: - Trying to run the bundled testsprite.py: 2007-03-02 15:02:43.326 Python[690] Can't open input server /Library/ InputManagers/Smart Crash Reports.bundle Traceback (most recent call last): File "/Developer/Python/pygame/Examples/testsprite.py", line 167, in ? main() File "/Developer/Python/pygame/Examples/testsprite.py", line 102, in main sprite_surface = pygame.image.load(os.path.join("data", "asprite.bmp")) pygame.error: Couldn't open data/asprite.bmp - And trying to run sound.py: Traceback (most recent call last): File "/Developer/Python/pygame/Examples/sound.py", line 20, in ? sound = mixer.Sound(file) pygame.error: Mix_LoadWAV_RW with NULL src I guess there is a problem with the path, but I am not sure - any help is welcome (and the more detailed the explanation, the better - I really want to learn to set up and use python and pygame in my mac). Thanks a bunch! Mundial82 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070302/224c102f/attachment.htm From daniellord at mac.com Fri Mar 2 17:23:26 2007 From: daniellord at mac.com (Daniel Lord) Date: Fri, 2 Mar 2007 08:23:26 -0800 Subject: [Pythonmac-SIG] PyOSA preview In-Reply-To: <6C621260-40B3-4335-98EF-CF90E82993AA@virgin.net> References: <6C621260-40B3-4335-98EF-CF90E82993AA@virgin.net> Message-ID: has, Thanks for all your hard work on this. I am going to work with it a bit when I get some time. I use Komodo a lot these days, it will be interesting to see if/how I can merge the two a bit. I saw Matt's article and I bookmarked for reading this weekend. Haven't tried Ruby yet, I should work with it a little also. I wish Apple would figure this out. Apple Event IPC is great, Applescript is pathetic for the reasons, skimming the article, Matt mentions. They need to take Ruby and Python and make them the core scripting languages for the Mac When I think of the time and resources they spent on Applescript Studio that could have been spent on PyObjC Studio, it saddens me. Apple should leave Applescript as a simple language functioning as Automator glue for non-programmers or quick tasks but open that to Ruby and Python too. Daniel On Mar 1, 2007, at 13:48, has wrote: > Hi all, > > PyOSA, my second attempt at implementing a full Python OSA component, > is starting to come together. This is an early version, may be buggy/ > incomplete, use at own risk, etc. Most of the major features are > working in the large - saving/loading (works on PPC, currently breaks > on i386 due to OS bug), compiling, running, displaying results, event > handling, appscript integration - so should give a good flavour of > where it's going. You can grab the relevant files via subversion: > > - PyOSA (XCode project, readme, license and samples): > > svn checkout http://svn.macosforge.org/repository/appscript/py- > osacomponent/trunk/ > > - py-appscript 0.17.2 unstable: > > svn checkout http://svn.macosforge.org/repository/appscript/py- > appscript/branches/py-appscript-0.17.2-unstable/ > > See PyOSA's ReadMe file and sample scripts for more information. > > If Script Editor tries to compile your Python code as applescript > (there are some known bugs in SE's language menu on 10.4), try > setting the default language in SE's preferences. Failing that, > osascript works just fine, or you could grab a demo copy of Script > Debugger and temporarily use that. > > Enjoy, > > has > > p.s. For anyone interested in what's going on in the rest of the > appscript world these days, Matt Neuburg's just done a very nice > article at O'Reilly's MacDevCenter: a/mac/2007/02/27/replacing-applescript-with-ruby.html>. Not that you > need to drop py-appscript and rush to the Dark Side - both bridges > provide the same level of application scripting support - but it's > great to see the word getting around. The ObjC port of appscript is > also shaping up nicely; see my sig for the link. > > -- > http://appscript.sourceforge.net > http://rb-appscript.rubyforge.org > http://appscript.sourceforge.net/objc-appscript.html > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From smithsm at samuelsmith.org Fri Mar 2 21:01:39 2007 From: smithsm at samuelsmith.org (Samuel M. Smith) Date: Fri, 2 Mar 2007 13:01:39 -0700 Subject: [Pythonmac-SIG] Testing sqlite3 on python2.5 Message-ID: <4186BE5E-EE60-45CE-AC02-22D28BDC968E@samuelsmith.org> Anyone know how to verify that the sqlite3 bindings on Mac Python2.5 (macpackages installer) work or can access actual sqlite3? When I run the regression tests it works, but I don't know what they are testing. I am neophyte when it comes to sql. I am having problems getting roundup to work with the sqlite3 backend. It works with anydbm so I suspect my sqlite3 installation but don't know where to start. >>> import sqlite3 >>> import sqlite3.test.regression >>> sqlite3.test.regression.test() .... ---------------------------------------------------------------------- Ran 4 tests in 0.053s OK >>> does this mean that there is an sqlite3 backend ? ********************************************************************** Samuel M. Smith Ph.D. 2966 Fort Hill Road Eagle Mountain, Utah 84005-4108 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 Fri Mar 2 21:53:37 2007 From: smithsm at samuelsmith.org (Samuel M. Smith) Date: Fri, 2 Mar 2007 13:53:37 -0700 Subject: [Pythonmac-SIG] Testing sqlite3 on python2.5 More In-Reply-To: <4186BE5E-EE60-45CE-AC02-22D28BDC968E@samuelsmith.org> References: <4186BE5E-EE60-45CE-AC02-22D28BDC968E@samuelsmith.org> Message-ID: <509C0063-238D-42A8-9630-868D8815FEDF@samuelsmith.org> I was able to run the example from the python library docs for pysqlite3 I assume that means my sqlite3 installation is good? I would appreciate confirmation from somebody who knows what they are doing. thanks $ python Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> sqlite3.connect('/data/temp/example') >>> conn = sqlite3.connect('/data/temp/example') >>> curs = conn.cursor() >>> curs.execute('''create table stocks ... (date text, trans text, symbol text, qty real, price real)''') >>> curs.execute("""insert into stocks values ('1006-01-05','buy','rhat',100,35.14)""") >>> curs.execute('select * from stocks order by price') >>> for row in curs: ... print row ... (u'1006-01-05', u'buy', u'rhat', 100.0, 35.140000000000001) >>> From bob at redivi.com Fri Mar 2 22:02:50 2007 From: bob at redivi.com (Bob Ippolito) Date: Fri, 2 Mar 2007 13:02:50 -0800 Subject: [Pythonmac-SIG] Testing sqlite3 on python2.5 More In-Reply-To: <509C0063-238D-42A8-9630-868D8815FEDF@samuelsmith.org> References: <4186BE5E-EE60-45CE-AC02-22D28BDC968E@samuelsmith.org> <509C0063-238D-42A8-9630-868D8815FEDF@samuelsmith.org> Message-ID: <6a36e7290703021302h4d9fcf5ek79e7c51e6c0bb15a@mail.gmail.com> On 3/2/07, Samuel M. Smith wrote: > > I was able to run the example from the python library docs for pysqlite3 > I assume that means my sqlite3 installation is good? > I would appreciate confirmation from somebody who knows what they are > doing. > Python 2.5 ships with a working SQLite binding. My guess is that Roundup does not support Python 2.5 yet. I'm relatively sure that pysqlite's module name got renamed when it was included with the standard library. -bob From smithsm at samuelsmith.org Fri Mar 2 23:49:46 2007 From: smithsm at samuelsmith.org (Samuel M. Smith) Date: Fri, 2 Mar 2007 15:49:46 -0700 Subject: [Pythonmac-SIG] Testing sqlite3 on python2.5 More In-Reply-To: <6a36e7290703021302h4d9fcf5ek79e7c51e6c0bb15a@mail.gmail.com> References: <4186BE5E-EE60-45CE-AC02-22D28BDC968E@samuelsmith.org> <509C0063-238D-42A8-9630-868D8815FEDF@samuelsmith.org> <6a36e7290703021302h4d9fcf5ek79e7c51e6c0bb15a@mail.gmail.com> Message-ID: <14D47C27-51A5-4AD2-A385-7FF3497E1BE3@samuelsmith.org> On Mar 2, 2007, at 14:02 , Bob Ippolito wrote: > On 3/2/07, Samuel M. Smith wrote: >> >> I was able to run the example from the python library docs for >> pysqlite3 >> I assume that means my sqlite3 installation is good? >> I would appreciate confirmation from somebody who knows what they are >> doing. >> > > Python 2.5 ships with a working SQLite binding. > > My guess is that Roundup does not support Python 2.5 yet. I'm > relatively sure that pysqlite's module name got renamed when it was > included with the standard library. The module name in python 2.5 is sqlite3 I was able to get roundup to work fine (at least it comes up and I can do basic stuff haven't fully tested everything) using the built in roundup-server with python 2.5 using anydbm backend, which on my system looked to be dbm. The problems came when I tried to change to the sqlite backend. It crashes when you first try to hit the web page. I got the bugs below in case anyone is interested. I have also posted to the roundup users list. But so far no response. the roundup code seems to imply it works with sqlite3 bindings which I believe first appeared in 2.5. this snippet from roundup's back_sqlite.py sqlite_version = None try: import sqlite sqlite_version = 1 except ImportError: try: from pysqlite2 import dbapi2 as sqlite if sqlite.version_info < (2,1,0): raise ValueError('pysqlite2 minimum version is 2.1.0+ ' '- %s found'%sqlite.version) sqlite_version = 2 except ImportError: import sqlite3 as sqlite sqlite_version = 3 Got hung up on the sqlite bugs so haven't had time to try the apache2 mod_python way of running roundup nor your suggestion of using a reverse proxy instead of mod_python ("yikes" never heard of it before, apache2 docs confusing me). BUG ************************************************************ when browsing to http://localhost:8917/adeptdev/ get the following error : unsupported file format Python 2.5 /Library/Frameworks/Python.framework/Versions/2.5/Resources/ Python.app/Contents/MacOS/Python A problem occurred while running a Python script. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call first. The exception attributes are: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/roundup/backends/rdbms_common.py in load_dbschema (self=) 180 ''' Load the schema definition that the database currently implements 181 ''' 182 self.cursor.execute('select schema from schema') self = , global cursor = undefined, global execute = undefined 183 schema = self.cursor.fetchone() 184 if schema: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/roundup/backends/back_sqlite.py in open_connection (self=) 120 121 (self.conn, self.cursor) = self.sql_open_connection() 122 123 try: 124 self.load_dbschema() /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/roundup/backends/rdbms_common.py in __init__(self=, config=, journaltag='admin') 127 128 # open a connection to the database, creating the "conn" attribute 129 self.open_connection() self = , global open_connection = undefined 130 131 def clearCache(self): /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/roundup/instance.py in open(self=, name='admin') 100 'Boolean': hyperdb.Boolean, 101 'Number': hyperdb.Number, 102 'db': backend.Database(self.config, name) backend = , global Database = undefined, self = , global config = undefined, name = 'admin' 103 } 104 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/roundup/cgi/client.py in opendb (self=, username='admin') 529 # open the database or only set the user 530 if not hasattr(self, 'db'): 531 self.db = self.instance.open(username) self = , global db = undefined, global instance = undefined, global open = undefined, username = 'admin' 532 else: 533 if self.instance.optimize: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/roundup/cgi/client.py in determine_user (self=) 443 def determine_user(self): 444 """Determine who the user is""" 445 self.opendb('admin') self = , global opendb = undefined 446 447 # make sure we have the session Class /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/roundup/cgi/client.py in inner_main (self=) 256 257 # make sure we're identified (even anonymously) 258 self.determine_user() self = , global determine_user = undefined 259 260 # figure out the context and desired content template From smithsm at samuelsmith.org Sat Mar 3 01:30:39 2007 From: smithsm at samuelsmith.org (Samuel M. Smith) Date: Fri, 2 Mar 2007 17:30:39 -0700 Subject: [Pythonmac-SIG] Testing sqlite3 on python2.5 More In-Reply-To: <14D47C27-51A5-4AD2-A385-7FF3497E1BE3@samuelsmith.org> References: <4186BE5E-EE60-45CE-AC02-22D28BDC968E@samuelsmith.org> <509C0063-238D-42A8-9630-868D8815FEDF@samuelsmith.org> <6a36e7290703021302h4d9fcf5ek79e7c51e6c0bb15a@mail.gmail.com> <14D47C27-51A5-4AD2-A385-7FF3497E1BE3@samuelsmith.org> Message-ID: <589B2B46-B12F-43A8-97B9-22B16E4FB176@samuelsmith.org> > > Got hung up on the sqlite bugs so haven't had time to try the > apache2 mod_python way of running roundup nor > your suggestion of using a reverse proxy instead of mod_python > ("yikes" never heard of it before, apache2 docs confusing me). > Found an example for doing a reverse proxy for roundup with apache. Had to modify it for apache2 but the simple example worked yeah! add to /opt/local/apache2/conf/httpd.conf #added for roundup reverse proxy ProxyRequests Off #proxy thru one issue tracker ProxyPass /adeptsupport/ http://127.0.0.1:8917/adeptsupport/ #proxy all issues #ProxyPass /roundup/ http://localhost:8917/ sudo /opt/local/apache2/bin/apachectl restart From smithsm at samuelsmith.org Sun Mar 4 23:11:06 2007 From: smithsm at samuelsmith.org (Samuel M. Smith) Date: Sun, 4 Mar 2007 15:11:06 -0700 Subject: [Pythonmac-SIG] Testing sqlite3 on python2.5 More In-Reply-To: <589B2B46-B12F-43A8-97B9-22B16E4FB176@samuelsmith.org> References: <4186BE5E-EE60-45CE-AC02-22D28BDC968E@samuelsmith.org> <509C0063-238D-42A8-9630-868D8815FEDF@samuelsmith.org> <6a36e7290703021302h4d9fcf5ek79e7c51e6c0bb15a@mail.gmail.com> <14D47C27-51A5-4AD2-A385-7FF3497E1BE3@samuelsmith.org> <589B2B46-B12F-43A8-97B9-22B16E4FB176@samuelsmith.org> Message-ID: <05A86462-C764-4407-8B90-545C1315CEFA@samuelsmith.org> I was able to get sqlite3 from python2.5 to work as a backend for roundup. The problem is that I had installed pysqlite2 and roundup defaults to using pysqlite2 over sqlite3 if it is available. I thought I had disabled the use of pysqlite2 by editing the back_sqlite.py file but that didn't acually disable it completely. When I unistalled pysqlite2 then sqlite3 worked. On Mar 2, 2007, at 17:30 , Samuel M. Smith wrote: >> >> Got hung up on the sqlite bugs so haven't had time to try the >> apache2 mod_python way of running roundup nor >> your suggestion of using a reverse proxy instead of mod_python >> ("yikes" never heard of it before, apache2 docs confusing me). >> > > Found an example for doing a reverse proxy for roundup with apache. > Had to modify it for apache2 but > the simple example worked yeah! > > add to /opt/local/apache2/conf/httpd.conf > > #added for roundup reverse proxy > ProxyRequests Off > > > #proxy thru one issue tracker > ProxyPass /adeptsupport/ http://127.0.0.1:8917/adeptsupport/ > #proxy all issues > #ProxyPass /roundup/ http://localhost:8917/ > > > sudo /opt/local/apache2/bin/apachectl restart > > ********************************************************************** Samuel M. Smith Ph.D. 2966 Fort Hill Road Eagle Mountain, Utah 84005-4108 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 ngoodspeed at solidworks.com Fri Mar 2 15:09:51 2007 From: ngoodspeed at solidworks.com (Nat Goodspeed) Date: Fri, 2 Mar 2007 09:09:51 -0500 Subject: [Pythonmac-SIG] py2app iconfile not working? Message-ID: <94F7A8DD4408D8499C6812FE42E2D4B7CA6F9C@corp-mail4.solidworks.swk> @Tim Ansell from November 27, 2006: http://www.mail-archive.com/pythonmac-sig at python.org/msg06196.html I read with interest Frank Niessink's suggestion of 26 Nov 2006: http://www.mail-archive.com/pythonmac-sig at python.org/msg06195.html > I had a similar issue. Adding a plist option to the py2app options > solved it. See setup.py fragment below. > > setupOptions.update(dict(app=['taskcoach.py'], > setup_requires=['py2app'], > options=dict(py2app=dict(argv_emulation=True, compressed=True, > dist_dir=builddir, optimize=2, > iconfile='icons.in/taskcoach.icns', > packages=['i18n'], > plist=dict(CFBundleIconFile='taskcoach.icns'))))) It seems possible to me that the app-bundle icon functionality broke (or at least changed) when we upgraded from py2app 0.2.x to 0.3.5. Perhaps the iconfile option used to set CFBundleIconFile in the plist as well as copying the .icns file, but now it no longer does that. In any case, we used to get the desired app icon, but it stopped working. My first approach was to introduce a plist item CFBundleIconFile="path/to/my/icon.icns". That didn't work. Then I realized that py2app's iconfile option places the specified file in the new app bundle's Resources directory, and that my CFBundleIconFile should be specified simply as "icon.icns" (the basename of my desired icon file, not the relative path). When I made that change, py2app resumed setting my desired app icon. Admittedly I'm running py2app on Tiger 10.4.8. Sorry this isn't properly appended to the original thread, but I'm not a subscriber. From chris.van.bael at gmail.com Mon Mar 5 13:45:25 2007 From: chris.van.bael at gmail.com (Chris Van Bael) Date: Mon, 5 Mar 2007 13:45:25 +0100 Subject: [Pythonmac-SIG] How to make 2 scripts in one application In-Reply-To: <5465ee790702270612x3973daa2y29bb73bff3956faa@mail.gmail.com> References: <5465ee790702270612x3973daa2y29bb73bff3956faa@mail.gmail.com> Message-ID: <5465ee790703050445k7b69df9ck19739bf8259dd486@mail.gmail.com> Hi all, doesn't anybody have an idea on how to solve this issue? Thanks, Chris On 2/27/07, Chris Van Bael wrote: > Hi all, > > Maybe a totally noob question, but I'll ask it anyway since I couldn't > find an answer on the series of tubes... > I'm working on a pygame program that runs on Linux, Windows and Mac. > It uses an database which it accesses through SQLAlchemy. > So on Linux in setup.py we have a section to install the program and > create that database. > Now on Windows with py2exe I have a setup.py which has a console and a > windows script. > The windows script runs the program and the console script sets up the database. > Since I use no library.zip file, this can also access the SQLAlchemy modules. > > Now I want to do something similar to that for OSX. > I cannot run the script with the python installed on OSX because it > needs SQLAlchemy. > But the modules I need are somewhere in the application bundle, can I > use them somehow? > > Greets, > > Chris > From delza at livingcode.org Mon Mar 5 18:02:48 2007 From: delza at livingcode.org (Dethe Elza) Date: Mon, 5 Mar 2007 09:02:48 -0800 Subject: [Pythonmac-SIG] How to make 2 scripts in one application In-Reply-To: <5465ee790703050445k7b69df9ck19739bf8259dd486@mail.gmail.com> References: <5465ee790702270612x3973daa2y29bb73bff3956faa@mail.gmail.com> <5465ee790703050445k7b69df9ck19739bf8259dd486@mail.gmail.com> Message-ID: <24B3A793-B711-4479-8415-B02B49CAFF35@livingcode.org> On 5-Mar-07, at 4:45 AM, Chris Van Bael wrote: > Hi all, > > doesn't anybody have an idea on how to solve this issue? Sorry, didn't see your original post. You can address the python instance in the application bundle (which will use the modules in the application bundle), but I think you'll need to know the path the the application. If the application will always be in /Applications/ then you're good to go, otherwise you'll need to have another way to find the Application location (there are several, how you do this depends on several things I don't know about your deployment environment). For instance, I have an application named "Drawing Board" in my / Applications directory, that was build using py2app. I can invoke the python embedded in it with the path: /Applications/Drawing\ Board.app/Contents/MacOS/python So if my script starts with #!/Applications/Drawing\ Board.app/Contents/MacOS/python then it will run using that version of Python by default and have access to any libraries I've included with my application. Does that answer your question? --Dethe > > Thanks, > > Chris > > On 2/27/07, Chris Van Bael wrote: >> Hi all, >> >> Maybe a totally noob question, but I'll ask it anyway since I >> couldn't >> find an answer on the series of tubes... >> I'm working on a pygame program that runs on Linux, Windows and Mac. >> It uses an database which it accesses through SQLAlchemy. >> So on Linux in setup.py we have a section to install the program and >> create that database. >> Now on Windows with py2exe I have a setup.py which has a console >> and a >> windows script. >> The windows script runs the program and the console script sets up >> the database. >> Since I use no library.zip file, this can also access the >> SQLAlchemy modules. >> >> Now I want to do something similar to that for OSX. >> I cannot run the script with the python installed on OSX because it >> needs SQLAlchemy. >> But the modules I need are somewhere in the application bundle, can I >> use them somehow? >> >> Greets, >> >> Chris >> > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig Things fall apart. The Centre cannot hold. -- W. B. Yeats From chris.van.bael at gmail.com Mon Mar 5 20:17:46 2007 From: chris.van.bael at gmail.com (Chris Van Bael) Date: Mon, 5 Mar 2007 20:17:46 +0100 Subject: [Pythonmac-SIG] How to make 2 scripts in one application In-Reply-To: <24B3A793-B711-4479-8415-B02B49CAFF35@livingcode.org> References: <5465ee790702270612x3973daa2y29bb73bff3956faa@mail.gmail.com> <5465ee790703050445k7b69df9ck19739bf8259dd486@mail.gmail.com> <24B3A793-B711-4479-8415-B02B49CAFF35@livingcode.org> Message-ID: <5465ee790703051117p226a172v49596654446fc332@mail.gmail.com> On 3/5/07, Dethe Elza wrote: > On 5-Mar-07, at 4:45 AM, Chris Van Bael wrote: > > > Hi all, > > > > doesn't anybody have an idea on how to solve this issue? > > Sorry, didn't see your original post. > > You can address the python instance in the application bundle (which > will use the modules in the application bundle), but I think you'll > need to know the path the the application. If the application will > always be in /Applications/ then you're good to go, otherwise you'll > need to have another way to find the Application location (there are > several, how you do this depends on several things I don't know about > your deployment environment). > > For instance, I have an application named "Drawing Board" in my / > Applications directory, that was build using py2app. I can invoke > the python embedded in it with the path: > > /Applications/Drawing\ Board.app/Contents/MacOS/python > > So if my script starts with > > #!/Applications/Drawing\ Board.app/Contents/MacOS/python > > then it will run using that version of Python by default and have > access to any libraries I've included with my application. > > Does that answer your question? Definitely! Thanks. Problem is indeed the location of the application. I'll try some things out. Chris From jwt at onjapan.net Mon Mar 5 20:38:26 2007 From: jwt at onjapan.net (Jim Tittsler) Date: Tue, 6 Mar 2007 08:38:26 +1300 Subject: [Pythonmac-SIG] py2app iconfile not working? In-Reply-To: <94F7A8DD4408D8499C6812FE42E2D4B7CA6F9C@corp-mail4.solidworks.swk> References: <94F7A8DD4408D8499C6812FE42E2D4B7CA6F9C@corp-mail4.solidworks.swk> Message-ID: On Mar 3, 2007, at 03:09, Nat Goodspeed wrote: > It seems possible to me that the app-bundle icon functionality > broke (or > at least changed) when we upgraded from py2app 0.2.x to 0.3.5. Perhaps > the iconfile option used to set CFBundleIconFile in the plist as > well as > copying the .icns file, but now it no longer does that. In any > case, we > used to get the desired app icon, but it stopped working. This problem is fixed in the subversion repository version... there just hasn't been a "release" since it was fixed. -- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/crew/jwt/ Mailman IRC irc://irc.freenode.net/#mailman From ronaldoussoren at mac.com Tue Mar 6 08:04:38 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 6 Mar 2007 08:04:38 +0100 Subject: [Pythonmac-SIG] py2app iconfile not working? In-Reply-To: References: <94F7A8DD4408D8499C6812FE42E2D4B7CA6F9C@corp-mail4.solidworks.swk> Message-ID: <83AFE597-B945-490F-89BF-FCFBAF1EB4BF@mac.com> On 5 Mar, 2007, at 20:38, Jim Tittsler wrote: > On Mar 3, 2007, at 03:09, Nat Goodspeed wrote: >> It seems possible to me that the app-bundle icon functionality >> broke (or >> at least changed) when we upgraded from py2app 0.2.x to 0.3.5. >> Perhaps >> the iconfile option used to set CFBundleIconFile in the plist as >> well as >> copying the .icns file, but now it no longer does that. In any >> case, we >> used to get the desired app icon, but it stopped working. > > This problem is fixed in the subversion repository version... there > just hasn't been a "release" since it was fixed. NSBundle.mainBundle().bundlePath() gives you the root of your application, then start the script using subprocess.call(appRoot + "/ Contents/MacOS/python", appRoot + "/Contents/Resources/yourscript"), that is explicitly pick the python interpreter to be used. IIRC sys.executable also refers to the python interpreter embedded in the app bundle. Ronald > > > -- > Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 > Python Starship http://Starship.Python.net/crew/jwt/ > Mailman IRC irc://irc.freenode.net/#mailman > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From fairwinds at eastlink.ca Wed Mar 7 15:23:04 2007 From: fairwinds at eastlink.ca (David Pratt) Date: Wed, 07 Mar 2007 10:23:04 -0400 Subject: [Pythonmac-SIG] Pythonmac 2.4.4 (PPC) and mod_python problems In-Reply-To: <05A86462-C764-4407-8B90-545C1315CEFA@samuelsmith.org> References: <4186BE5E-EE60-45CE-AC02-22D28BDC968E@samuelsmith.org> <509C0063-238D-42A8-9630-868D8815FEDF@samuelsmith.org> <6a36e7290703021302h4d9fcf5ek79e7c51e6c0bb15a@mail.gmail.com> <14D47C27-51A5-4AD2-A385-7FF3497E1BE3@samuelsmith.org> <589B2B46-B12F-43A8-97B9-22B16E4FB176@samuelsmith.org> <05A86462-C764-4407-8B90-545C1315CEFA@samuelsmith.org> Message-ID: <45EECAC8.5020604@eastlink.ca> Hi. I have pythonmac python 2.4.4 installed on my PPC on Mac OSX 10.3.9 and having trouble building mod_python for Apache 2.0.59. I have built apache just fine. Config for mod_python 3.3.1 looks good and output is below. Failing on make due to arch flags and getting a number of warnings on pointer type, use of long doubles. Hope someone can help. Many thanks. Regards, David configuration: [Mac-PG:~/Desktop/mod_python-3.3.1] davidpra% ./configure --with-apxs=/usr/local/apache2/bin/apxs checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ar... ar checking for a BSD-compatible install... /usr/bin/install -c checking whether make sets $(MAKE)... yes checking for main in -lm... yes checking for an ANSI C-conforming const... yes checking your blood pressure... a bit high, but we can proceed configure: checking whether apxs is available... checking for --with-apxs... /usr/local/apache2/bin/apxs executable, good checking Apache version... 2.0.59 checking for Apache libexec directory... /usr/local/apache2/modules checking for Apache include directory... -I/usr/local/apache2/include checking for --with-python... no checking for python... /Library/Frameworks/Python.framework/Versions/Current/bin/python checking Python version... 2.4 checking Python install prefix... /Library/Frameworks/Python.framework/Versions/2.4 checking checking where python libraries are installed... /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4 checking what libraries Python was linked with... -framework Python -ldl checking linker flags used to link Python... checking where Python include files are... -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 checking for --with-python-src... no checking for --with-mutex-dir... no Using MUTEX_DIR /tmp checking for --with-max-locks... no Using 8 MAX_LOCKS. checking for --with-flex... no checking for flex... /opt/local/bin/flex found /opt/local/bin/flex, we'll use this. Use --with-flex to specify another. checking flex version... 2.5.33. Good configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating Doc/Makefile config.status: creating src/include/mod_python.h config.status: creating test/Makefile config.status: creating test/testconf.py config.status: creating dist/setup.py config.status: creating dist/Makefile Here are my tracebacks: I am seeing things like: mod_python.c: In function `python_init': mod_python.c:826: warning: initialization from incompatible pointer type also a pile of warnings on long double usage. Here is the final part of the compile with the failures: from /Users/davidpratt/Desktop/mod_python-3.3.1/src/include/mod_python.h:80, from finfoobject.c:25: /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/objimpl.h:255: warning: use of `long double' type; its size may change in a future release /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/objimpl.h:255: warning: (Long double usage is reported only once for each file. /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/objimpl.h:255: warning: To disable this warning, use -Wno-long-double.) /usr/local/apache2/build/libtool --silent --mode=link gcc -o mod_python.la -rpath /usr/local/apache2/modules -module -avoid-version finfoobject.lo hlistobject.lo hlist.lo filterobject.lo connobject.lo serverobject.lo util.lo tableobject.lo requestobject.lo _apachemodule.lo mod_python.lo -Wl,-framework,Python -u _PyMac_Error /Versions// -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -lm -framework Python -ldl ld: for architecture i386 ld: warning /usr/lib/bundle1.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/finfoobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/hlistobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/hlist.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/filterobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/connobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/serverobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/util.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/tableobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/requestobject.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/_apachemodule.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning .libs/mod_python.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning /usr/lib/libm.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning /usr/lib/libdl.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning /usr/lib/gcc/darwin/3.3/libgcc.a archive's cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (can't load from it) ld: warning /usr/lib/libSystem.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning /usr/lib/libSystem.B.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: for architecture ppc ld: Undefined symbols: _fstatvfs referenced from Python expected to be defined in libSystem _lchown referenced from Python expected to be defined in libSystem _statvfs referenced from Python expected to be defined in libSystem apxs:Error: Command failed with rc=65536 . make[1]: *** [mod_python.so] Error 1 make: *** [do_dso] Error 2 From vip at avatar.com.au Wed Mar 7 15:14:08 2007 From: vip at avatar.com.au (David Worrall) Date: Thu, 8 Mar 2007 01:14:08 +1100 Subject: [Pythonmac-SIG] library build example? Message-ID: <22507E57-34B2-45DA-9F6A-D612EE8106F6@avatar.com.au> Hi Folks, Background: I'm porting a number of c/c++ programs as libraries for python import using SWIG + SCONS or MAKE I can build a lib*.so library OK (a compiled c program uses it) I can SWIG to produce the *wrap.c and *.py files. I'm having trouble with the next step : linking/loading the *wrap.c and lib*.so library into a single library that can be loaded as a python module using the SWIG produced *.py file. Some questions: Do I need to make the first *so or not or is it necessary/usual practice to SWIG and then build the whole final library in one hit. Does anyone have a simple example using either SCONS or MAKE, which has the correct ld options for OSX10.4.8? I would appreciate any advice from those w. more experience than I on this matter. Thanks, David intel OSX 10.4.8, various versions of python 2.3 ->> _________________________________________________ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg vip=Verbal Interactivity Project From Chris.Barker at noaa.gov Wed Mar 7 20:33:54 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 07 Mar 2007 11:33:54 -0800 Subject: [Pythonmac-SIG] library build example? In-Reply-To: <22507E57-34B2-45DA-9F6A-D612EE8106F6@avatar.com.au> References: <22507E57-34B2-45DA-9F6A-D612EE8106F6@avatar.com.au> Message-ID: <45EF13A2.6060009@noaa.gov> David Worrall wrote: > Some questions: > Do I need to make the first *so or not or is it necessary/usual > practice to SWIG and then build the whole final library in one hit. I think this is a matter of preference really. However, if the "first *so" is only used for this one purpose, I see no need to built it as a separate lib. If you built it all in one go, you'll have an easier time distributing it. > Does anyone have a simple example using either SCONS or MAKE, which > has the correct ld options for OSX10.4.8? You'll have a much easier time building your python extension with distutils, which means building a setup.py file and running it with the build flag -- distutils will take care of setting up the compiler flags, etc to match your python build, and it's cross-platform too. See the distutils docs for how to do it. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 hengist.podd at virgin.net Wed Mar 7 16:53:44 2007 From: hengist.podd at virgin.net (has) Date: Wed, 7 Mar 2007 15:53:44 +0000 Subject: [Pythonmac-SIG] 64-bit MacPython? Message-ID: Hi all, Just wondering what the status of 64-bit support for MacPython is? I assume it's currently stuck at 32-bit due to all the older Mac- specific extensions; is there any sort of a plan/timescale for making it 64-bit clean? (I ask because I know py-appscript definitely isn't 64-bit compatible at the moment, and am trying to determine if I'll need to address this before Leopard ships or if can afford to leave it till later.) Thanks, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From bob at redivi.com Thu Mar 8 02:58:43 2007 From: bob at redivi.com (Bob Ippolito) Date: Wed, 7 Mar 2007 17:58:43 -0800 Subject: [Pythonmac-SIG] 64-bit MacPython? In-Reply-To: References: Message-ID: <6a36e7290703071758w4852ded2h81b4b19bba3a402e@mail.gmail.com> On 3/7/07, has wrote: > Hi all, > > Just wondering what the status of 64-bit support for MacPython is? I > assume it's currently stuck at 32-bit due to all the older Mac- > specific extensions; is there any sort of a plan/timescale for making > it 64-bit clean? > > (I ask because I know py-appscript definitely isn't 64-bit compatible > at the moment, and am trying to determine if I'll need to address > this before Leopard ships or if can afford to leave it till later.) > Until Leopard is released, there's not much that can be done publicly. None of the Mac-specific APIs will work in 64-bit prior to Leopard. I would say that you can leave it until later, I doubt anyone is going to be using a 64-bit MacPython any time soon (on the scale of at least months after Leopard is public). On top of that, I'm pretty sure that 10.4 has 64-bit bugs, at least on PPC. A while ago I attempted to build a unix-only PPC64 Python, but was unable to produce something that would run at all. This is unlikely to be Python's fault because it works on other PPC64 platforms. The newer Xcode builds may have resolved this issue, but there isn't much reason to care until Leopard is released. -bob From Chris.Barker at noaa.gov Thu Mar 8 19:32:40 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 08 Mar 2007 10:32:40 -0800 Subject: [Pythonmac-SIG] How to make an apt except Drag and Drop Message-ID: <45F056C8.8010203@noaa.gov> Hi all, I'm working on making an app accept drag and drop of files. It appears to do that I need to put the right incantations into the plist in the app bundle. Py2app helps out a lot with that, but now I need to figure out what incantations I need. The case at hand is a text editor, so I want: - It should accept ALL text files for editing. - It shouldn't impose its icon on anything. - Maybe it should accept all files -- you never really know, and it really bugs me when an app won't accept a file that the OS thinks it doesn't know what to do with -- if I get Garbage, I get Garbage. This is what I've tried: Plist = dict(CFBundleDocumentTypes= [dict(CFBundleTypeExtensions=["*"], CFBundleTypeRole="Editor"), ] ) That does seem to allow it to accept all files. What if I did just want text? There's no way to specify all the possible extensions. I've noticed that there is: CFBundleTypeName Which I could set to: "kUTTypeText" would that do it? And is the ByndleTypeName and BundleTypeExtensions an AND or OR relationship? This is all a bit confusing, as I thought OS-X figured out file types from combination of extensions, old Type and creator codes, and the *nix "file" utility. I that case, couldn't I just set a Mime-type or something, and let the OS (or is the Finder?) figure out extensions, etc. Is that what CFBundleTypeName does? Is there anything else I should do? This is a wxPython App, by the way but I don't think that effects this issue. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 bartsadres at hotmail.com Sat Mar 10 18:15:42 2007 From: bartsadres at hotmail.com (Bart van Dalen) Date: Sat, 10 Mar 2007 17:15:42 +0000 Subject: [Pythonmac-SIG] Microphone / video processing Message-ID: Hello,I am trying to write some code that lets me process a video stream. I own a macbook, so the only input I have is a firewire, and the output is the video out. I also want to read the microphone signal.1). How do I read a firewire signal?2). How do I send out the video signal again?3). How can I read the microphone?Thanks for replying! _________________________________________________________________ Zoek via Live.nl en ervaar het verschil. Test het NU, klik hier! http://www.live.com/?mkt=nl-nl -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070310/0bf3ac12/attachment.html From daniellord at mac.com Sun Mar 11 00:14:58 2007 From: daniellord at mac.com (Daniel Lord) Date: Sat, 10 Mar 2007 15:14:58 -0800 Subject: [Pythonmac-SIG] How to make an apt except Drag and Drop In-Reply-To: <45F056C8.8010203@noaa.gov> References: <45F056C8.8010203@noaa.gov> Message-ID: Christopher, I found an example in a wiki that works perfectly accepting objects before and after startup. http://wiki.wxpython.org/index.cgi/Optimizing_for_Mac_OS_X Towards the end there is a sample wxPython applications and a setup.py file. Be aware that you need to replace a line in the setup.py: change "from setuptools import setup" to "from distutils.core import setup" but with that one change it worked perfectly for me. My system is OS X 10.4.8 python 2.5 MacbookPro core 2 Duo Daniel On Mar 8, 2007, at 10:32, Christopher Barker wrote: > Hi all, > > I'm working on making an app accept drag and drop of files. It appears > to do that I need to put the right incantations into the plist in the > app bundle. > > Py2app helps out a lot with that, but now I need to figure out what > incantations I need. > > The case at hand is a text editor, so I want: > > - It should accept ALL text files for editing. > > - It shouldn't impose its icon on anything. > > - Maybe it should accept all files -- you never really know, and it > really bugs me when an app won't accept a file that the OS thinks it > doesn't know what to do with -- if I get Garbage, I get Garbage. > > This is what I've tried: > > Plist = dict(CFBundleDocumentTypes= [dict(CFBundleTypeExtensions= > ["*"], > CFBundleTypeRole="Editor"), > ] > ) > > That does seem to allow it to accept all files. What if I did just > want > text? There's no way to specify all the possible extensions. > > I've noticed that there is: > > CFBundleTypeName > > Which I could set to: "kUTTypeText" > > would that do it? And is the ByndleTypeName and > BundleTypeExtensions an > AND or OR relationship? > > This is all a bit confusing, as I thought OS-X figured out file types > from combination of extensions, old Type and creator codes, and the > *nix > "file" utility. I that case, couldn't I just set a Mime-type or > something, and let the OS (or is the Finder?) figure out extensions, > etc. Is that what CFBundleTypeName does? > > Is there anything else I should do? > > This is a wxPython App, by the way but I don't think that effects this > issue. > > -Chris > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (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 From tsila.hassine at gmail.com Sun Mar 11 19:02:17 2007 From: tsila.hassine at gmail.com (Tsila Hassine) Date: Sun, 11 Mar 2007 19:02:17 +0100 Subject: [Pythonmac-SIG] problems to install python 2.5 Message-ID: Hello all I downloaded Python 2.5 (final release) from python.org. I am trying to install it on my Mac 0s 10.4 the current working version i have of python is 2.3 (also built as a framework) It goes through the "./configure" part ok, but the "make install" produces the following errors : Modules/posixmodule.c:22: warning: ignoring #pragma weak lchown Modules/posixmodule.c:23: warning: ignoring #pragma weak statvfs Modules/posixmodule.c:24: warning: ignoring #pragma weak fstatvfs Modules/posixmodule.c: In function `posix_lchown': Modules/posixmodule.c:1681: warning: implicit declaration of function `lchown' Modules/posixmodule.c: In function `initposix': Modules/posixmodule.c:8588: error: `fstatvfs' undeclared (first use in this function) Modules/posixmodule.c:8588: error: (Each undeclared identifier is reported only once Modules/posixmodule.c:8588: error: for each function it appears in.) Modules/posixmodule.c:8596: error: `statvfs' undeclared (first use in this function) Modules/posixmodule.c:8604: error: `lchown' undeclared (first use in this function) make: *** [Modules/posixmodule.o] Error 1 I can't find any documentation of such a problem on the net, does anyone have a clue to what might be the problem ? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070311/6ee4f065/attachment.htm From ninad at nanorex.com Mon Mar 12 15:28:58 2007 From: ninad at nanorex.com (Ninad Sathaye) Date: Mon, 12 Mar 2007 10:28:58 -0400 Subject: [Pythonmac-SIG] Py2app: import errors while running the installedapp (PyQt4.Qt imports) In-Reply-To: <001001c75c15$5c54abf0$8714a8c0@india> References: <001001c75c15$5c54abf0$8714a8c0@india> Message-ID: <000401c764b2$c6493030$6f14a8c0@india> Hi all, Does anyone know how to resolve this issue? (or if this or similar topic has been discussed previously, can someone point me to that thread?) Thanks, Ninad > -----Original Message----- > From: Ninad Sathaye [mailto:ninad at nanorex.com] > Sent: Thursday, March 01, 2007 10:22 AM > To: pythonmac-sig at python.org > Subject: [Pythonmac-SIG] Py2app: import errors while running > the installedapp (PyQt4.Qt imports) > > Hi, > > I have built a package using py2app on MACOSX 10.3.9. My > application uses Qt4.2 > (PyQt4.1.x) framework. When run the application (installed > using the created > package) it gives import errors. > > Example: > " > from PyQt4.Qt import QApplication > ImportError : Cannot import name QApplication. > " > > Py2app seems to break my PyQt4 directory into two parts and > put them in different places : > (A) the Qt.pyc into > "/Contents/Resources/lib/python2.3/site-packages.zip/PyQt4" > > (B) and the .so files [Example: QtGui.so] into > "/Contents/Resources/lib/python2.3/lib-dynload/PyQt4" > > Am I leaving out a necessary option? [ I tried manually > copying .so files from > (B) to (A) ..that resolved the import problems but then my > app crashed.] > > ++++ > Note: During the pkg building process, I got an error which > seems identical to the one in this message -- > > "http://mail.python.org/pipermail/pythonmac-sig/2007-February/ > 018659.html" -- > > " malformed object (unknown flavor for flavor number 0 in > LC_UNIXTHREAD command 10 can't byte swap it) " > > But the package still got built. Could this be the > underlying problem? > > +++ > Specs -- > *System: PowerPC G4, OSX 10.3.9. > *Python version: Python2.3 > *Py2app details: py2app-0.3.5, macholib-1.1, > modulegraph-0.7, setuptools-0.6c3 > ++++ > > Any help would be greatly appreciated. > > Best Regards, > > Ninad > > > > From ronaldoussoren at mac.com Mon Mar 12 15:50:37 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 12 Mar 2007 07:50:37 -0700 Subject: [Pythonmac-SIG] Py2app: import errors while running theinstalledapp (PyQt4.Qt imports) In-Reply-To: <000401c764b2$c6493030$6f14a8c0@india> References: <001001c75c15$5c54abf0$8714a8c0@india> <000401c764b2$c6493030$6f14a8c0@india> Message-ID: On Monday, March 12, 2007, at 03:30PM, "Ninad Sathaye" wrote: > >Hi all, > >Does anyone know how to resolve this issue? (or if this or similar topic has >been discussed previously, can someone point me to that thread?) Could you try using the following command to build the app bundle: python setup.py py2app --packages=PyQt AFAIK Py2app used to contain some special code for PyQt but that got ripped out because it no longer worked with recent versions of PyQt and nobody bothered to send an updated recipe. Ronald > >Thanks, > >Ninad > >> -----Original Message----- >> From: Ninad Sathaye [mailto:ninad at nanorex.com] >> Sent: Thursday, March 01, 2007 10:22 AM >> To: pythonmac-sig at python.org >> Subject: [Pythonmac-SIG] Py2app: import errors while running >> the installedapp (PyQt4.Qt imports) >> >> Hi, >> >> I have built a package using py2app on MACOSX 10.3.9. My >> application uses Qt4.2 >> (PyQt4.1.x) framework. When run the application (installed >> using the created >> package) it gives import errors. >> >> Example: >> " >> from PyQt4.Qt import QApplication >> ImportError : Cannot import name QApplication. >> " >> >> Py2app seems to break my PyQt4 directory into two parts and >> put them in different places : >> (A) the Qt.pyc into >> "/Contents/Resources/lib/python2.3/site-packages.zip/PyQt4" >> >> (B) and the .so files [Example: QtGui.so] into >> "/Contents/Resources/lib/python2.3/lib-dynload/PyQt4" >> >> Am I leaving out a necessary option? [ I tried manually >> copying .so files from >> (B) to (A) ..that resolved the import problems but then my >> app crashed.] >> >> ++++ >> Note: During the pkg building process, I got an error which >> seems identical to the one in this message -- >> >> "http://mail.python.org/pipermail/pythonmac-sig/2007-February/ >> 018659.html" -- >> >> " malformed object (unknown flavor for flavor number 0 in >> LC_UNIXTHREAD command 10 can't byte swap it) " >> >> But the package still got built. Could this be the >> underlying problem? >> >> +++ >> Specs -- >> *System: PowerPC G4, OSX 10.3.9. >> *Python version: Python2.3 >> *Py2app details: py2app-0.3.5, macholib-1.1, >> modulegraph-0.7, setuptools-0.6c3 >> ++++ >> >> Any help would be greatly appreciated. >> >> Best Regards, >> >> Ninad >> >> >> >> > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG at python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > From ninad at nanorex.com Tue Mar 13 14:34:41 2007 From: ninad at nanorex.com (Ninad Sathaye) Date: Tue, 13 Mar 2007 09:34:41 -0400 Subject: [Pythonmac-SIG] Py2app: import errors while running the installed app (PyQt4.Qt imports) In-Reply-To: References: <001001c75c15$5c54abf0$8714a8c0@india> <000401c764b2$c6493030$6f14a8c0@india> Message-ID: <001101c76574$5b889d40$6f14a8c0@india> Hi Ronald, Thanks for the reply. I tried the command you suggested (with a minor modification) python setup.py py2app --packages=PyQt4 But during the pkg building process, it printed same error: " malformed object (unknown flavor for flavor number 0 in LC_UNIXTHREAD command 10 can't byte swap it) " (A) The pkg got built after this but the installed app failed to start...this time, it was unable to find PyQt4.Qt module. The package contents showed PyQt4 folder under "Contents/Resources/lib/python2.3/" (B) I manually transferred this PyQt4 to site-packages.zip ...it seemed to resolve the above import problem but this time it was unable to import Image module (Note: I could find this module under Contents/Resources/lib/python2.3/site-packages.zip ) . [ Item (B) above could be a different issue so I will stop here unless someone asks for further details ] Ninad P.S. In my last email, I neglected to mention about the errors I received during the package building process. The problem was similar to the one described in this post: http://mail.python.org/pipermail/pythonmac-sig/2006-August/018084.html and the temporary fix suggested there resolved it. (at least the pkg got built) > -----Original Message----- > From: Ronald Oussoren [mailto:ronaldoussoren at mac.com] > Sent: Monday, March 12, 2007 10:51 AM > To: Ninad Sathaye > Cc: pythonmac-sig at python.org > Subject: Re: [Pythonmac-SIG] Py2app: import errors while > running theinstalledapp (PyQt4.Qt imports) > > > On Monday, March 12, 2007, at 03:30PM, "Ninad Sathaye" > wrote: > > > >Hi all, > > > >Does anyone know how to resolve this issue? (or if this or similar > >topic has been discussed previously, can someone point me to that > >thread?) > > Could you try using the following command to build the app bundle: > > python setup.py py2app --packages=PyQt > > AFAIK Py2app used to contain some special code for PyQt but > that got ripped out because it no longer worked with recent > versions of PyQt and nobody bothered to send an updated recipe. > > Ronald > > > > >Thanks, > > > >Ninad > > > >> -----Original Message----- > >> From: Ninad Sathaye [mailto:ninad at nanorex.com] > >> Sent: Thursday, March 01, 2007 10:22 AM > >> To: pythonmac-sig at python.org > >> Subject: [Pythonmac-SIG] Py2app: import errors while running the > >> installedapp (PyQt4.Qt imports) > >> > >> Hi, > >> > >> I have built a package using py2app on MACOSX 10.3.9. My > application > >> uses Qt4.2 > >> (PyQt4.1.x) framework. When run the application > (installed using the > >> created > >> package) it gives import errors. > >> > >> Example: > >> " > >> from PyQt4.Qt import QApplication > >> ImportError : Cannot import name QApplication. > >> " > >> > >> Py2app seems to break my PyQt4 directory into two parts > and put them > >> in different places : > >> (A) the Qt.pyc into > >> "/Contents/Resources/lib/python2.3/site-packages.zip/PyQt4" > >> > >> (B) and the .so files [Example: QtGui.so] into > >> "/Contents/Resources/lib/python2.3/lib-dynload/PyQt4" > >> > >> Am I leaving out a necessary option? [ I tried manually > copying .so > >> files from > >> (B) to (A) ..that resolved the import problems but then my app > >> crashed.] > >> > >> ++++ > >> Note: During the pkg building process, I got an error which seems > >> identical to the one in this message -- > >> > >> "http://mail.python.org/pipermail/pythonmac-sig/2007-February/ > >> 018659.html" -- > >> > >> " malformed object (unknown flavor for flavor number 0 in > >> LC_UNIXTHREAD command 10 can't byte swap it) " > >> > >> But the package still got built. Could this be the underlying > >> problem? > >> > >> +++ > >> Specs -- > >> *System: PowerPC G4, OSX 10.3.9. > >> *Python version: Python2.3 > >> *Py2app details: py2app-0.3.5, macholib-1.1, modulegraph-0.7, > >> setuptools-0.6c3 > >> ++++ > >> > >> Any help would be greatly appreciated. > >> > >> Best Regards, > >> > >> Ninad > >> > >> > >> > >> > > > > > >_______________________________________________ > >Pythonmac-SIG maillist - Pythonmac-SIG at python.org > >http://mail.python.org/mailman/listinfo/pythonmac-sig > > > > > From dougalg at gmail.com Thu Mar 15 04:39:09 2007 From: dougalg at gmail.com (Dougal Graham) Date: Thu, 15 Mar 2007 01:09:09 -0230 Subject: [Pythonmac-SIG] Unicode Message-ID: <81ef6f500703142039p1c883d58k46f487cc8be1f500@mail.gmail.com> Hi there, I am having a problem with figuring out how to set utf-8 as the default encoding for python. I have found various references to sitecustomize.py, but I'm not sure where to put that file. I just recently updated to python 2.5 using the .dmg file from python.org. Any help would be greatly appreciated, Thanks, -Dougal -- Dougal Graham Home: (709) 753-2831 Cell: (709) 351-0587 From bob at redivi.com Thu Mar 15 05:02:09 2007 From: bob at redivi.com (Bob Ippolito) Date: Wed, 14 Mar 2007 21:02:09 -0700 Subject: [Pythonmac-SIG] Unicode In-Reply-To: <81ef6f500703142039p1c883d58k46f487cc8be1f500@mail.gmail.com> References: <81ef6f500703142039p1c883d58k46f487cc8be1f500@mail.gmail.com> Message-ID: <6a36e7290703142102w3c3bac01l253c1521d0dbc10a@mail.gmail.com> On 3/14/07, Dougal Graham wrote: > Hi there, > > I am having a problem with figuring out how to set utf-8 as the > default encoding for python. I have found various references to > sitecustomize.py, but I'm not sure where to put that file. I just > recently updated to python 2.5 using the .dmg file from python.org. > You really don't want to do that. The default encoding should always be ASCII, setting it to anything else breaks some invariants. The site-packages folder is one place to put stuff. It lives in /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages However, don't do it in this case. The reason you haven't been able to find a good resource that tells you how to do it is because it's not the correct thing to do. Here's Frederik's thoughts on the setting (and he is certainly an authority on Python's unicode implementation). """ sys.setdefaultencoding() was added for experimentation during Unicode development, and should not be used in production code. All sorts of ugliness can happen if you mess around with the conversion rules (especially if you use a variable-width encoding). It's not that hard to write encoding-aware code, really. """ -bob From dougalg at gmail.com Thu Mar 15 05:14:03 2007 From: dougalg at gmail.com (Dougal Graham) Date: Thu, 15 Mar 2007 01:44:03 -0230 Subject: [Pythonmac-SIG] Unicode In-Reply-To: <6a36e7290703142102w3c3bac01l253c1521d0dbc10a@mail.gmail.com> References: <81ef6f500703142039p1c883d58k46f487cc8be1f500@mail.gmail.com> <6a36e7290703142102w3c3bac01l253c1521d0dbc10a@mail.gmail.com> Message-ID: <81ef6f500703142114r423c4f49n76e1e3dd7329de0c@mail.gmail.com> Thanks for the quick reply! As I'm sure you can tell, I'm still fairly new to Python. Do you know of a tutorial on how to properly manage unicode in Python, then? I ran into trouble when trying to run a command containing unicode characters through commands.getoutput()... On 3/15/07, Bob Ippolito wrote: > On 3/14/07, Dougal Graham wrote: > > Hi there, > > > > I am having a problem with figuring out how to set utf-8 as the > > default encoding for python. I have found various references to > > sitecustomize.py, but I'm not sure where to put that file. I just > > recently updated to python 2.5 using the .dmg file from python.org. > > > > You really don't want to do that. The default encoding should always > be ASCII, setting it to anything else breaks some invariants. > > The site-packages folder is one place to put stuff. It lives in > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages > > However, don't do it in this case. The reason you haven't been able to > find a good resource that tells you how to do it is because it's not > the correct thing to do. > > Here's Frederik's thoughts on the setting (and he is certainly an > authority on Python's unicode implementation). > > """ > sys.setdefaultencoding() was added for experimentation during Unicode > development, and should not be used in production code. All sorts of > ugliness can happen if you mess around with the conversion rules > (especially if you use a variable-width encoding). It's not that hard > to write encoding-aware code, really. > """ > > -bob > -- Dougal Graham Home: (709) 753-2831 Cell: (709) 351-0587 From bob at redivi.com Thu Mar 15 05:18:56 2007 From: bob at redivi.com (Bob Ippolito) Date: Wed, 14 Mar 2007 21:18:56 -0700 Subject: [Pythonmac-SIG] Unicode In-Reply-To: <81ef6f500703142114r423c4f49n76e1e3dd7329de0c@mail.gmail.com> References: <81ef6f500703142039p1c883d58k46f487cc8be1f500@mail.gmail.com> <6a36e7290703142102w3c3bac01l253c1521d0dbc10a@mail.gmail.com> <81ef6f500703142114r423c4f49n76e1e3dd7329de0c@mail.gmail.com> Message-ID: <6a36e7290703142118k7b3264f7id16f7216991263f@mail.gmail.com> Here's a very recent, well written and pertinent article: http://boodebr.org/main/python/all-about-python-and-unicode -bob On 3/14/07, Dougal Graham wrote: > Thanks for the quick reply! As I'm sure you can tell, I'm still fairly > new to Python. Do you know of a tutorial on how to properly manage > unicode in Python, then? > > I ran into trouble when trying to run a command containing unicode > characters through commands.getoutput()... > > On 3/15/07, Bob Ippolito wrote: > > On 3/14/07, Dougal Graham wrote: > > > Hi there, > > > > > > I am having a problem with figuring out how to set utf-8 as the > > > default encoding for python. I have found various references to > > > sitecustomize.py, but I'm not sure where to put that file. I just > > > recently updated to python 2.5 using the .dmg file from python.org. > > > > > > > You really don't want to do that. The default encoding should always > > be ASCII, setting it to anything else breaks some invariants. > > > > The site-packages folder is one place to put stuff. It lives in > > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages > > > > However, don't do it in this case. The reason you haven't been able to > > find a good resource that tells you how to do it is because it's not > > the correct thing to do. > > > > Here's Frederik's thoughts on the setting (and he is certainly an > > authority on Python's unicode implementation). > > > > """ > > sys.setdefaultencoding() was added for experimentation during Unicode > > development, and should not be used in production code. All sorts of > > ugliness can happen if you mess around with the conversion rules > > (especially if you use a variable-width encoding). It's not that hard > > to write encoding-aware code, really. > > """ > > > > -bob > > > > > -- > Dougal Graham > Home: (709) 753-2831 > Cell: (709) 351-0587 > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From daniellord at mac.com Thu Mar 15 15:55:05 2007 From: daniellord at mac.com (Daniel Lord) Date: Thu, 15 Mar 2007 07:55:05 -0700 Subject: [Pythonmac-SIG] Unicode In-Reply-To: <6a36e7290703142118k7b3264f7id16f7216991263f@mail.gmail.com> References: <81ef6f500703142039p1c883d58k46f487cc8be1f500@mail.gmail.com> <6a36e7290703142102w3c3bac01l253c1521d0dbc10a@mail.gmail.com> <81ef6f500703142114r423c4f49n76e1e3dd7329de0c@mail.gmail.com> <6a36e7290703142118k7b3264f7id16f7216991263f@mail.gmail.com> Message-ID: Good article link, Thanks. On Mar 14, 2007, at 9:18 PM, Bob Ippolito wrote: > Here's a very recent, well written and pertinent article: > > http://boodebr.org/main/python/all-about-python-and-unicode > > -bob > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From David.L.Goldsmith at noaa.gov Fri Mar 16 18:10:51 2007 From: David.L.Goldsmith at noaa.gov (David Goldsmith) Date: Fri, 16 Mar 2007 10:10:51 -0700 Subject: [Pythonmac-SIG] How do I change my delivery status? Message-ID: <45FACF9B.7060105@noaa.gov> Thanks! DG From David.L.Goldsmith at noaa.gov Fri Mar 16 17:26:34 2007 From: David.L.Goldsmith at noaa.gov (David Goldsmith) Date: Fri, 16 Mar 2007 09:26:34 -0700 Subject: [Pythonmac-SIG] py2app-ed program runs on 4 out of 7 Macs tried Message-ID: <45FAC53A.5080204@noaa.gov> Hi, all! I have a py2app-ed application which imports numpy, Numeric, matplotlib, pylab, wx, wxmpl, "personal" modules, and standard distribution fare such as os, sys, datetime, etc. (perhaps the least common of these which are used are traceback and from __future__ import division). It runs on 4 of 7 Macs on which I've tried it (on the three on which it fails, it'll start up, get as far as momentarily displaying the menu bar portion of the main frame, and then crash). At first I thought it might have something to do with single vs. dual processors 'cause it ran on three single processor Macs (or at least I thought they were all single processor Macs, I just got info that one I thought was a single processor is actually a dual processor), crashed on 2 dual processors, but then it ran on a "duo" (= dual processor, correct?) and crashed on a single. Two of the machines on which it crashes are are running OS10.3.9, but the other appears to be running 10.4.8. Two on which it crashes (not the same two as in the previous sentence) are G5's while the other is a G4 and it does run on the G5 I just found out is a dual. I have crash logs and some Sys Profiler results to study, but won't be able to examine directory trees easily or soon (though if I'm told to look for specific files, I can ask the owners of the "bad" machines to do that for me). Any ideas, leads, guesses, and/or advice? Thanks! DG From kent37 at tds.net Sun Mar 18 18:15:27 2007 From: kent37 at tds.net (Kent Johnson) Date: Sun, 18 Mar 2007 13:15:27 -0400 Subject: [Pythonmac-SIG] Trouble with wxPython Message-ID: <45FD73AF.9090404@tds.net> I am having trouble getting wxPython apps to work. I have a MacBook Pro with OS X 10.4.8. I have Python 2.4.4 and Python 2.5 installed, both using the framework installs from pythonmac.org. I have several wx apps I would like to use: SPE and Firedrop, to start. I haven't been able to get them working correctly. I have tried with Python 2.4 and 2.5 and wxPython 2.6 and 2.8 (again using the installers from pythonmac.org). The best results I have had are with Python 2.5 and wxPython 2.8.0.1. With this setup, - SPE (using SPE from svn trunk) launches to show a menu bar. No windows open. When I select from the menu nothing happens. To quit I have to force quit from the dock (File/Quit does nothing) - Firedrop2 mostly works. Some of the font sizes are very small and it crashes with a bus error when I try to use some of the dialogs. For example selecting Options / Set font size bus errors in wxWindow::MacUpdateControlFont(). - The wx demos are strange. If I run them individually they work fine. If I run the demo app, some of the demos work but many of them show syntax errors on the first *blank* line of the source file. I know this is a quite vague. I really don't know where to start to fix this or where to go for help. Please let me know what information I can provide that would be helpful. Thanks, Kent From dougalg at gmail.com Sun Mar 18 20:50:15 2007 From: dougalg at gmail.com (Dougal Graham) Date: Sun, 18 Mar 2007 17:20:15 -0230 Subject: [Pythonmac-SIG] mod_python Message-ID: <81ef6f500703181250x71ebac3tcea05a4942fdc088@mail.gmail.com> Hey, this is actually a mod_python question. I thought it would be OK, but if it's inappropriate here, just lmk and I'll try somewhere else! Basically, I just installed mod_python 2.7.11 on apache 1.3.33. The installation docs suggest creating 2 files to test mod_python. The first is a .htaccess file containing: AddHandler python-program .py PythonHandler mptest PythonDebug On The second is a test file name mptest.py containing: from mod_python import apache def handler(req): req.send_http_header() req.write("Hello World!") return apache.OK When I try to navigate to this file (127.0.0.1/dir/mptest.py) I get a 500 internal server error. Any thoughts on what might be causing this?? Thanks a lot, -Dougal -- Dougal Graham Home: (709) 753-2831 Cell: (709) 351-0587 From bob at redivi.com Sun Mar 18 20:58:38 2007 From: bob at redivi.com (Bob Ippolito) Date: Sun, 18 Mar 2007 12:58:38 -0700 Subject: [Pythonmac-SIG] mod_python In-Reply-To: <81ef6f500703181250x71ebac3tcea05a4942fdc088@mail.gmail.com> References: <81ef6f500703181250x71ebac3tcea05a4942fdc088@mail.gmail.com> Message-ID: <6a36e7290703181258je6f5e85s8e88dab6d4832f44@mail.gmail.com> On 3/18/07, Dougal Graham wrote: > Hey, this is actually a mod_python question. I thought it would be OK, > but if it's inappropriate here, just lmk and I'll try somewhere else! > > Basically, I just installed mod_python 2.7.11 on apache 1.3.33. The > installation docs suggest creating 2 files to test mod_python. The > first is a .htaccess file containing: > > AddHandler python-program .py > PythonHandler mptest > PythonDebug On > > The second is a test file name mptest.py containing: > > from mod_python import apache > > def handler(req): > req.send_http_header() > req.write("Hello World!") > return apache.OK > > When I try to navigate to this file (127.0.0.1/dir/mptest.py) I get a > 500 internal server error. Any thoughts on what might be causing > this?? There's a lot of things that can cause mod_python to fail. I would highly recommend *not* using mod_python at all, ever, unless you absolutely must have to. Using a standalone (probably WSGI based) server behind mod_proxy, mod_fcgi, or mod_scgi is a much better solution 99.9% of the time. -bob From spe.stani.be at gmail.com Mon Mar 19 17:35:42 2007 From: spe.stani.be at gmail.com (Stani's Python Editor) Date: Mon, 19 Mar 2007 17:35:42 +0100 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? Message-ID: <45FEBBDE.80800@gmail.com> Hi, This is probably very easy, but I don't find how to do it. I want to execute this command if an user clicks on the icon of the alias on the desktop: /usr/bin/pythonw path/gui.pyw Thanks for any tips, Stani From ccoal.mail at gmail.com Tue Mar 20 03:04:33 2007 From: ccoal.mail at gmail.com (Calder Coalson) Date: Mon, 19 Mar 2007 21:04:33 -0500 Subject: [Pythonmac-SIG] (no subject) Message-ID: <8ED4E7E3-578F-4C00-8507-422DE44BA853@gmail.com> Dear Fellow Macppl, I've googled this problem, and other people have had it but no one has solved it. I've been developing Python/Cocoa apps for a little while, (I'm still bad at it) using the terminal 'python setup.py py2app' build sequence, but I'm making a document based application now and would like to use the xcode template. Unfortunately, the xcode build sequence doesn't work for me because I get the error: ImportError: No module named Py2app when I try to build the project. Any suggestions? Thanks, Calder From ronaldoussoren at mac.com Tue Mar 20 09:45:36 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 20 Mar 2007 09:45:36 +0100 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <45FEBBDE.80800@gmail.com> References: <45FEBBDE.80800@gmail.com> Message-ID: <5E0635F0-75DA-4CAC-A1FA-B5BF58C572AB@mac.com> On 19 Mar, 2007, at 17:35, Stani's Python Editor wrote: > Hi, > This is probably very easy, but I don't find how to do it. I want to > execute this command if an user clicks on the icon of the alias on the > desktop: > > /usr/bin/pythonw path/gui.pyw That short answer is that you don't really want this :-). What you seem to want is to create a clickable application and there are several ways to do that. The best way is use py2app to build a full application bundle, another alternative is using the Applet Builder in MacPython (but Apple doesn't ship this tool, so you cannot use this with /usr/bin/pythonw). Py2app can be found here: http://www.python.org/pypi/py2app. It includes a number of examples, including some wxPython ones. Ronald From ronaldoussoren at mac.com Tue Mar 20 09:48:12 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 20 Mar 2007 09:48:12 +0100 Subject: [Pythonmac-SIG] (no subject) In-Reply-To: <8ED4E7E3-578F-4C00-8507-422DE44BA853@gmail.com> References: <8ED4E7E3-578F-4C00-8507-422DE44BA853@gmail.com> Message-ID: <7ADC6657-A4D4-421E-8889-692FD893063F@mac.com> On 20 Mar, 2007, at 3:04, Calder Coalson wrote: > Dear Fellow Macppl, > > I've googled this problem, and other people have had it but no one > has solved it. I've been developing Python/Cocoa apps for a little > while, (I'm still bad at it) using the terminal 'python setup.py > py2app' build sequence, but I'm making a document based application > now and would like to use the xcode template. Unfortunately, the > xcode build sequence doesn't work for me because I get the error: > ImportError: No module named Py2app > > when I try to build the project. Any suggestions? The xcode template is using a different version of python. The easiest way to fix that is to replace the #! line at the top of setup.py by a line that mentions the absolute path of the python interpreter that you want to use. Ronald From alfred at 54.org Tue Mar 20 17:30:55 2007 From: alfred at 54.org (Alfred Morgan) Date: Tue, 20 Mar 2007 09:30:55 -0700 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? Message-ID: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> > > From: Stani's Python Editor > This is probably very easy, but I don't find how to do it. I want to > execute this command if an user clicks on the icon of the alias on the > desktop: > > /usr/bin/pythonw path/gui.pyw Like other people said, you probably don't want to do that, but unlike other people, I'll answer your question. mkdir ~/Desktop/MyProg.app echo '#!/usr/bin/env pythonw /path/gui.pyw' > ~/Desktop/MyProg.app/MyProg chmod +x ~/Desktop/MyProg.app/MyProg double click MyProg on the desktop and it should launch your python program using pythonw -- -alfred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070320/1436b7c6/attachment.htm From vivacarlie at gmail.com Tue Mar 20 22:32:50 2007 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Tue, 20 Mar 2007 16:32:50 -0500 Subject: [Pythonmac-SIG] XCode fails to see py2app In-Reply-To: <4574192B-14C0-4B1C-88F3-131B1B82055A@yahoo.com> References: <4574192B-14C0-4B1C-88F3-131B1B82055A@yahoo.com> Message-ID: <65fadfc30703201432o1144f66br67b0ec2bbf43223e@mail.gmail.com> The interesting thing i might add to this is that I couldn't import pyobjc for a while "from objc import *" in python 2.5 I had to spesificly invoke python 2.4 (% python2.4 ) in order import objc or wx after a package install. I also noticed that the pyobjc.sourceforge.netpage is down, all the links now just download the disk Image (dmg) On 1/14/07, Dennis Ng wrote: > > Dear all, > Following the examples http://developer.apple.com/cocoa/pyobjc.html as > well as using PyObjC 1.4 installer for (Universal) Python 2.4 on Mac OS X > 10.4 I have got an error message that Xcode cannot find py2app. There > is a thread on this topic but there is no answer on how to deal with it. > So I raised it again. It seems that it is a common problem to newbie and > for newly installed environment. > > It is noted if one run the source manually i.e. follow the instruction > using Xcode, interface builder, drop to terminal and do the > > python setup.py py2app > > The program will works but if you compile it under Xcode, it cannot: > > The details is as below and you may note that somehow Xcode can only > points to the Java and nothing Python in the compile environment: > > > *Building target "Development" of project "PyAverager" with configuration > "Development" ? (1 error)* > cd / > setenv ACTION > setenv APPLE_INTERNAL_DEVELOPER_DIR /AppleInternal/Developer > setenv APPLE_INTERNAL_DIR /AppleInternal > setenv APPLE_INTERNAL_DOCUMENTATION_DIR /AppleInternal/Documentation > setenv APPLE_INTERNAL_LIBRARY_DIR /AppleInternal/Library > setenv APPLE_INTERNAL_TOOLS /AppleInternal/Developer/Tools > setenv BUILD_COMPONENTS "headers build" > setenv BUILD_DIR "/Users/testuser/Desktop/pyObjC - averager/build" > setenv BUILD_ROOT "/Users/testuser/Desktop/pyObjC - averager/build" > setenv BUILD_STYLE Development > setenv BUILD_VARIANTS normal > setenv BUILT_PRODUCTS_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/Development" > setenv CC /usr/bin/cc > setenv CLASS_FILE_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/Development/Development.build/JavaClasses" > setenv CLONE_HEADERS NO > setenv CONFIGURATION Development > setenv CONFIGURATION_BUILD_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/Development" > setenv CONFIGURATION_TEMP_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/Development" > setenv COPY_PHASE_STRIP NO > setenv DEBUGGING_SYMBOLS YES > setenv DERIVED_FILES_DIR > setenv DERIVED_FILE_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/Development/Development.build/DerivedSources" > setenv DERIVED_SOURCES_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/Development/Development.build/DerivedSources" > setenv DEVELOPMENT_LANGUAGE English > setenv DO_HEADER_SCANNING_IN_JAM NO > setenv DSTROOT /tmp/PyAverager.dst > setenv ENABLE_HEADER_DEPENDENCIES YES > setenv FILE_LIST "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/Development/Development.build/Objects/LinkFileList" > setenv FRAMEWORK_VERSION A > setenv GCC3_VERSION 3.3 > setenv GROUP testuser > setenv HEADERMAP_INCLUDES_FLAT_ENTRIES_FOR_TARGET_BEING_BUILT YES > setenv HEADERMAP_INCLUDES_FRAMEWORK_ENTRIES_FOR_ALL_PRODUCT_TYPES YES > setenv HEADERMAP_INCLUDES_NONPUBLIC_NONPRIVATE_HEADERS YES > setenv HEADERMAP_INCLUDES_PROJECT_HEADERS YES > setenv INSTALL_DIR "/tmp/PyAverager.dst/(INSTALL_PATH)" > setenv INSTALL_GROUP testuser > setenv INSTALL_MODE_FLAG a-w,a+rX > setenv INSTALL_OWNER testuser > setenv INSTALL_ROOT /tmp/PyAverager.dst > setenv JAVA_APP_STUB > /System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub > setenv JAVA_ARCHIVE_CLASSES YES > setenv JAVA_ARCHIVE_TYPE JAR > setenv JAVA_COMPILER /usr/bin/javac > setenv JAVA_FRAMEWORK_RESOURCES_DIRS Resources > setenv JAVA_JAR_FLAGS cv > setenv JAVA_SOURCE_SUBDIR . > setenv JAVA_USE_DEPENDENCIES YES > setenv JAVA_ZIP_FLAGS -urg > setenv LOCAL_ADMIN_APPS_DIR /Applications/Utilities > setenv LOCAL_APPS_DIR /Applications > setenv LOCAL_DEVELOPER_DIR /Library/Developer > setenv LOCAL_LIBRARY_DIR /Library > setenv NATIVE_ARCH i386 > setenv OBJECT_FILE_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/Development/Development.build/Objects" > setenv OBJROOT "/Users/testuser/Desktop/pyObjC - averager/build" > setenv OPTIMIZATION_LEVEL 0 > setenv OS MACOS > setenv PATH_PREFIXES_EXCLUDED_FROM_HEADER_DEPENDENCIES "/usr/include > /usr/local/include /System/Library/Frameworks > /System/Library/PrivateFrameworks /Developer/Headers" > setenv PRODUCT_NAME > setenv PROFILING_CODE NO > setenv PROJECT PyAverager > setenv PROJECT_DERIVED_FILE_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/DerivedSources" > setenv PROJECT_DIR "/Users/testuser/Desktop/pyObjC - averager" > setenv PROJECT_FILE_PATH "/Users/testuser/Desktop/pyObjC - > averager/PyAverager.xcodeproj" > setenv PROJECT_NAME PyAverager > setenv PROJECT_TEMP_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build" > setenv REMOVE_CVS_FROM_RESOURCES YES > setenv REMOVE_SVN_FROM_RESOURCES YES > setenv SDKROOT > setenv SHARED_DERIVED_FILE_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/Development/DerivedSources" > setenv SOURCE_ROOT "/Users/testuser/Desktop/pyObjC - averager" > setenv SRCROOT "/Users/testuser/Desktop/pyObjC - averager" > setenv STRIP_INSTALLED_PRODUCT YES > setenv SYMROOT "/Users/testuser/Desktop/pyObjC - averager/build" > setenv SYSTEM_ADMIN_APPS_DIR /Applications/Utilities > setenv SYSTEM_APPS_DIR /Applications > setenv SYSTEM_CORE_SERVICES_DIR /System/Library/CoreServices > setenv SYSTEM_DEMOS_DIR /Applications/Extras > setenv SYSTEM_DEVELOPER_APPS_DIR /Developer/Applications > setenv SYSTEM_DEVELOPER_DEMOS_DIR > "/Developer/Applications/Utilities/Built Examples" > setenv SYSTEM_DEVELOPER_DIR /Developer > setenv SYSTEM_DEVELOPER_DOC_DIR "/Developer/ADC Reference Library" > setenv SYSTEM_DEVELOPER_GRAPHICS_TOOLS_DIR > "/Developer/Applications/Graphics Tools" > setenv SYSTEM_DEVELOPER_JAVA_TOOLS_DIR "/Developer/Applications/Java > Tools" > setenv SYSTEM_DEVELOPER_PERFORMANCE_TOOLS_DIR > "/Developer/Applications/Performance Tools" > setenv SYSTEM_DEVELOPER_RELEASENOTES_DIR "/Developer/ADC Reference > Library/releasenotes" > setenv SYSTEM_DEVELOPER_TOOLS /Developer/Tools > setenv SYSTEM_DEVELOPER_TOOLS_DOC_DIR "/Developer/ADC Reference > Library/documentation/DeveloperTools" > setenv SYSTEM_DEVELOPER_TOOLS_RELEASENOTES_DIR "/Developer/ADC > Reference Library/releasenotes/DeveloperTools" > setenv SYSTEM_DEVELOPER_UTILITIES_DIR > /Developer/Applications/Utilities > setenv SYSTEM_DOCUMENTATION_DIR /Library/Documentation > setenv SYSTEM_LIBRARY_DIR /System/Library > setenv TARGETNAME Development > setenv TARGET_BUILD_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/Development" > setenv TARGET_NAME Development > setenv TARGET_TEMP_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/Development/Development.build" > setenv TEMP_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/Development/Development.build" > setenv TEMP_FILES_DIR > setenv TEMP_FILE_DIR "/Users/testuser/Desktop/pyObjC - > averager/build/PyAverager.build/Development/Development.build" > setenv TEMP_ROOT "/Users/testuser/Desktop/pyObjC - averager/build" > setenv USER testuser > setenv USER_APPS_DIR /Users/testuser/Applications > setenv USER_LIBRARY_DIR /Users/testuser/Library > setenv XCODE_APP_SUPPORT_DIR "/Library/Application > Support/Apple/Developer Tools" > /usr/bin/env /Users/testuser/Desktop/pyObjC\ -\ averager/setup.py > py2app --alias > *Traceback (most recent call last):* > * File "/Users/testuser/Desktop/pyObjC - averager/setup.py", line 38, in > ?* > * import py2app* > *ImportError: No module named py2app* > *ImportError: No module named py2app* > *ImportError: No module named py2app* > *ImportError: No module named py2app* > *ImportError: No module named py2app* > *ImportError: No module named py2app* > Build failed (1 error) > * > * > > Somehow the py2app cannot be found. My environment is quite common for > macbook (Intel) i.e. > > it has the current version Python in > > /Library/Frameworks/Python.framework/Versions/2.4/ > > as well as an older library in > > /Library/Python/2.3/ > > but calling python would use the newer library > > The newly installed PyObjC has this: > > /Developer/Python/py2app/ > /Developer/Python/PyObjC/ > > The py2app example like TinyTinyEdit run ok under terminal compile method. > > Somehow the setup script cannot find the two libraries pyobjC installed > and seems to use Java environment. > > Any hint? > > Best regards. > > Dennis > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > -- "lalalalala! it's not broken because I can use it" http://linux.slashdot.org/comments.pl?sid=194281&threshold=1&commentsort=0&mode=thread&cid=15927703 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070320/726916c7/attachment-0001.html From vip at avatar.com.au Wed Mar 21 16:37:37 2007 From: vip at avatar.com.au (David Worrall) Date: Thu, 22 Mar 2007 02:37:37 +1100 Subject: [Pythonmac-SIG] 'normal' python library installations on OSX Message-ID: <419CA5BD-8ACA-40F4-B112-4FC47A5C6C8B@avatar.com.au> Hello all, I'm looking to install libraries in the OSX python framework structure using a simple shell script and I can't find a document which advises the 'normal' locations. given packAGE.py, (and various other .py files which it imports) _ packAGE.so and libpackAGE.dylib I've made a packAGE directory in /Library/Frameworks/Python.framework/Versions/Current/lib/python version/site-packages/packAGE within which I emplace packAGE.py, (and various other .py files which it imports) and _ packAGE.so I also place there an a __init__.py file in which I import packAGE.py but where is the 'proper' place to put libpackAGE.dylib? /usr/local/ lib ?? a short answer or reference to where I can find this info would be much appreciated. David _________________________________________________ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg From kw at codebykevin.com Wed Mar 21 18:42:32 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 21 Mar 2007 13:42:32 -0400 Subject: [Pythonmac-SIG] Display icons from Carbon? Message-ID: <46016E88.1010806@codebykevin.com> I'm trying to figure out how to display Mac-native icons in my Python application via Carbon. I can get the raw icon data via this snippet: from Carbon import Icn icon = Icn.GetIconRefFromFile('/Users/kevin/Desktop/myfile.doc') print icon (<_Res.Resource object at 0x4d110>, 0) However, after this, I'm not sure how to proceed. It appears I need to draw the icon using Icn.PlotIconRef, but there's no window in which to display the icon using the raw Carbon calls. Has anyone done this successfully from one of the GUI toolkits, say wxPython or Tkinter? (I'm using the latter, for what it's worth.) TIA, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From ccoal.mail at gmail.com Wed Mar 21 22:47:17 2007 From: ccoal.mail at gmail.com (Calder Coalson) Date: Wed, 21 Mar 2007 16:47:17 -0500 Subject: [Pythonmac-SIG] XCode fails to see py2app In-Reply-To: References: Message-ID: <9E0BC10A-1FF6-4C9B-82F9-6D48C33143DA@gmail.com> On Mar 21, 2007, at 5:30 AM, Nehemiah Dacres wrote: > Following the examples http://developer.apple.com/cocoa/pyobjc.html > as well as using PyObjC 1.4 installer for (Universal) Python 2.4 on > Mac OS X 10.4 I have got an error message that Xcode cannot find > py2app. There is a thread on this topic but there is no answer on > how to deal with it. So I raised it again. It seems that it is a > common problem to newbie and for newly installed environment. > > It is noted if one run the source manually i.e. follow the > instruction using Xcode, interface builder, drop to terminal and do > the > > python setup.py py2app > > The program will works but if you compile it under Xcode, it cannot Dennis, I have been having the exact same issue, and posted it to this mailing list two days ago. Ronald Oussoren helped me out with it yesterday. Here's what you do: 1) Create an xcode project using the PyObjC project template 2) Edit the very first line of 'setup.py' to: #!/path/to/python /path/to/python should be the path to the python interpreter you have py2app installed on. If in doubt, type 'which python' in Terminal. Copy that result right in. Good luck! -Calder -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070321/543b8bce/attachment.htm From Jack.Jansen at cwi.nl Fri Mar 23 11:12:30 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri, 23 Mar 2007 11:12:30 +0100 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> References: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> Message-ID: <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> On 20-mrt-2007, at 17:30, Alfred Morgan wrote: > From: Stani's Python Editor > This is probably very easy, but I don't find how to do it. I want to > execute this command if an user clicks on the icon of the alias on the > desktop: > > /usr/bin/pythonw path/gui.pyw > > Like other people said, you probably don't want to do that, but > unlike other people, I'll answer your question. > > mkdir ~/Desktop/MyProg.app > echo '#!/usr/bin/env pythonw /path/gui.pyw' > ~/Desktop/MyProg.app/ > MyProg > chmod +x ~/Desktop/MyProg.app/MyProg > > double click MyProg on the desktop and it should launch your python > program using pythonw I was very surprised when I saw this, I'd never seen this before. And, indeed, when I tried it it didn't work:-( Maybe you skipped an important step in the instructions? -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From kent_quirk at cognitoy.com Fri Mar 23 13:39:51 2007 From: kent_quirk at cognitoy.com (Kent Quirk) Date: Fri, 23 Mar 2007 08:39:51 -0400 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> References: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> Message-ID: <4603CA97.6040803@cognitoy.com> Jack Jansen wrote: > On 20-mrt-2007, at 17:30, Alfred Morgan wrote: > >> From: Stani's Python Editor >> This is probably very easy, but I don't find how to do it. I want to >> execute this command if an user clicks on the icon of the alias on the >> desktop: >> >> /usr/bin/pythonw path/gui.pyw >> >> Like other people said, you probably don't want to do that, but >> unlike other people, I'll answer your question. >> >> mkdir ~/Desktop/MyProg.app >> echo '#!/usr/bin/env pythonw /path/gui.pyw' > ~/Desktop/MyProg.app/ >> MyProg >> chmod +x ~/Desktop/MyProg.app/MyProg >> >> double click MyProg on the desktop and it should launch your python >> program using pythonw >> > > I was very surprised when I saw this, I'd never seen this before. > > And, indeed, when I tried it it didn't work:-( > Maybe you skipped an important step in the instructions? > Isn't it the case that you'd have to actually conform to the Apple bundle format, including the Contents directory, a plist, and so forth? If you're going to go through the pain, why not just use py2app, which does it for you? But if you really want to figure it out, here's the documentation: http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Concepts/BundleAnatomy.html Kent From kw at codebykevin.com Fri Mar 23 14:44:53 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 23 Mar 2007 09:44:53 -0400 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <4603CA97.6040803@cognitoy.com> References: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> <4603CA97.6040803@cognitoy.com> Message-ID: <4603D9D5.7000609@codebykevin.com> Kent Quirk wrote: > Jack Jansen wrote: >> On 20-mrt-2007, at 17:30, Alfred Morgan wrote: >> >>> From: Stani's Python Editor >>> This is probably very easy, but I don't find how to do it. I want to >>> execute this command if an user clicks on the icon of the alias on the >>> desktop: >>> >>> /usr/bin/pythonw path/gui.pyw >>> >>> Like other people said, you probably don't want to do that, but >>> unlike other people, I'll answer your question. >>> >>> mkdir ~/Desktop/MyProg.app >>> echo '#!/usr/bin/env pythonw /path/gui.pyw' > ~/Desktop/MyProg.app/ >>> MyProg >>> chmod +x ~/Desktop/MyProg.app/MyProg >>> >>> double click MyProg on the desktop and it should launch your python >>> program using pythonw >>> >> I was very surprised when I saw this, I'd never seen this before. >> >> And, indeed, when I tried it it didn't work:-( >> Maybe you skipped an important step in the instructions? >> > > Isn't it the case that you'd have to actually conform to the Apple > bundle format, including the Contents directory, a plist, and so forth? > If you're going to go through the pain, why not just use py2app, which > does it for you? > > But if you really want to figure it out, here's the documentation: > > http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Concepts/BundleAnatomy.html > > > Kent > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > Why not use the "build applet" utility that comes with the MacPython distribution? That's what I used when I was packaging SPE. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From Chris.Barker at noaa.gov Fri Mar 23 21:35:50 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 23 Mar 2007 13:35:50 -0700 Subject: [Pythonmac-SIG] Display icons from Carbon? In-Reply-To: <46016E88.1010806@codebykevin.com> References: <46016E88.1010806@codebykevin.com> Message-ID: <46043A26.2040004@noaa.gov> I don't know how to do this, but I do know: > Has anyone done this > successfully from one of the GUI toolkits, say wxPython wxPython does not support OS-X icon bundles. It certainly good, an icon bundle class does exist in wx, but no one has written the code for the OS-X version. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 Fri Mar 23 21:40:54 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 23 Mar 2007 13:40:54 -0700 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <4603CA97.6040803@cognitoy.com> References: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> <4603CA97.6040803@cognitoy.com> Message-ID: <46043B56.60000@noaa.gov> Kent Quirk wrote: > If you're going to go through the pain, why not just use py2app, which > does it for you? Because Py2App doesn't support "applets". That is, something that looks and acts like an application, but DOESN'T bundle up all the Python stuff. My vision of an "applet" would be a py2app like bundle, but one that would not include anything installed in the Python Framework (or system libs). i.e. all the app code, none of the Python environment. This has limited usefulness, as it would only work on a system with all the right Python stuff installed, but I think it would be useful non the less. Py2App does have an "alias" mode, but I don't think it bundles the app source either, it just keeps a reference of some sort to it. Is the old "build applet" working well with Python2.5, etc? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 alfred at 54.org Fri Mar 23 22:27:01 2007 From: alfred at 54.org (Alfred Morgan) Date: Fri, 23 Mar 2007 14:27:01 -0700 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> References: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> Message-ID: <64532d7f0703231427m118a30dq99d5f156d147f8ec@mail.gmail.com> On 3/23/07, Jack Jansen wrote: > > > I was very surprised when I saw this, I'd never seen this before. It's true, This is not the "proper" use of app framework but it was quick and dirty and worked for me. I don't like the answer "just drop it in this magic box and it will just work". It was mostly to prove a point that you don't need py2app just to solve the simple problem at hand (especially when py2app isn't working for people). And, indeed, when I tried it it didn't work:-( > Maybe you skipped an important step in the instructions? Hmm, I am interested in knowing why it didn't work. I am running on 10.4.9using python 2.4 Framework. Note: there are some unwanted arguments passed to the python program using the method I presented Here is a shell script I ran on several other os x installations so there is no doubt it will work and there are no missing steps. It basically creates a python program in /tmp/alfred_hw.py then creates alfred_hw application on the desktop so you can double click it and a window pops up with Hello World: #!/bin/sh cat > /tmp/alfred_hw.py << . from Tkinter import Tk, Label r=Tk() Label(r, text="Hello World").pack() r.mainloop() . mkdir ~/Desktop/alfred_hw.app cat > ~/Desktop/alfred_hw.app/alfred_hw << . #!/usr/bin/env pythonw /tmp/alfred_hw.py . chmod +x ~/Desktop/alfred_hw.app/alfred_hw Thanks for the BundleAnatomy link. -- -alfred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070323/bc06efc7/attachment.html From Jack.Jansen at cwi.nl Sat Mar 24 00:24:08 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat, 24 Mar 2007 00:24:08 +0100 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <64532d7f0703231427m118a30dq99d5f156d147f8ec@mail.gmail.com> References: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> <64532d7f0703231427m118a30dq99d5f156d147f8ec@mail.gmail.com> Message-ID: <6C695E58-92B9-4F2F-9CDD-6D1D4CA9D313@cwi.nl> On 23-Mar-2007, at 22:27 , Alfred Morgan wrote: > #!/bin/sh > cat > /tmp/alfred_hw.py << . > from Tkinter import Tk, Label > r=Tk() > Label(r, text="Hello World").pack() > r.mainloop() > . > mkdir ~/Desktop/alfred_hw.app > cat > ~/Desktop/alfred_hw.app/alfred_hw << . > #!/usr/bin/env pythonw /tmp/alfred_hw.py > . > chmod +x ~/Desktop/alfred_hw.app/alfred_hw Yes, this one works for me just fine!! I'm very surprised, because it does not follow any Apple guideline for application bundles that I've ever seen. (Also, I don't know what I did differently yesterday when it didn't work for me, but never mind that). BTW: you can make things even simpler by putting the Python code into alfred_hw. And moreover you don't need pythonw, apparently because you're in an App bundle already: #!/bin/sh mkdir ~/Desktop/alfred_hw.app cat > ~/Desktop/alfred_hw.app/alfred_hw << . #!/usr/bin/env python from Tkinter import Tk, Label r=Tk() Label(r, text="Hello World").pack() r.mainloop() . chmod +x ~/Desktop/alfred_hw.app/alfred_hw Is anyone else familiar with such simple .app bundles? -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070324/6e87b928/attachment.htm From njriley at uiuc.edu Sat Mar 24 01:03:42 2007 From: njriley at uiuc.edu (Nicholas Riley) Date: Fri, 23 Mar 2007 19:03:42 -0500 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <6C695E58-92B9-4F2F-9CDD-6D1D4CA9D313@cwi.nl> References: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> <64532d7f0703231427m118a30dq99d5f156d147f8ec@mail.gmail.com> <6C695E58-92B9-4F2F-9CDD-6D1D4CA9D313@cwi.nl> Message-ID: <20070324000342.GC86398@uiuc.edu> On Sat, Mar 24, 2007 at 12:24:08AM +0100, Jack Jansen wrote: > Is anyone else familiar with such simple .app bundles? That's how the various NeXT OSes - and OS X Server 1.x, IIRC - did it. (I did just try sticking the OS X Server 1.2 CD into a Mac running Tiger, but couldn't mount the Apple_Rhapsody_UFS partition.) -- Nicholas Riley | From lucio.torre at gmail.com Sat Mar 24 16:46:52 2007 From: lucio.torre at gmail.com (Lucio Torre) Date: Sat, 24 Mar 2007 12:46:52 -0300 Subject: [Pythonmac-SIG] Recording audio on Mac Message-ID: <999187ed0703240846l3294d538k676a08f280e9171f@mail.gmail.com> Hi, I want to record audio on mac. Ive seen that the function SPBRecord does what i need. (http://developer.apple.com/documentation/QuickTime/INMAC/SOUND/imsoundinput.19.htm) This function is wrapped in the Carbon.Snd python library. My problem is that i need to pass a SPBOjb parameter and im unable to create an object of that kind. Checking the source i see that the only reference i find to SPBObj_New is in the Snd_SPB function, wich is referenced as SPB in the module. static PyObject *Snd_SPB(PyObject *_self, PyObject *_args) { PyObject *_res = NULL; _res = SPBObj_New(); return _res; } static PyMethodDef Snd_methods[] = { {"SPB", (PyCFunction)Snd_SPB, 1, PyDoc_STR(NULL)}, ... } But when i try to create a SPB in python i get: >>> import Carbon.Snd as snd >>> snd.SPB() Traceback (most recent call last): File "", line 1, in ? TypeError: cannot create '_Snd.SPB' instances >>> Looking around in the code i see that: void init_Snd(void) { PyObject *m; m = Py_InitModule("_Snd", Snd_methods); ... PyModule_AddObject(m, "SPB", (PyObject *)&SPB_Type); ... } Is this overriding the other definition? I think so, from doing: >>> type(snd.SPB) >>> How i am supposed to create a SPB object? I even tried using snd.SPB as a base class but it would not work. Any ideas? Lucio From ronaldoussoren at mac.com Sun Mar 25 11:44:25 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 25 Mar 2007 11:44:25 +0200 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <46043B56.60000@noaa.gov> References: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> <4603CA97.6040803@cognitoy.com> <46043B56.60000@noaa.gov> Message-ID: <87F6F2E3-ABB2-4EDE-A061-5096F4F9D9B7@mac.com> On 23 Mar, 2007, at 21:40, Christopher Barker wrote: > Kent Quirk wrote: >> If you're going to go through the pain, why not just use py2app, >> which >> does it for you? > > Because Py2App doesn't support "applets". That is, something that > looks > and acts like an application, but DOESN'T bundle up all the Python > stuff. > > My vision of an "applet" would be a py2app like bundle, but one that > would not include anything installed in the Python Framework (or > system > libs). i.e. all the app code, none of the Python environment. You mean like "py2app --semi-standalone --site-packages"? This does require adding everything you don't want to be copied from site- packages to "--excludes" which is less than ideal. I know Bob is not in favor of this, but I wouldn't mind adding a "-- system-dependent-applet" option to py2app that builds an "applet" when that would help making py2app the obvious application bundle for everyone. I won't be writing the required code any time soon, but if someone does do the legwork I can look at the patch and apply it. > > This has limited usefulness, as it would only work on a system with > all > the right Python stuff installed, but I think it would be useful > non the > less. I thing this would be useful for inhouse applications where you have ful control over the system environment, although there is a risk of breaking application by installing a seemingly innocent python package that happens to conflict with something that's used by an application your using. Adding full support for python eggs would go a long way of fixing that problem. That is, py2app could force loading of specific versions of python eggs to load code from site-packages instead of using whatever happens to be on the default search path. That would significantly reduce the risk of breakage because setuptools does not yet have an easy to use uninstall tool (there's easy_install for installing but no easy_uninstall) > > Py2App does have an "alias" mode, but I don't think it bundles the app > source either, it just keeps a reference of some sort to it. > > Is the old "build applet" working well with Python2.5, etc? Yes, but I'd like to get rid of it in favor of py2app. Ronald From Jack.Jansen at cwi.nl Mon Mar 26 09:58:39 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon, 26 Mar 2007 09:58:39 +0200 Subject: [Pythonmac-SIG] Recording audio on Mac In-Reply-To: <999187ed0703240846l3294d538k676a08f280e9171f@mail.gmail.com> References: <999187ed0703240846l3294d538k676a08f280e9171f@mail.gmail.com> Message-ID: <48F41A81-0EA5-4A32-9FDD-E534EA7E6FE6@cwi.nl> On 24-mrt-2007, at 16:46, Lucio Torre wrote: > Hi, > > I want to record audio on mac. Ive seen that the function SPBRecord > does what i need. > (http://developer.apple.com/documentation/QuickTime/INMAC/SOUND/ > imsoundinput.19.htm) > > This function is wrapped in the Carbon.Snd python library. My problem > is that i need to pass a SPBOjb parameter and im unable to create an > object of that kind. Carbon.Snd is very old, and it hasn't seen much development in the last 8 years. Mainly because the API is baroque, and Apple has been steering people away from it for years. Quicktime is probably your best option for recording from Python, but I wouldn't bet on it that all the correct functionality is exported to Python. But I'll be going to need some recording facilities too in the near future, so if there's something you miss let me know and I'll add it. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Chris.Barker at noaa.gov Mon Mar 26 19:02:12 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 26 Mar 2007 10:02:12 -0700 Subject: [Pythonmac-SIG] How to create a desktop alias to run a python file? In-Reply-To: <87F6F2E3-ABB2-4EDE-A061-5096F4F9D9B7@mac.com> References: <64532d7f0703200930t4114928eq3814312bdcaf9f9c@mail.gmail.com> <65966800-BF82-4CDD-9483-514D88D8DD90@cwi.nl> <4603CA97.6040803@cognitoy.com> <46043B56.60000@noaa.gov> <87F6F2E3-ABB2-4EDE-A061-5096F4F9D9B7@mac.com> Message-ID: <4607FC94.2020802@noaa.gov> Ronald Oussoren wrote: > You mean like "py2app --semi-standalone --site-packages"? This does > require adding everything you don't want to be copied from site-packages > to "--excludes" which is less than ideal. Exactly. Though I had forgotten about --semi-standalone, thanks for the reminder. And it does have the advantage that you are being explicit about what you are expecting the system to have installed. > I wouldn't mind adding a > "--system-dependent-applet" option to py2app that builds an "applet" > when that would help making py2app the obvious application bundle for > everyone. I won't be writing the required code any time soon, but if > someone does do the legwork I can look at the patch and apply it. Thanks. I don't have much time, and I don't even know where to start, but maybe some day... > I think this would be useful for inhouse applications where you have ful > control over the system environment Exactly. > Adding full support for python eggs would go a long way of fixing that > problem. That is, py2app could force loading of specific versions of > python eggs to load code from site-packages instead of using whatever > happens to be on the default search path. That would be nice. >> Is the old "build applet" working well with Python2.5, etc? > > Yes, but I'd like to get rid of it in favor of py2app. I agree. One stop shopping. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 hengist.podd at virgin.net Tue Mar 27 11:49:32 2007 From: hengist.podd at virgin.net (has) Date: Tue, 27 Mar 2007 10:49:32 +0100 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released Message-ID: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> Hi all, Announcing the first release of PyOSA, a new OSA language component for Python. PyOSA allows you to write Python scripts in Script Editor and attach them to OSA-enabled applications such as Mail (Mail Rules), iTunes (Scripts menu) and System Events (Folder Actions). PyOSA is very much a work-in-progress at this point, but it's already sufficiently advanced to allow both experimental and real-world use (caveat a few bugs and limitations). Comments, criticisms and suggestions for improvements are very welcome. Also released is Appscript Installer 1.5.1, containing binary installers for appscript 0.17.2. This update fixes several minor bugs and is recommended for all Appscript Installer 1.5/appscript 0.17.0 users. PyOSA and Appscript Installer are available for download at: http://appscript.sourceforge.net/download.html Enjoy! has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070327/4412adf7/attachment.htm From daniellord at mac.com Tue Mar 27 18:12:39 2007 From: daniellord at mac.com (Daniel Lord) Date: Tue, 27 Mar 2007 09:12:39 -0700 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released In-Reply-To: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> References: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> Message-ID: <82925CB9-1AD9-4C61-8E6F-3FF24FACA40A@mac.com> John Gruber couldn't have put it any better: "Holy sh*t!" (http:// daringfireball.net/) The MacPython world became a much friendlier place today. Great work and thank you very much. On Mar 27, 2007, at 2:49, has wrote: > Hi all, > > Announcing the first release of PyOSA, a new OSA language component > for Python. PyOSA allows you to write Python scripts in Script > Editor and attach them to OSA-enabled applications such as Mail > (Mail Rules), iTunes (Scripts menu) and System Events (Folder > Actions). PyOSA is very much a work-in-progress at this point, but > it's already sufficiently advanced to allow both experimental and > real-world use (caveat a few bugs and limitations). Comments, > criticisms and suggestions for improvements are very welcome. > > Also released is Appscript Installer 1.5.1, containing binary > installers for appscript 0.17.2. This update fixes several minor > bugs and is recommended for all Appscript Installer 1.5/appscript > 0.17.0 users. > > PyOSA and Appscript Installer are available for download at: > > http://appscript.sourceforge.net/download.html > > Enjoy! > > has > -- > http://appscript.sourceforge.net > http://rb-appscript.rubyforge.org > http://appscript.sourceforge.net/objc-appscript.html > > _______________________________________________ > 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/20070327/501bebf1/attachment.html From kw at codebykevin.com Tue Mar 27 18:35:56 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 27 Mar 2007 12:35:56 -0400 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released In-Reply-To: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> References: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> Message-ID: <460947EC.7050903@codebykevin.com> has wrote: > Hi all, > > Announcing the first release of PyOSA, a new OSA language component for > Python. PyOSA allows you to write Python scripts in Script Editor and > attach them to OSA-enabled applications such as Mail (Mail Rules), > iTunes (Scripts menu) and System Events (Folder Actions). PyOSA is very > much a work-in-progress at this point, but it's already sufficiently > advanced to allow both experimental and real-world use (caveat a few > bugs and limitations). Comments, criticisms and suggestions for > improvements are very welcome. > > Also released is Appscript Installer 1.5.1, containing binary installers > for appscript 0.17.2. This update fixes several minor bugs and is > recommended for all Appscript Installer 1.5/appscript 0.17.0 users. > > PyOSA and Appscript Installer are available for download at: > > http://appscript.sourceforge.net/download.html > > Enjoy! > > has > --http://appscript.sourceforge.net > http://rb-appscript.rubyforge.org > http://appscript.sourceforge.net/objc-appscript.html has, I'm confused--how is this different from appscript? -- Kevin Walzer Code by Kevin http://www.codebykevin.com From daniellord at mac.com Tue Mar 27 18:56:24 2007 From: daniellord at mac.com (Daniel Lord) Date: Tue, 27 Mar 2007 09:56:24 -0700 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released In-Reply-To: <460947EC.7050903@codebykevin.com> References: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> <460947EC.7050903@codebykevin.com> Message-ID: <42649DF1-B658-4153-BBBC-54908A486111@mac.com> On Mar 27, 2007, at 9:35, Kevin Walzer wrote: >> >> Announcing the first release of PyOSA, a new OSA language >> component for >> Python. PyOSA allows you to write Python scripts in Script Editor and >> attach them to OSA-enabled applications such as Mail (Mail Rules), >> iTunes (Scripts menu) and System Events (Folder Actions). > > has, > > I'm confused--how is this different from appscript? Kevin, note the included passage above. You can write Python scripts in Script Editor now. Unfortunately, I cannot seem to get ScriptDebugger to work, but it might be 'pilot error'. Still trying. daniel > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com > _______________________________________________ > 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/20070327/d317a6c3/attachment.htm From hengist.podd at virgin.net Tue Mar 27 19:22:19 2007 From: hengist.podd at virgin.net (has) Date: Tue, 27 Mar 2007 18:22:19 +0100 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released In-Reply-To: <82925CB9-1AD9-4C61-8E6F-3FF24FACA40A@mac.com> References: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> <82925CB9-1AD9-4C61-8E6F-3FF24FACA40A@mac.com> Message-ID: <82C7341E-6FB6-4E50-85EB-7880D13A805A@virgin.net> On 27 Mar 2007, at 17:12, Daniel Lord wrote: > John Gruber couldn't have put it any better: "Holy sh*t!" (http:// > daringfireball.net/) Hahah, I'll have to get that as a testimonial. :) > The MacPython world became a much friendlier place today. > Great work and thank you very much. Cheers. Unlike my previous attempt, I've got a pretty good feeling about this one - you just know you're on the right track when code highlighting works:) - so I think it's going to work out okay. BTW, if you come up with any PyOSA scripts you'd like to share, do let me know as I'm always on the lookout for more samples and stuff. Have fun, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From hengist.podd at virgin.net Tue Mar 27 21:39:54 2007 From: hengist.podd at virgin.net (has) Date: Tue, 27 Mar 2007 20:39:54 +0100 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released In-Reply-To: <460947EC.7050903@codebykevin.com> References: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> <460947EC.7050903@codebykevin.com> Message-ID: <19A5A724-8A34-489C-B1E7-14F239AA7F33@virgin.net> On 27 Mar 2007, at 17:35, Kevin Walzer wrote: >> Announcing the first release of PyOSA, a new OSA language >> component for Python. > > I'm confused--how is this different from appscript? In a nutshell, PyOSA makes Python a *full* peer to AppleScript. Appscript is an Apple event bridge, allowing Python scripts to send Apple events to applications. That's great when you want to control one process from another, but no help if you need a script that controls and/or is controlled by its host process. For that level of integration/interaction, you need a full OSA language. PyOSA packages the Python interpreter as an OSA language component, allowing Python scripts to be attached to any OSA-aware application. It also fully integrates appscript, allowing PyOSA scripts to send events directly to the host process and vice-versa. Attachability and integrated Apple event support are essential for tasks like Folder Actions and Mail rules, which you just can't do with appscript alone. For example, you could create a Mail rule that runs an 'AppleScript' action whenever new messages are received. That rule would load a PyOSA script and call its 'perform_mail_action_with_messages' function, passing it a list of message references. The script could then go through those messages, getting and setting their properties, moving them to other mailboxes, and so on. Cool stuff, in other words, and even this is a relatively trivial example of OSA's full potential. Unfortunately, for various historical reasons, OSA has never seen widespread adoption beyond the AppleScript language and a relatively small number of applications. But hopefully a new generation of OSA language components will begin to change this situation for the better. HTH has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From kent37 at tds.net Wed Mar 28 15:55:00 2007 From: kent37 at tds.net (Kent Johnson) Date: Wed, 28 Mar 2007 09:55:00 -0400 Subject: [Pythonmac-SIG] Help with psycopg2 Message-ID: <460A73B4.30402@tds.net> Hi, I am trying to install PostgreSQL and psycopg2. I would like to get this working with Python 2.5 and Postgres 8.2. I installed Postgres from Mark Liyanage's installer: http://www.entropy.ch/software/macosx/postgresql/ I installed psycopg2 from pythonmac: http://www.pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5-macosx10.4.zip When I import psycopg2 I get an error: In [1]: import psycopg2 ------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/psycopg2/__init__.py", line 60, in from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID : dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: /usr/local/pgsql/lib/libpq.4.dylib Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/psycopg2/_psycopg.so Reason: image not found Looking in /usr/local/pgsql/lib/, I find libpq.5.0.dylib and libpq.5.dylib but no libpq.4.dylib. Does that mean that this version of psycopg2 is linked with a different version of Postgres? How can I get this to work? Should I install Postgres from somewhere else? I was able to successfully install postgres and psycopg2 using MacPorts but their version is for Python 2.4 and Postgres 8.1 so it is less than satisfactory. Thanks, Kent From vivacarlie at gmail.com Wed Mar 28 16:38:03 2007 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Wed, 28 Mar 2007 09:38:03 -0500 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released In-Reply-To: <19A5A724-8A34-489C-B1E7-14F239AA7F33@virgin.net> References: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> <460947EC.7050903@codebykevin.com> <19A5A724-8A34-489C-B1E7-14F239AA7F33@virgin.net> Message-ID: <65fadfc30703280738j4485552at6331b42c495e65af@mail.gmail.com> you should put this on the wiki, this is a grate example of the power this holds On 3/27/07, has wrote: > > On 27 Mar 2007, at 17:35, Kevin Walzer wrote: > > >> Announcing the first release of PyOSA, a new OSA language > >> component for Python. > > > > I'm confused--how is this different from appscript? > > In a nutshell, PyOSA makes Python a *full* peer to AppleScript. > Appscript is an Apple event bridge, allowing Python scripts to send > Apple events to applications. That's great when you want to control > one process from another, but no help if you need a script that > controls and/or is controlled by its host process. For that level of > integration/interaction, you need a full OSA language. > > PyOSA packages the Python interpreter as an OSA language component, > allowing Python scripts to be attached to any OSA-aware application. > It also fully integrates appscript, allowing PyOSA scripts to send > events directly to the host process and vice-versa. Attachability and > integrated Apple event support are essential for tasks like Folder > Actions and Mail rules, which you just can't do with appscript alone. > > For example, you could create a Mail rule that runs an 'AppleScript' > action whenever new messages are received. That rule would load a > PyOSA script and call its 'perform_mail_action_with_messages' > function, passing it a list of message references. The script could > then go through those messages, getting and setting their properties, > moving them to other mailboxes, and so on. > > Cool stuff, in other words, and even this is a relatively trivial > example of OSA's full potential. Unfortunately, for various > historical reasons, OSA has never seen widespread adoption beyond the > AppleScript language and a relatively small number of applications. > But hopefully a new generation of OSA language components will begin > to change this situation for the better. > > HTH > > has > -- > http://appscript.sourceforge.net > http://rb-appscript.rubyforge.org > http://appscript.sourceforge.net/objc-appscript.html > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- "lalalalala! it's not broken because I can use it" http://linux.slashdot.org/comments.pl?sid=194281&threshold=1&commentsort=0&mode=thread&cid=15927703 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070328/fb8d17fb/attachment.html From kent37 at tds.net Wed Mar 28 17:40:07 2007 From: kent37 at tds.net (Kent Johnson) Date: Wed, 28 Mar 2007 11:40:07 -0400 Subject: [Pythonmac-SIG] Help with psycopg2 In-Reply-To: <460A73B4.30402@tds.net> References: <460A73B4.30402@tds.net> Message-ID: <460A8C57.5070101@tds.net> Kent Johnson wrote: > Hi, > > I am trying to install PostgreSQL and psycopg2. I would like to get this > working with Python 2.5 and Postgres 8.2. Update: I was able to build psycopg2 from source and it now imports so I think I'm all set. Thanks, Kent > > I installed Postgres from Mark Liyanage's installer: > http://www.entropy.ch/software/macosx/postgresql/ > > I installed psycopg2 from pythonmac: > http://www.pythonmac.org/packages/py25-fat/mpkg/psycopg2-2.0.5.1-py2.5-macosx10.4.zip > > When I import psycopg2 I get an error: > In [1]: import psycopg2 > ------------------------------------------------------------ > Traceback (most recent call last): > File "", line 1, in > File > "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/psycopg2/__init__.py", > line 60, in > from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID > : > dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/psycopg2/_psycopg.so, > 2): Library not loaded: /usr/local/pgsql/lib/libpq.4.dylib > Referenced from: > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/psycopg2/_psycopg.so > Reason: image not found > > Looking in /usr/local/pgsql/lib/, I find libpq.5.0.dylib and > libpq.5.dylib but no libpq.4.dylib. Does that mean that this version of > psycopg2 is linked with a different version of Postgres? > > How can I get this to work? Should I install Postgres from somewhere else? > > I was able to successfully install postgres and psycopg2 using MacPorts > but their version is for Python 2.4 and Postgres 8.1 so it is less than > satisfactory. > > Thanks, > Kent > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From hengist.podd at virgin.net Wed Mar 28 17:59:44 2007 From: hengist.podd at virgin.net (has) Date: Wed, 28 Mar 2007 16:59:44 +0100 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released In-Reply-To: <65fadfc30703280738j4485552at6331b42c495e65af@mail.gmail.com> References: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> <460947EC.7050903@codebykevin.com> <19A5A724-8A34-489C-B1E7-14F239AA7F33@virgin.net> <65fadfc30703280738j4485552at6331b42c495e65af@mail.gmail.com> Message-ID: <659107A7-716E-4F61-B0FC-D56800884918@virgin.net> On 28 Mar 2007, at 15:38, Nehemiah Dacres wrote: > you should put this on the wiki, this is a grate example of the > power this holds Good idea. There's a few things I've been meaning to check/do on the python.org wiki since the pythonmac wiki pages were added to it, though unfortunately I've not had the time. But hopefully sometime soon. (Or if you or anyone else fancies taking a crack at it before then, please be my guest.) Ta for the input, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From hengist.podd at virgin.net Wed Mar 28 18:16:16 2007 From: hengist.podd at virgin.net (has) Date: Wed, 28 Mar 2007 17:16:16 +0100 Subject: [Pythonmac-SIG] Quick update to PyOSA Message-ID: <01D6A61D-7860-4126-8EC9-136E475D995F@virgin.net> Hi all, PyOSA 0.1.1 adds a minor compatibility fix allowing it to work correctly in Script Debugger 4: http://appscript.sourceforge.net/download.html Thanks to Daniel for the prompt bug report, and please keep 'em coming, folks. Cheers, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From danthorpe at gmail.com Wed Mar 28 20:21:39 2007 From: danthorpe at gmail.com (Daniel Thorpe) Date: Wed, 28 Mar 2007 19:21:39 +0100 Subject: [Pythonmac-SIG] python path, cgi issues, import error Message-ID: <763D2348-58F1-4AFC-AE20-3EF0B6865A38@gmail.com> Hi, I hoping someone can help me with a cgi / import error problem. I know it's not strictly MacPython related (although I am using Python, on a Mac), but I've looked all over the web, and most of the answers to this problem suggest checking your path. Which I've done. Here are the details.... I'm trying to write a python cgi script which is located at http:// localhost/cgi-bin/python.cgi. In this script I need to import packages from /Volumes/Data/Users/dt05r/Documents/phd/trunk/code, specifically geostats.conversion. My directory tree looks something like this: /Volumes/Data/Users/dt05r/Documents/phd/trunk/code/ /Volumes/Data/Users/dt05r/Documents/phd/trunk/code/__init__.py /Volumes/Data/Users/dt05r/Documents/phd/trunk/code/geostats/ /Volumes/Data/Users/dt05r/Documents/phd/trunk/code/geostats/ __init__.py /Volumes/Data/Users/dt05r/Documents/phd/trunk/code/ geostats/conversion.py My http://localhost/cgi-bin/python.cgi (which is in /Library/ WebServer/CGI-Executables) contains this code: #!/usr/bin/env python # Required header that tells the browser how to render the text. print 'Content-type: text/html\n\n' import cgi, cgitb import os, os.path, sys cgitb.enable() print os.environ.get("PYTHONPATH") from geostats import * #conversion_demo() this prints out the correct $PYTHONPATH, and then spits out an ImportError: ImportError: No module named geostats args = ('No module named geostats',) I'm setting the $PYTHONPATH using Apache, I have this in my httpd.conf: SetEnv PYTHONPATH "/Volumes/Data/Users/dt05r/Documents/phd/ trunk/code" PassEnv PYTHONPATH AllowOverride None Options None Order allow,deny Allow from all I've also made the python code I'm trying to import executable using chmod -R +x . If anyone has any idea why I can't import this module - your help is much appreciated! Cheers Dan From nathan at yergler.net Thu Mar 29 14:47:06 2007 From: nathan at yergler.net (Nathan R. Yergler) Date: Thu, 29 Mar 2007 08:47:06 -0400 Subject: [Pythonmac-SIG] py2app, eggs and entry points Message-ID: I have an application that I'd like to package using py2app, but I'm getting a little stuck with things. I *think* my problem is that my setup.py is fully setuptools-ized and my application script lives inside my package. Here's the call I make to setup(): setup(name='cclookup', version='2.0', url='http://wiki.creativecommons.org/CcLookup', author='Nathan R. Yergler', author_email='nathan at creativecommons.org', packages = ['cclookup', 'tagger', 'eyeD3'], setup_requires = setup_requirements, install_requires = ['setuptools', 'rdflib==2.3.3', 'ccrdf>=0.6a4', 'cctagutils>=0.5a1', 'rdfadict', ], include_package_data = True, zip_safe = False, entry_points = { 'console_scripts':['cclookup = cclookup:main'], }, app=['cclookup/app.py'], options={ "py2exe": {"packages": ["encodings", 'rdflib']}, "py2app": {"argv_emulation": True, "iconfile": os.path.join('cclookup', 'resources', 'cc.icns') } }, ) When I try to run this with py2app, it crashes into pdb complaining that it can't locate pkg_resources. Running the super-simplified version of setup.py generated by py2applet builds correctly, but has the following problems: * dependencies aren't included (I'm not sure if py2app actually attempts to scan for them like py2exe or not, so this may not be py2app's fault in the least) * app.py is included by itself, as opposed to as part of the package. I think that ideally I'd be able to specify my application as a gui_scripts entry point to setup(), and have it play nicely with the eggs specified in install_requires. I saw the docs mentioned that a future version would use eggs (I think it was in reference to recipes), and I was wondering what the status of that effort is. Thanks, Nathan From daniellord at mac.com Thu Mar 29 23:00:20 2007 From: daniellord at mac.com (Daniel Lord) Date: Thu, 29 Mar 2007 14:00:20 -0700 Subject: [Pythonmac-SIG] Interesting use of Python and Django on the Mac Message-ID: This is the start of a trend we are going to see more and more of: the covergence of Web and Desktop or "Web-top". Dashboard/Konfabulator were the first big step, with Slingshot and Apollo the next big one. Granted this is pre-alpha code, but one can start imagining the possibilities. http://jerakeen.org/blog/2007/03/djangokit/ From tom.weir at safe.com Thu Mar 29 23:40:05 2007 From: tom.weir at safe.com (Tom Weir) Date: Thu, 29 Mar 2007 14:40:05 -0700 Subject: [Pythonmac-SIG] Interesting use of Python and Django on the Mac In-Reply-To: References: Message-ID: Great possibilities, but I think the most important component (and the component he's not touching yet) is sync. IMO, the coolest feature of Slingshot is that Joyent provides (or will provide...) the developer with a framework that abstracts away dealing with sync & offline data. Web apps and desktop apps both have there advantages and disadvantages: - with web apps, you can access your data from any where... - ...except when there's no internet...which is where desktop apps come out on top, except for the fact that your data is locked into one location - desktop apps also 'feel' nicer, and are integrated with the OS What I would love to see is a Python framework that integrates with Django, enables PyObjC apps to use Django models for data storage, with sync to a remote DB . I.e. the data is stored both locally and remotely, with sync between the two. Having the webapp UI would be useful for many applications, but I think a native UI would have advantages too. Tom On 29-Mar-07, at 2:00 PM, Daniel Lord wrote: > This is the start of a trend we are going to see more and more of: > the covergence of Web and Desktop or "Web-top". > Dashboard/Konfabulator were the first big step, with Slingshot and > Apollo the next big one. > Granted this is pre-alpha code, but one can start imagining the > possibilities. > > http://jerakeen.org/blog/2007/03/djangokit/ > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From lists at mostrom.pp.se Fri Mar 30 11:10:22 2007 From: lists at mostrom.pp.se (=?UTF-8?Q?Jan_Erik_Mostr=C3=B6?= =?UTF-8?Q?m?=) Date: Fri, 30 Mar 2007 11:10:22 +0200 Subject: [Pythonmac-SIG] Interesting use of Python and Django on the Mac In-Reply-To: Message-ID: Reply to Tom Weir 07-03-29 14:40: >What I would love to see is a Python framework that integrates >with Django, enables PyObjC apps to use Django models for data >storage, with sync to a remote DB . I.e. the data is stored >both locally and remotely, with sync between the two. Having >the webapp UI would be useful for many applications, but I >think a native UI would have advantages too. Yep, personally what I've been missing is a wiki that can be used both off-line locally and on-line on a server. I've been thinking along these lines for the last 6 months or so but unfortunately haven't had any time to play with the idea. So I would really welcome a model where I would use a Python framework for building an app on server and be able to build a native client to access and sync the same data. jem From hengist.podd at virgin.net Fri Mar 30 13:30:28 2007 From: hengist.podd at virgin.net (has) Date: Fri, 30 Mar 2007 12:30:28 +0100 Subject: [Pythonmac-SIG] Interesting use of Python and Django on the Mac In-Reply-To: References: Message-ID: Jan Erik Mostr?m wrote: > personally what I've been missing is a wiki that can be used both > off-line locally and on-line on a server. Not sure it's what you're looking for, but are you aware of MoinX (http://moinx.antbear.org)? It's a Twisted-based wiki packaged as a standalone OS X app. Source is also available. The OP also reminded me of Phlink Web Access (http://jctcode.com/ phwa), which also does the web-app-as-standalone-desktop-app thing. Though PWA's slightly different as it's provides a remote web-based interface for controlling a local GUI process (Ovolab Phlink), whereas DjangoKit seems more about presenting a web interface as a local GUI process. But perhaps there's potential to go beyond that too. Interesting times, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From lists at mostrom.pp.se Fri Mar 30 13:46:54 2007 From: lists at mostrom.pp.se (=?UTF-8?Q?Jan_Erik_Mostr=C3=B6?= =?UTF-8?Q?m?=) Date: Fri, 30 Mar 2007 13:46:54 +0200 Subject: [Pythonmac-SIG] Interesting use of Python and Django on the Mac In-Reply-To: Message-ID: Reply to has 07-03-30 12:30: >Not sure it's what you're looking for, but are you aware of >MoinX (http://moinx.antbear.org)? It's a Twisted-based wiki >packaged as a standalone OS X app. Source is also available. Yep, but from what I understand it's would be the same as I set up any wiki on my laptop, Which means that my laptop would need to have connected to the net for allowing access from other computers. Unless I've misunderstood anything. jem From uche at ogbuji.net Fri Mar 30 16:41:30 2007 From: uche at ogbuji.net (Uche Ogbuji) Date: Fri, 30 Mar 2007 08:41:30 -0600 Subject: [Pythonmac-SIG] Interesting use of Python and Django on the Mac In-Reply-To: References: Message-ID: <460D219A.1000305@ogbuji.net> Jan Erik Mostr?m wrote: > Reply to has 07-03-30 12:30: > > >> Not sure it's what you're looking for, but are you aware of >> MoinX (http://moinx.antbear.org)? It's a Twisted-based wiki >> packaged as a standalone OS X app. Source is also available. >> > > Yep, but from what I understand it's would be the same as I set > up any wiki on my laptop, Which means that my laptop would need > to have connected to the net for allowing access from other computers. > I'm not sure I really understand what you're after, but I'll throw in TiddlyWiki. It's a JavaScript tool, but you could use Python to tack on features in any number of ways. Important point is that it's all in-browser, and designed so you can publish all in one file, so makes it very easy to use it online+offline. http://www.tiddlywiki.com/ --Uche From kw at codebykevin.com Fri Mar 30 22:45:44 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 30 Mar 2007 16:45:44 -0400 Subject: [Pythonmac-SIG] MacPython wiki "moved" to Python wiki - now it's your turn... In-Reply-To: <17873.15892.286360.853505@montanaro.dyndns.org> References: <17873.15892.286360.853505@montanaro.dyndns.org> Message-ID: <460D76F8.4050601@codebykevin.com> skip at pobox.com wrote: > After much wailing and gnashing of teeth the past couple of days, I managed > to move (most of?) the content from the MacPython wiki to the main Python > wiki (*). All pages were created as subpages of > > http://wiki.python.or/moin/MacPython > > The motivation for this rather hasty move was that the MacPython wiki was > running an ancient version of MoinMoin and got spammed heavily. Because of > its age and vulnerability it was simply too hard to keep up with all the > wiki spammers. So I moved everything. > > I did very little to try and fix up link references. Moin's subpage > references have always befuddled me, and many of the page references were > weirded out to begin with, so there you have it: royal link spaghetti. > > This is where you come in. You can do any number of things to try to > identify and fix problems: > > * Visit http://wiki.python.org/moin/OrphanedPages and see if there are > any MacPython/... pages which are orphaned (hint: there are quite a > few). Then see if you can find an incorrect link which should refer > to the orphaned page. > > * Visit the MacPython pages. Just do a title search for "MacPython" to > locate them. Visit and clean up as appropriate. > > * Everything got pushed down, even home pages. One of three things can > reasonably be done: > 1. Move a home page up if there isn't one at the top level. > 2. Replace an uplevel home page with the MacPython version if the > latter is "better". > 3. Merge the content from the MacPython version into the uplevel home > page. > Instead of performing #2 and #3 yourself, you might send an email to > the person and ask them to do the merge/replace. In any case, this > operation is likely to require some link fiddling. > > * There may also be non-homepage pages at the top level which should be > merged with or replaced by (or replace) the MacPython version. > VisualPython comes to mind. Use your judgement > > * There are lots of unprotected path references in the content, > e.g. /System/Library sitting there looking like a link when it should > probably be {{{/System/Library}}}. > > * There may still be a bit of spam lurking in the pages. I tried to > eliminate all the crap, but I might have missed some. > > * Many pages could use Category references. There are lots of pages > referring to scripting specific Mac applications, home pages and many > code samples. Adding CategoryMac or CategoryAppScript might be > reasonable as well. > > * Use your WikiImagination. There are probably lots of other things > that can be done. I think the MacPython wiki had fallen into a bit of > disrepair, even if you ignore the spam problem, so a little general > TLC would probably help. > > Skip > > (*) Thank goodness for Emacs and Mozex... > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > I was just looking at the new MacPython pages at the Python wiki--it appears nothing has been done with them since Skip moved them over. I'm thinking this is a terrific opportunity to bring them up to date: would anyone mind if I got started? A lot of this stuff doesn't appear to have been touched for three or four years. Any thoughts about what is most pressing? I have my own interests, and I'm not qualified to edit everything, but I'm open to suggestions. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From skip at pobox.com Fri Mar 30 22:49:10 2007 From: skip at pobox.com (skip at pobox.com) Date: Fri, 30 Mar 2007 15:49:10 -0500 Subject: [Pythonmac-SIG] MacPython wiki "moved" to Python wiki - now it's your turn... In-Reply-To: <460D76F8.4050601@codebykevin.com> References: <17873.15892.286360.853505@montanaro.dyndns.org> <460D76F8.4050601@codebykevin.com> Message-ID: <17933.30662.861059.441920@montanaro.dyndns.org> Kevin> I was just looking at the new MacPython pages at the Python Kevin> wiki--it appears nothing has been done with them since Skip moved Kevin> them over. I'm thinking this is a terrific opportunity to bring Kevin> them up to date: would anyone mind if I got started? A lot of Kevin> this stuff doesn't appear to have been touched for three or four Kevin> years. I say go for it. You are correct in presuming the functional content has not been improved. The spammers have rediscovered it at its new home and continue to play their silly games, but there are a group of us committed to keeping the Python wiki cleaned up in that respect. Skip From kw at codebykevin.com Fri Mar 30 22:55:47 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 30 Mar 2007 16:55:47 -0400 Subject: [Pythonmac-SIG] Macintosh modules/Carbon/documentation Message-ID: <460D7953.7090208@codebykevin.com> Looking at the "Macintosh Library" documentation that ships with 2.5, I see a lot of outdated stuff: references to the old PythonIDE, PackageManager, and so on. What is the process for updating these docs, submitting a bug report, etc.? Also, there appears to be a lot of modules in the "Macintosh Library"--Carbon modules, generally--that are undocumented, or are broken, or (almost as bad) no one know if they work or not. Has anyone gone through these to sort out what works, what should be deprecated, etc.? Does it make sense to deprecate the entire Carbon module? What's the process for this? -- Kevin Walzer Code by Kevin http://www.codebykevin.com From Jack.Jansen at cwi.nl Sat Mar 31 01:49:46 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat, 31 Mar 2007 01:49:46 +0200 Subject: [Pythonmac-SIG] Macintosh modules/Carbon/documentation In-Reply-To: <460D7953.7090208@codebykevin.com> References: <460D7953.7090208@codebykevin.com> Message-ID: <8304A16A-8532-41B2-8303-3EE2C26A60E3@cwi.nl> On 30-Mar-2007, at 22:55 , Kevin Walzer wrote: > Looking at the "Macintosh Library" documentation that ships with > 2.5, I > see a lot of outdated stuff: references to the old PythonIDE, > PackageManager, and so on. What is the process for updating these > docs, > submitting a bug report, etc.? > > Also, there appears to be a lot of modules in the "Macintosh > Library"--Carbon modules, generally--that are undocumented, or are > broken, or (almost as bad) no one know if they work or not. Has anyone > gone through these to sort out what works, what should be deprecated, > etc.? Does it make sense to deprecate the entire Carbon module? What's > the process for this? I had a chat about this with Ronald a few months ago, where we basically went through all the modules. Ronald, do you have your notes handy? Carbon itself should be fine. It is indeed undocumented within the Python documentation, but the transformation from the official Apple C documentation is pretty clear (I think). -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20070331/d89d5be9/attachment.htm From delza at livingcode.org Sat Mar 31 05:41:32 2007 From: delza at livingcode.org (Dethe Elza) Date: Fri, 30 Mar 2007 20:41:32 -0700 Subject: [Pythonmac-SIG] Macintosh modules/Carbon/documentation In-Reply-To: <8304A16A-8532-41B2-8303-3EE2C26A60E3@cwi.nl> References: <460D7953.7090208@codebykevin.com> <8304A16A-8532-41B2-8303-3EE2C26A60E3@cwi.nl> Message-ID: <729AD290-8FCA-4B35-BADC-E51E7033ABC7@livingcode.org> On 30-Mar-07, at 4:49 PM, Jack Jansen wrote: > Carbon itself should be fine. It is indeed undocumented within the > Python documentation, but the transformation from the official > Apple C documentation is pretty clear (I think). Is there anywhere that this mapping is specified? I've always avoided the Mac and Carbon libraries because I had no idea where to begin with them, what was covered, and what I could expect to work. Having any kind of a starting point would be an improvement. --Dethe We must be careful not to build a world we don't want to live in. -- Stu Card From vivacarlie at gmail.com Sat Mar 31 06:29:50 2007 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Fri, 30 Mar 2007 23:29:50 -0500 Subject: [Pythonmac-SIG] not mac related but OLPC Message-ID: <65fadfc30703302129o59bce3fbuaf76973cb1d401bb@mail.gmail.com> I just wanted to tell you all about the One Laptop per Child Program in case any of you are interested in programming on a non mac and haven't heard of this yet. It is mostly programmed in python and most of the information is at laptop.org -- "lalalalala! it's not broken because I can use it" http://linux.slashdot.org/comments.pl?sid=194281&threshold=1&commentsort=0&mode=thread&cid=15927703 From hengist.podd at virgin.net Sat Mar 31 13:34:07 2007 From: hengist.podd at virgin.net (has) Date: Sat, 31 Mar 2007 12:34:07 +0100 Subject: [Pythonmac-SIG] Interesting use of Python and Django on the Mac In-Reply-To: References: Message-ID: <843FE239-0196-4C17-AA7C-6542677896E7@virgin.net> Jan Erik Mostr?m wrote: >> Not sure it's what you're looking for, but are you aware of MoinX >> (http://moinx.antbear.org)? It's a Twisted-based wiki packaged as >> a standalone OS X app. Source is also available. > > Yep, but from what I understand it's would be the same as I set up > any wiki on my laptop, Which means that my laptop would need to > have connected to the net for allowing access from other computers. > > Unless I've misunderstood anything. Don't think so; it's probably me. So are you looking for some sort of client-server arrangement that allows you to take pages with you when you go offline, then update the original versions with your changes the next time you're online? Or are you after some kind of peer-to-peer thing? I did a quick search, but there doesn't seem to be much by way of options short of rolling up your sleeves and hacking an existing wiki to provide support. This looked the likeliest candidate: . Or you might be able to cook up some sort of alternative solution using a collaborative text editor like SubEthaEdit, or a general CVS system like Subversion. HTH has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From hengist.podd at virgin.net Sat Mar 31 14:04:00 2007 From: hengist.podd at virgin.net (has) Date: Sat, 31 Mar 2007 13:04:00 +0100 Subject: [Pythonmac-SIG] Macintosh modules/Carbon/documentation In-Reply-To: References: Message-ID: <385314AF-DC74-4848-9514-C28D02D01CC8@virgin.net> Jack Jansen wrote: > On 30-Mar-2007, at 22:55 , Kevin Walzer wrote: > >> Looking at the "Macintosh Library" documentation that ships with >> 2.5, I >> see a lot of outdated stuff: references to the old PythonIDE, >> PackageManager, and so on. What is the process for updating these >> docs, >> submitting a bug report, etc.? >> >> Also, there appears to be a lot of modules in the "Macintosh >> Library"--Carbon modules, generally--that are undocumented, or are >> broken, or (almost as bad) no one know if they work or not. Has >> anyone >> gone through these to sort out what works, what should be deprecated, >> etc.? Does it make sense to deprecate the entire Carbon module? >> What's >> the process for this? > > I had a chat about this with Ronald a few months ago, where we > basically went through all the modules. Ronald, > do you have your notes handy? We went over this issue last year as well (although nothing got done in time for 2.5's release). See the 'fixing the documentation' thread from April 2006. > Carbon itself should be fine. Well, it does have some technical problems. Most of the extensions haven't been adequately tested and debugged, and there are sometimes mapping errors in the auto-generated code. Also, having been created some time ago, the Carbon extension APIs may not have kept up with more recent changes to the system APIs. In addition, it's going to need an as-yet undetermined amount of work to support 64-bit Leopard. > It is indeed undocumented within the Python documentation, but the > transformation from the official Apple C documentation is pretty > clear (I think). Yeah, it takes a little getting used to, but it's mostly straightforward. The one thing which could be better explained is constructors as it's not obvious how to create new instances of Carbon types. Type instantiation follows Carbon, not Python, idioms, so instead of calling a type's constructor method, e.g. AEDesc(...), which doesn't work, you have to call a separate module function, e.g. AECreateDesc(...). My own position remains that the best thing for Python would be to junk many of the Mac-specific modules and move the rest, including Carbon, into a separate osxall package a-la win32all where it can be updated and maintained separately to the main Python framework. Easier said than done, of course, but perhaps the 64-bit problem will force the issue for 2.6? Cheers, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From ronaldoussoren at mac.com Sat Mar 31 16:09:51 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 31 Mar 2007 16:09:51 +0200 Subject: [Pythonmac-SIG] py2app, eggs and entry points In-Reply-To: References: Message-ID: <6EFB6CEB-6170-4929-AFEF-CE03121754BF@mac.com> On 29 Mar, 2007, at 14:47, Nathan R. Yergler wrote: > I have an application that I'd like to package using py2app, but I'm > getting a little stuck with things. I *think* my problem is that my > setup.py is fully setuptools-ized and my application script lives > inside my package. Here's the call I make to setup(): > > setup(name='cclookup', > version='2.0', > url='http://wiki.creativecommons.org/CcLookup', > author='Nathan R. Yergler', > author_email='nathan at creativecommons.org', > > packages = ['cclookup', 'tagger', 'eyeD3'], > > setup_requires = setup_requirements, > install_requires = ['setuptools', > 'rdflib==2.3.3', > 'ccrdf>=0.6a4', > 'cctagutils>=0.5a1', > 'rdfadict', > ], > include_package_data = True, > zip_safe = False, > > entry_points = { > 'console_scripts':['cclookup = cclookup:main'], > }, > app=['cclookup/app.py'], > options={ "py2exe": {"packages": ["encodings", 'rdflib']}, > "py2app": {"argv_emulation": True, > "iconfile": os.path.join('cclookup', > 'resources', 'cc.icns') > } > }, > ) > > When I try to run this with py2app, it crashes into pdb complaining > that it can't locate pkg_resources. Running the super-simplified > version of setup.py generated by py2applet builds correctly, but has > the following problems: > > * dependencies aren't included (I'm not sure if py2app actually > attempts to scan for them like py2exe or not, so this may not be > py2app's fault in the least) Py2app scans for import statements, but cannot look inside zipfiles at the moment. > * app.py is included by itself, as opposed to as part of the package. That's by design. Teaching py2app to do the same as setuptools does for console_script entrypoints shouldn't be too hard, but nobody has gotten around to doing this yet. > > I think that ideally I'd be able to specify my application as a > gui_scripts entry point to setup(), and have it play nicely with the > eggs specified in install_requires. I saw the docs mentioned that a > future version would use eggs (I think it was in reference to > recipes), and I was wondering what the status of that effort is. AFAIK nobody is working on that. You're problems are caused by lack of 'egg' support in py2app, the current version of py2app doesn't look at entry points or other setuptools specific data other than the requires lines. I have a patch that teaches py2app to look inside zipfiles, I'll merge that when I have some time to do so. Full setuptools support should be possible as well, I haven't looked seriously at this yet though. Patches would be greatly appriciated :-) Ronald From nathan at yergler.net Sat Mar 31 16:22:05 2007 From: nathan at yergler.net (Nathan R. Yergler) Date: Sat, 31 Mar 2007 10:22:05 -0400 Subject: [Pythonmac-SIG] py2app, eggs and entry points In-Reply-To: <6EFB6CEB-6170-4929-AFEF-CE03121754BF@mac.com> References: <6EFB6CEB-6170-4929-AFEF-CE03121754BF@mac.com> Message-ID: On 3/31/07, Ronald Oussoren wrote: > > On 29 Mar, 2007, at 14:47, Nathan R. Yergler wrote: > > > I have an application that I'd like to package using py2app, but I'm > > getting a little stuck with things. I *think* my problem is that my > > setup.py is fully setuptools-ized and my application script lives > > inside my package. Here's the call I make to setup(): > > > > setup(name='cclookup', > > version='2.0', > > url='http://wiki.creativecommons.org/CcLookup', > > author='Nathan R. Yergler', > > author_email='nathan at creativecommons.org', > > > > packages = ['cclookup', 'tagger', 'eyeD3'], > > > > setup_requires = setup_requirements, > > install_requires = ['setuptools', > > 'rdflib==2.3.3', > > 'ccrdf>=0.6a4', > > 'cctagutils>=0.5a1', > > 'rdfadict', > > ], > > include_package_data = True, > > zip_safe = False, > > > > entry_points = { > > 'console_scripts':['cclookup = cclookup:main'], > > }, > > app=['cclookup/app.py'], > > options={ "py2exe": {"packages": ["encodings", 'rdflib']}, > > "py2app": {"argv_emulation": True, > > "iconfile": os.path.join('cclookup', > > 'resources', 'cc.icns') > > } > > }, > > ) > > > > When I try to run this with py2app, it crashes into pdb complaining > > that it can't locate pkg_resources. Running the super-simplified > > version of setup.py generated by py2applet builds correctly, but has > > the following problems: > > > > * dependencies aren't included (I'm not sure if py2app actually > > attempts to scan for them like py2exe or not, so this may not be > > py2app's fault in the least) > > Py2app scans for import statements, but cannot look inside zipfiles > at the moment. > > > * app.py is included by itself, as opposed to as part of the package. > > That's by design. Teaching py2app to do the same as setuptools does > for console_script entrypoints shouldn't be too hard, but nobody has > gotten around to doing this yet. > > > > > I think that ideally I'd be able to specify my application as a > > gui_scripts entry point to setup(), and have it play nicely with the > > eggs specified in install_requires. I saw the docs mentioned that a > > future version would use eggs (I think it was in reference to > > recipes), and I was wondering what the status of that effort is. > > AFAIK nobody is working on that. You're problems are caused by lack > of 'egg' support in py2app, the current version of py2app doesn't > look at entry points or other setuptools specific data other than the > requires lines. > > I have a patch that teaches py2app to look inside zipfiles, I'll > merge that when I have some time to do so. Full setuptools support > should be possible as well, I haven't looked seriously at this yet > though. Patches would be greatly appriciated :-) I think the zipfile support would be useful -- I was doing some more looking at it appears that the problem was occuring with modulegraph, when it tried to import pkg_resources (and couldn't find it since it was inside a zipped egg). I'll take a look and see what I can come up with with respect to setuptools support... > > Ronald > > From ronaldoussoren at mac.com Sat Mar 31 17:01:31 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 31 Mar 2007 17:01:31 +0200 Subject: [Pythonmac-SIG] Macintosh modules/Carbon/documentation In-Reply-To: <729AD290-8FCA-4B35-BADC-E51E7033ABC7@livingcode.org> References: <460D7953.7090208@codebykevin.com> <8304A16A-8532-41B2-8303-3EE2C26A60E3@cwi.nl> <729AD290-8FCA-4B35-BADC-E51E7033ABC7@livingcode.org> Message-ID: <60B2E3D6-5650-4F91-9060-D1E3CAD4DD01@mac.com> On 31 Mar, 2007, at 5:41, Dethe Elza wrote: > On 30-Mar-07, at 4:49 PM, Jack Jansen wrote: > >> Carbon itself should be fine. It is indeed undocumented within the >> Python documentation, but the transformation from the official >> Apple C documentation is pretty clear (I think). > > Is there anywhere that this mapping is specified? I've always > avoided the Mac and Carbon libraries because I had no idea where to > begin with them, what was covered, and what I could expect to work. > Having any kind of a starting point would be an improvement. The Carbon wrappers basicly cover a lot of the APIs that were in OS9 and none (or very little) of the APIs that were added in OSX. Ronald From ronaldoussoren at mac.com Sat Mar 31 17:08:34 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 31 Mar 2007 17:08:34 +0200 Subject: [Pythonmac-SIG] Macintosh modules/Carbon/documentation In-Reply-To: <8304A16A-8532-41B2-8303-3EE2C26A60E3@cwi.nl> References: <460D7953.7090208@codebykevin.com> <8304A16A-8532-41B2-8303-3EE2C26A60E3@cwi.nl> Message-ID: <0F121CFD-3F9E-4757-A00E-5CD246FE9338@mac.com> On 31 Mar, 2007, at 1:49, Jack Jansen wrote: > > On 30-Mar-2007, at 22:55 , Kevin Walzer wrote: > >> Looking at the "Macintosh Library" documentation that ships with >> 2.5, I >> see a lot of outdated stuff: references to the old PythonIDE, >> PackageManager, and so on. What is the process for updating these >> docs, >> submitting a bug report, etc.? >> >> Also, there appears to be a lot of modules in the "Macintosh >> Library"--Carbon modules, generally--that are undocumented, or are >> broken, or (almost as bad) no one know if they work or not. Has >> anyone >> gone through these to sort out what works, what should be deprecated, >> etc.? Does it make sense to deprecate the entire Carbon module? >> What's >> the process for this? > > > I had a chat about this with Ronald a few months ago, where we > basically went through all the modules. Ronald, > do you have your notes handy? I have them somewhere, I'll see if I can find them. From what I remember a lot of the "Macintosh Library" is ancient and should be removed, but that's mostly when looking at a list of toplevel modules, not in code size. One thing we (Jack and I) talked about is moving at least the Carbon modules to its own separate project instead of being part of the standard library. The most important reason for this is that the Carbon modules and Python itself should be on a different release schedule: the Carbon should track whatever Apple is doing instead of having to wait until the next major release of Python before new APIs can be added. A major stumbling block for that is that someone needs to step up to commit to maintaining the thing. > > Carbon itself should be fine. It is indeed undocumented within the > Python documentation, but the transformation from the official > Apple C documentation is pretty clear (I think). You're a bit biased in that regard :-). I try to steer clear of Carbon and can't really comment on the quality of the Carbon modules and how easy it is to use them. Ronald > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman > > > _______________________________________________ > 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/20070331/d9269f3b/attachment.htm From hengist.podd at virgin.net Sat Mar 31 19:58:46 2007 From: hengist.podd at virgin.net (has) Date: Sat, 31 Mar 2007 18:58:46 +0100 Subject: [Pythonmac-SIG] Macintosh modules/Carbon/documentation In-Reply-To: References: Message-ID: <018495AD-0892-4FC6-BB24-2B596778CF51@virgin.net> Ronald Oussoren wrote: > One thing we (Jack and I) talked about is moving at least the > Carbon modules to its own separate project instead of being part of > the standard library. The most important reason for this is that > the Carbon modules and Python itself should be on a different > release schedule: the Carbon should track whatever Apple is doing > instead of having to wait until the next major release of Python > before new APIs can be added. Definitely. It also makes it harder to maintain the existing Carbon APIs, e.g. I ended up forking several Carbon extensions in order to fix and complete them for appscript, which isn't ideal. > A major stumbling block for that is that someone needs to step up > to commit to maintaining the thing. Furthermore, this stumbling block has a stumbling block of its own: bgen. There's very few folk around who understand it at all, and no documentation (AFAIK) for anyone else to make sense of it. Until there's some sort of decision made about bgen's future (maintain and document it? Replace it completely? Abandon it and maintain existing code by hand?), I can't see anyone really wanting to step into that tarpit. HTH has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html From jrus at hcs.harvard.edu Sat Mar 31 20:03:47 2007 From: jrus at hcs.harvard.edu (Jacob Rus) Date: Sat, 31 Mar 2007 14:03:47 -0400 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released In-Reply-To: <19A5A724-8A34-489C-B1E7-14F239AA7F33@virgin.net> References: <6B884BE0-96E6-4B02-975F-293524CEC795@virgin.net> <460947EC.7050903@codebykevin.com> <19A5A724-8A34-489C-B1E7-14F239AA7F33@virgin.net> Message-ID: has wrote: > For example, you could create a Mail rule that runs an 'AppleScript' > action whenever new messages are received. That rule would load a > PyOSA script and call its 'perform_mail_action_with_messages' > function, passing it a list of message references. The script could > then go through those messages, getting and setting their properties, > moving them to other mailboxes, and so on. Could someone make such an example script (or something similar), and put it up somewhere? What happens when a specific handler is called on that script? It presumably calls a python function of the same name. Is there some mapping of applescript handlers with named parameters to python functions, etc.? -Jacob From hengist.podd at virgin.net Sat Mar 31 23:42:39 2007 From: hengist.podd at virgin.net (has) Date: Sat, 31 Mar 2007 22:42:39 +0100 Subject: [Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released Message-ID: Jacob Rus wrote: > > For example, you could create a Mail rule that runs an 'AppleScript' > > action whenever new messages are received. > > Could someone make such an example script (or something similar), and > put it up somewhere? There is a very simple example script included with PyOSA that prints the arguments for the 'perform_mail_action_with_messages' call to stdout, which you can view in Console.app. > What happens when a specific handler is called on > that script? It presumably calls a python function of the same name. Yes. Top-level functions act as event handlers. A 'run' event calls the 'run' function, an 'open' event calls the 'open' function, a 'perform_mail_action_with_messages' event calls the 'perform_mail_action_with_messages' function, etc. (Events that don't have a human-readable name and user-defined subroutine calls are treated differently, however, so ask if you need to support those sorts of events.) > Is there some mapping of applescript handlers with named parameters to > python functions, etc.? It's the same as the mapping used by appscript commands, except that calls are going in the opposite direction, of course. If an event provides a direct parameter, that will be assigned to the first (i.e. positional) parameter of your function. Any keyword parameters are then assigned to function parameters of the same names. e.g. Mail's 'perform_mail_action_with_messages' event has the following dictionary definition: perform_mail_action_with_messages -- Script handler invoked by rules and menus that execute AppleScripts. The direct parameter of this handler is a list of messages being acted upon. list of message -- the message being acted upon [in_mailboxes mailbox] -- If the script is being executed by the user selecting an item in the scripts menu, this argument will specify the mailboxes that are currently selected. Otherwise it will not be specified. [for_rule rule] -- If the script is being executed by a rule action, this argument will be the rule being invoked. Otherwise it will not be specified. The corresponding event handler would be: def perform_mail_action_with_messages(messages, in_mailboxes, for_rule): ... The positional parameter's name can be anything you like (I used 'messages' here), just as long as doesn't match a keyword parameter name. One more thing: it's okay for an event handler to leave out parameters that it doesn't need. So you could also write: def perform_mail_action_with_messages(messages): ... def perform_mail_action_with_messages(in_mailboxes, for_rule): ... def perform_mail_action_with_messages(): ... and so on, depending on which parameters you're interested in. HTH has p.s. If anyone comes up with better scripts they'd like to share, please let me know. Help with improving the documentation would also be very welcome. -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html