From luis.cota at avmltd.com Wed Oct 1 01:05:18 2008 From: luis.cota at avmltd.com (newbie73) Date: Tue, 30 Sep 2008 16:05:18 -0700 (PDT) Subject: [Pythonmac-SIG] Problem with wxPython and wx-config during build of 3rd party lib Message-ID: <19751175.post@talk.nabble.com> I am attempting to build parts of the Enthought Tool Suite and am running into some trouble with a package that uses wxPython (and wx-config). My system has two versions of wx-config, the one that comes with Leopard and the one I installed. I believe the problem with the installation is the use of the wrong wx-config, though I am not sure how to correct the problem. Default Version: /usr/bin/wx-config Custom Version: /usr/local/lib/wxPython-unicode-2.8.8.1/bin/wx-config Full log of the installation attempt is attached to the e-mail Partial Install Log: $ export WX_CONFIG=/usr/local/lib/wxPython-unicode-2.8.8.1/bin/wx-config $ sudo easy_install Chaco Searching for Chaco Best match: Chaco 3.0.0 Processing Chaco-3.0.0-py2.5-macosx-10.3-i386.egg Chaco 3.0.0 is already the active version in easy-install.pth Using /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Chaco-3.0.0-py2.5-macosx-10.3-i386.egg Processing dependencies for Chaco Searching for Enable[traits]>=3.0.0.dev Reading http://code.enthought.com/enstaller/eggs/source Reading http://pypi.python.org/simple/Enable/ Reading http://code.enthought.com/projects/enable Best match: Enable 3.0.1 Downloading http://pypi.python.org/packages/source/E/Enable/Enable-3.0.1.tar.gz#md5=ae51ce7aa2560456b7ceaefb92628022 Processing Enable-3.0.1.tar.gz Running Enable-3.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-JbcXFc/Enable-3.0.1/egg-dist-tmp-lGp7li Found executable /usr/bin/wx-config http://www.nabble.com/file/p19751175/python_log.txt python_log.txt -- View this message in context: http://www.nabble.com/Problem-with-wxPython-and-wx-config-during-build-of-3rd-party-lib-tp19751175p19751175.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From robert.kern at gmail.com Wed Oct 1 01:24:53 2008 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 30 Sep 2008 18:24:53 -0500 Subject: [Pythonmac-SIG] Problem with wxPython and wx-config during build of 3rd party lib In-Reply-To: <19751175.post@talk.nabble.com> References: <19751175.post@talk.nabble.com> Message-ID: newbie73 wrote: > I am attempting to build parts of the Enthought Tool Suite and am running > into some trouble with a package that uses wxPython (and wx-config). My > system has two versions of wx-config, the one that comes with Leopard and > the one I installed. I believe the problem with the installation is the use > of the wrong wx-config, though I am not sure how to correct the problem. And neither does this list, most likely. It's my code that's causing issues. Let's keep this on enthought-dev. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From robin at alldunn.com Wed Oct 1 02:06:46 2008 From: robin at alldunn.com (Robin Dunn) Date: Tue, 30 Sep 2008 17:06:46 -0700 Subject: [Pythonmac-SIG] Problem with wxPython and wx-config during build of 3rd party lib In-Reply-To: <19751175.post@talk.nabble.com> References: <19751175.post@talk.nabble.com> Message-ID: <48E2BF16.5020703@alldunn.com> newbie73 wrote: > I am attempting to build parts of the Enthought Tool Suite and am running > into some trouble with a package that uses wxPython (and wx-config). My > system has two versions of wx-config, the one that comes with Leopard and > the one I installed. I believe the problem with the installation is the use > of the wrong wx-config, though I am not sure how to correct the problem. > > Default Version: /usr/bin/wx-config > Custom Version: /usr/local/lib/wxPython-unicode-2.8.8.1/bin/wx-config > > Full log of the installation attempt is attached to the e-mail > Partial Install Log: > > $ export WX_CONFIG=/usr/local/lib/wxPython-unicode-2.8.8.1/bin/wx-config Instead of putting it in the env add it to the setup.py command-line. Or if that can't be done for some reason then temporarily alter your PATH so /usr/local/lib/wxPython-unicode-2.8.8.1/bin comes before /usr/bin. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! From rajanikanth at gmail.com Thu Oct 2 19:29:00 2008 From: rajanikanth at gmail.com (Rajanikanth Jammalamadaka) Date: Thu, 2 Oct 2008 10:29:00 -0700 Subject: [Pythonmac-SIG] IDLE on Python-2.6 release version Message-ID: <84bdef3c0810021029x42356a88o299c96ec316b80ab@mail.gmail.com> Any idea how this problem may be fixed? This what I get when I type idle at the command prompt: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/Current/bin/idle", line 3, in from idlelib.PyShell import main File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/PyShell.py", line 14, in import macosxSupport File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/macosxSupport.py", line 6, in import Tkinter File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 39, in import _tkinter # If this fails your Python may not be configured for Tk ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so, 2): Library not loaded: /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so Reason: image not found Thanks, Rajanikanth From kw at codebykevin.com Thu Oct 2 19:32:57 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Thu, 02 Oct 2008 13:32:57 -0400 Subject: [Pythonmac-SIG] IDLE on Python-2.6 release version In-Reply-To: <84bdef3c0810021029x42356a88o299c96ec316b80ab@mail.gmail.com> References: <84bdef3c0810021029x42356a88o299c96ec316b80ab@mail.gmail.com> Message-ID: <48E505C9.5010302@codebykevin.com> Rajanikanth Jammalamadaka wrote: > Any idea how this problem may be fixed? > > This what I get when I type idle at the command prompt: > > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/Current/bin/idle", > line 3, in > from idlelib.PyShell import main > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/PyShell.py", > line 14, in > import macosxSupport > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/macosxSupport.py", > line 6, in > import Tkinter > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", > line 39, in > import _tkinter # If this fails your Python may not be configured for Tk > ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so, > 2): Library not loaded: > /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl > Referenced from: > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so > Reason: image not found Just a guess, but it appears that Python 2.6 is looking for an installation of Tk 8.5 in /Library/Frameworks. I'd suggest installing ActiveTcl (http://www.activestate.com). Both Leopard and Tiger come with Tk 8.4 installed in /System/Library, but that version is now obsolete. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From rajanikanth at gmail.com Thu Oct 2 19:59:12 2008 From: rajanikanth at gmail.com (Rajanikanth Jammalamadaka) Date: Thu, 2 Oct 2008 10:59:12 -0700 Subject: [Pythonmac-SIG] IDLE on Python-2.6 release version In-Reply-To: <48E505C9.5010302@codebykevin.com> References: <84bdef3c0810021029x42356a88o299c96ec316b80ab@mail.gmail.com> <48E505C9.5010302@codebykevin.com> Message-ID: <84bdef3c0810021059t7f4bccf6q5ca0d26f96e032d4@mail.gmail.com> Thanks for your reply Kevin. I installed Tk 8.5 but now I get this error: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/Current/bin/idle", line 5, in main() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/PyShell.py", line 1382, in main root = Tk(className="Idle") File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1645, in __init__ self._loadtk() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1659, in _loadtk % (_tkinter.TK_VERSION, tk_version) RuntimeError: tk.h version (8.4) doesn't match libtk.a version (8.5) Also, when I try to build python 2.6 from source, I get this error: Objects/longobject.c: In function 'PyLong_FromLong': Objects/longobject.c:101: error: non-trivial conversion at assignment abs_ival ival abs_ival = -ival; Objects/longobject.c:101: internal compiler error: verify_gimple failed Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make: *** [Objects/longobject.o] Error 1 Thanks, Rajanikanth On Thu, Oct 2, 2008 at 10:32 AM, Kevin Walzer wrote: > Rajanikanth Jammalamadaka wrote: >> >> Any idea how this problem may be fixed? >> >> This what I get when I type idle at the command prompt: >> >> Traceback (most recent call last): >> File "/Library/Frameworks/Python.framework/Versions/Current/bin/idle", >> line 3, in >> from idlelib.PyShell import main >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/PyShell.py", >> line 14, in >> import macosxSupport >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/macosxSupport.py", >> line 6, in >> import Tkinter >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", >> line 39, in >> import _tkinter # If this fails your Python may not be configured for >> Tk >> ImportError: >> dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so, >> 2): Library not loaded: >> /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl >> Referenced from: >> >> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so >> Reason: image not found > > Just a guess, but it appears that Python 2.6 is looking for an installation > of Tk 8.5 in /Library/Frameworks. I'd suggest installing ActiveTcl > (http://www.activestate.com). Both Leopard and Tiger come with Tk 8.4 > installed in /System/Library, but that version is now obsolete. > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com > -- Rajanikanth From kw at codebykevin.com Thu Oct 2 20:02:19 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Thu, 02 Oct 2008 14:02:19 -0400 Subject: [Pythonmac-SIG] IDLE on Python-2.6 release version In-Reply-To: <84bdef3c0810021059t7f4bccf6q5ca0d26f96e032d4@mail.gmail.com> References: <84bdef3c0810021029x42356a88o299c96ec316b80ab@mail.gmail.com> <48E505C9.5010302@codebykevin.com> <84bdef3c0810021059t7f4bccf6q5ca0d26f96e032d4@mail.gmail.com> Message-ID: <48E50CAB.10009@codebykevin.com> Rajanikanth Jammalamadaka wrote: > Thanks for your reply Kevin. I installed Tk 8.5 but now I get this error: > > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/Current/bin/idle", > line 5, in > main() > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/PyShell.py", > line 1382, in main > root = Tk(className="Idle") > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", > line 1645, in __init__ > self._loadtk() > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", > line 1659, in _loadtk > % (_tkinter.TK_VERSION, tk_version) > RuntimeError: tk.h version (8.4) doesn't match libtk.a version (8.5) > > > Also, when I try to build python 2.6 from source, I get this error: > > Objects/longobject.c: In function 'PyLong_FromLong': > Objects/longobject.c:101: error: non-trivial conversion at assignment > abs_ival > ival > abs_ival = -ival; > > Objects/longobject.c:101: internal compiler error: verify_gimple failed > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. > make: *** [Objects/longobject.o] Error 1 > > > Thanks, > > Rajanikanth Odd. I don't know what that problem is. Perhaps someon else can chime in? -- Kevin Walzer Code by Kevin http://www.codebykevin.com From mankoff at gmail.com Fri Oct 3 18:26:06 2008 From: mankoff at gmail.com (Ken Mankoff) Date: Fri, 3 Oct 2008 12:26:06 -0400 (EDT) Subject: [Pythonmac-SIG] Hello World Cross Platform Problems Message-ID: Hi PythonMac List, I'm new to python and wxPython/wxWidgets and this whole development environment, and I'm having some trouble I hope you all can help with. I'm trying to get a Hello World application in wxWidgets as a stand-alone app running on multiple machines via py2app. The second machine is OS X 10.4 PPC with the system python of 2.3. Python 2.5.2 is installed via fink but I don't think that the double-clickable app access that version. My dev machine is OS X 10.5 Intel. I've built python 2.6 as a framework. I used " --enable-universalsdk" and "--enable-framework=/opt/python/2.6/Framework" to configure. I built wxWidgets with "--enable-universal_binary" and "--with-macosx-version-min=10.4". I built wxPython with "python2.6 setup.py build_ext BUILD_GLCANVAS=0 --inplace --debug" When I run py2applet I get a .app that runs on the local machine but not on the 10.4/PPC/Python2.3 machine. I've tried skipping py2applet and running "python setup.py py2app" and I get the same results. It appears the .app continues to look for python versions that exist only on the dev machine. I see people have posted about this in the past on this list and the advice is "don't use Apple python, build your own from python.org" and I have done that, but still have this issue. > hello.app mankoff$ ./Contents/MacOS/python dyld: Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.5/Python Referenced from: /Users/mankoff/Desktop/hello.app/./Contents/MacOS/python Reason: image not found Trace/BPT trap > $ Any advice will be much appreciated. Thanks, -k. P.S. The wxPython docs state that Fink users will require X11. Build your own if you want Aqua widgets. After having issues (above) with roll-your-own I decided to try fink (fink install py2app-py24), to see if it would work even in X11. It did not work on the 10.4 machine either, but it did work on the development machine in *Aqua* not X11. From Chris.Barker at noaa.gov Fri Oct 3 20:24:00 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 03 Oct 2008 11:24:00 -0700 Subject: [Pythonmac-SIG] Hello World Cross Platform Problems In-Reply-To: References: Message-ID: <48E66340.4040706@noaa.gov> Ken Mankoff wrote: > I'm trying to get a Hello World application in wxWidgets as a > stand-alone app running on multiple machines via py2app. Just so you know -- you are staying into a lot of new territory here. I don't think either of py2app or wxPython have been tested with Python2.6 Do you really need 2.6? This is going to be a whole lot easier if you just stuck with python,.org's 2.5.2 build. That being said, thanks for being a pioneer! > The second > machine is OS X 10.4 PPC with the system python of 2.3. Python 2.5.2 is > installed via fink but I don't think that the double-clickable app > access that version. neither of these should matter, that is the idea of py2app. > I built wxWidgets with "--enable-universal_binary" and > "--with-macosx-version-min=10.4". I built wxPython with "python2.6 > setup.py build_ext BUILD_GLCANVAS=0 --inplace --debug" I"m not sure you want the --inplace here, but I"m no expert, and I don't think that's you problem anyway! > I've tried skipping py2applet and > running "python setup.py py2app" and I get the same results. if that's not a typo, then that may be your problem. make sure you are running py2app with python2.6: python2.6 setup.py py2app >> hello.app mankoff$ ./Contents/MacOS/python > dyld: Library not loaded: > /System/Library/Frameworks/Python.framework/Versions/2.5/Python That's Apple's system python that comes with 10.5 I suspect that you ran py2app with that python, in which case this is exactly what you'd expect. By the way, just to keep things clean, I'd try to py2app a little app that doesn't use wx first. > P.S. The wxPython docs state that Fink users will require X11. Build > your own if you want Aqua widgets. After having issues (above) with > roll-your-own I decided to try fink (fink install py2app-py24), I'd stay away from fink anyway -- does it support Universal builds at all? Also, on eof the key points of wx is that if produces native GUIs -- why'd you want to give your Mac users an X11 GUI with 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 mankoff at gmail.com Mon Oct 6 20:48:08 2008 From: mankoff at gmail.com (Ken Mankoff) Date: Mon, 6 Oct 2008 14:48:08 -0400 (EDT) Subject: [Pythonmac-SIG] Hello World Cross Platform Problems In-Reply-To: <48E66340.4040706@noaa.gov> References: <48E66340.4040706@noaa.gov> Message-ID: Hi Chris On Fri, 3 Oct 2008, Christopher Barker wrote: > Ken Mankoff wrote: >> I'm trying to get a Hello World application in wxWidgets as a >> stand-alone app running on multiple machines via py2app. > > Just so you know -- you are staying into a lot of new territory > here. I don't think either of py2app or wxPython have been tested > with Python2.6 > > Do you really need 2.6? This is going to be a whole lot easier if > you just stuck with python,.org's 2.5.2 build. > > That being said, thanks for being a pioneer! Thanks but no thanks! I'm going to try this again with python 2.5.2. > > By the way, just to keep things clean, I'd try to py2app a little > app that doesn't use wx first. > I've cleaned out everything and will skip wxWidgets for now. I have the following python script. Is this the type of little app you refer to? #!/opt/python/2.5.2/bin/python def main(): print 'Hello World' if __name__ == '__main__': main() If I run "py2applet hello.py" I get the following errors during the build process. This is on the development machines, so I'm not even on a different architecture yet. copying /opt/python/2.5.2/Framework/Python.framework/Versions/2.5/Resources/version.plist -> /private/var/folders/tc/tcALs6cIGAuSq8EZ+n1WqU+++TI/-Tmp-/tmpV8oWjJ/dist/hello.app/Contents/Frameworks/Python.framework/Versions/2.5/Resources Traceback (most recent call last): File "/opt/python/2.5.2/Framework/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 548, in _run self.run_normal() File "/opt/python/2.5.2/Framework/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 619, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/opt/python/2.5.2/Framework/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 723, in create_binaries mm.mm.run_file(runtime) File "build/bdist.macosx-10.3-i386/egg/macholib/MachOGraph.py", line 66, in run_file m = self.createNode(MachO, pathname) File "build/bdist.macosx-10.3-i386/egg/macholib/MachOStandalone.py", line 23, in createNode res = super(FilteredMachOGraph, self).createNode(cls, name) File "build/bdist.macosx-10.3-i386/egg/altgraph/ObjectGraph.py", line 148, in createNode m = cls(name, *args, **kw) File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 61, in __init__ self.load(file(filename, 'rb')) File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 71, in load self.load_fat(fh) File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 82, in load_fat self.load_header(fh, arch.offset, arch.size) File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 106, in load_header hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian) File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 146, in __init__ self.load(fh) File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 178, in load raise ValueError("Unknown load command: %d" % (cmd_load.cmd,)) ValueError: Unknown load command: 27 > /private/var/folders/tc/tcALs6cIGAuSq8EZ+n1WqU+++TI/-Tmp-/tmpV8oWjJ/build/bdist.macosx-10.3-i386/egg/macholib/MachO.py(178)load() (Pdb) -k. From kent37 at tds.net Mon Oct 6 21:34:26 2008 From: kent37 at tds.net (Kent Johnson) Date: Mon, 6 Oct 2008 15:34:26 -0400 Subject: [Pythonmac-SIG] IDLE on Python-2.6 release version Message-ID: <1c2a2c590810061234v24080b6ey4e3c6b2ada663aef@mail.gmail.com> Rajanikanth Jammalamadaka rajanikanth at gmail.com wrote: Thanks for your reply Kevin. I installed Tk 8.5 but now I get this error: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/Current/bin/idle", line 5, in main() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/PyShell.py", line 1382, in main root = Tk(className="Idle") File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1645, in __init__ self._loadtk() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1659, in _loadtk % (_tkinter.TK_VERSION, tk_version) RuntimeError: tk.h version (8.4) doesn't match libtk.a version (8.5) ------------------- I am seeing this same problem with Python 2.6 on Mac OSX 10.4. First I had ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so, 2) I installed ActiveState Tk 8.5, now I see the error above. Somehow _tkinter.TK_VERSION is '8.4' but the version of Tk that is searched and loaded is 8.5. I previously installed Python 2.6rc2 and rc3 from source, could that have something to do with this? I do seem to be loading the correct _tkinter.so: In [3]: _tkinter.__file__ Out[3]: '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so' and kent $ ls -l /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so -rwxrwxr-x 1 root admin 225936 Oct 1 19:49 /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so I hesitate to blame my tools but this looks to me like a build problem in the _tkinter module... Also the Python 2.6 installer did not install /Applications/MacPython 2.6 at all. Kent PS Apologies to pythonmac-sig-owner, I originally sent this to that address by mistake... From Chris.Barker at noaa.gov Mon Oct 6 21:45:06 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 06 Oct 2008 12:45:06 -0700 Subject: [Pythonmac-SIG] Hello World Cross Platform Problems In-Reply-To: References: <48E66340.4040706@noaa.gov> Message-ID: <48EA6AC2.1030606@noaa.gov> Ken Mankoff wrote: >> That being said, thanks for being a pioneer! > > Thanks but no thanks! I'm going to try this again with python 2.5.2. Darn, I was hoping you'd figure this out for us... >> By the way, just to keep things clean, I'd try to py2app a little app >> that doesn't use wx first. >> > > I've cleaned out everything and will skip wxWidgets for now. I have the > following python script. Is this the type of little app you refer to? > > #!/opt/python/2.5.2/bin/python > > def main(): > print 'Hello World' > > if __name__ == '__main__': > main() yup -- that should print to the "Console" app when it is run from the GUI. however, that #! line is pointing to the macports (or fink?) install of python -- I"d keep this all native Mac unless you have a good reason not to. > raise ValueError("Unknown load command: %d" % (cmd_load.cmd,)) > ValueError: Unknown load command: 27 This *may* be a bug (missing feature) in macholib that's been around a while. It was fixed in SVN a good while back: (from a post 3/27/08:) Ronald Oussoren wrote: > That load command is for LC_UUID. The version of macholib in subversion > should have some support that is (basicly ignoring the entire load > command because macholib won't have to change it), could you test that > (easy_install macholib==dev)? I'd make sure you're using all FrameWork Python (the install from python.org) first, then, if you still get the error, update macholib as above. Let us know how it goes -- we should get that macholib update officially released if it hasn't been already. -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 mankoff at gmail.com Mon Oct 6 21:54:40 2008 From: mankoff at gmail.com (Ken Mankoff) Date: Mon, 6 Oct 2008 15:54:40 -0400 (EDT) Subject: [Pythonmac-SIG] Hello World Cross Platform Problems In-Reply-To: <48EA6AC2.1030606@noaa.gov> References: <48E66340.4040706@noaa.gov> <48EA6AC2.1030606@noaa.gov> Message-ID: On Mon, 6 Oct 2008, Christopher Barker wrote: > Ken Mankoff wrote: >> I've cleaned out everything and will skip wxWidgets for now. I >> have the following python script. Is this the type of little app >> you refer to? >> >> #!/opt/python/2.5.2/bin/python >> >> def main(): >> print 'Hello World' >> >> if __name__ == '__main__': >> main() > > yup -- that should print to the "Console" app when it is run from > the GUI. > > however, that #! line is pointing to the macports (or fink?) > install of python -- I"d keep this all native Mac unless you have > a good reason not to. > This is not fink or macports but my python.org install that I just built from scratch with the following commands: $ ./configure --prefix=/opt/python/2.5.2 --enable-universalsdk --enable-framework=/opt/python/2.5.2/Framework $ make; make install $ export PATH=/opt/python/2.5.2/bin:$PATH $ export PATH=/opt/python/2.5.2/Framework/Python.framework/Versions/2.5/bin:$PATH # Second export because easy_install is not in bin but in Framework/bin $ curl -O http://peak.telecommunity.com/dist/ez_setup.py # make sure "python" and "easy_install" are from /opt/python/2.5.2/... # Yes they are (thanks to PATH statements above) $ python ez_setup.py -U setuptools $ easy_install -U py2app >> could you test that (easy_install macholib==dev)? > > I'd make sure you're using all FrameWork Python (the install from > python.org) first, then, if you still get the error, update > macholib as above. As far as I can tell I'm using python.org framework. I'd love to test macholib but right now that easy_install command gives the following error. I'll tray later and see if the server is up and post results back here. svn: Can't connect to host 'svn.eby-sarna.com': Connection refused -k. From Chris.Barker at noaa.gov Mon Oct 6 22:35:08 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 06 Oct 2008 13:35:08 -0700 Subject: [Pythonmac-SIG] Hello World Cross Platform Problems In-Reply-To: References: <48E66340.4040706@noaa.gov> <48EA6AC2.1030606@noaa.gov> Message-ID: <48EA767C.2050102@noaa.gov> Ken Mankoff wrote: > This is not fink or macports but my python.org install that I just built got it -- the "opt" confused me. Why compile yourself? Why not put in the standard place? (/Library/Frameworks...) Though it doesn't look that's you problem at this point anyway. > svn: Can't connect to host 'svn.eby-sarna.com': Connection refused was that with the py2app install, or the macholib upgrade that you got that error? As it happens. I've just wiped and re-installed my system (10.4.11, PPC), so I"m re-installing all this myself from scratch. I just got: easy_install py2app To work fine, but trying to build an app that used to work: stripping libwx_macud-2.8.0.dylib stripping array.so /usr/bin/strip: for architecture i386 object: /Users/cbarker/HAZMAT/SmallTools/UnitConversion/trunk/dist/Converter.app/Contents/MacOS/Converter malformed object (unknown flavor for flavor number 0 in LC_UNIXTHREAD command 10 can't byte swap it) /usr/bin/strip: for architecture i386 object: /Users/cbarker/HAZMAT/SmallTools/UnitConversion/trunk/dist/Converter.app/Contents/MacOS/python malformed object (unknown flavor for flavor number 0 in LC_UNIXTHREAD command 11 can't byte swap it) stripping saved 10885168 bytes (63796692 / 74681860) which was an issue that was discussed on this list a while back, but I don't see the resolution. running it with no-strip: python setup.py py2app --no-strip now works. I wonder what the deal is with strippping? That's with macholib 1.1. I then ran: $ easy_install -U macholib==dev which installed macholib 1.2.1.dev-r23 I still get the stripping error (on array.so), though now that I test -- it looks like the app stll works fine, so maybe only that one lib didn't get stripped. With stripping, it's 39 MB, and 44MB without. As for your error: svn: Can't connect to host 'svn.eby-sarna.com': Connection refused it should only use svn if you ask for a dev version, but who knows? Anyway, are you sure your firewall allows svn:? many block it, and yu may not have notices, as many SVN sites use http instead of teh svn: protocol. -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 mankoff at gmail.com Mon Oct 6 22:46:21 2008 From: mankoff at gmail.com (Ken Mankoff) Date: Mon, 6 Oct 2008 16:46:21 -0400 (EDT) Subject: [Pythonmac-SIG] Hello World Cross Platform Problems In-Reply-To: <48EA767C.2050102@noaa.gov> References: <48E66340.4040706@noaa.gov> <48EA6AC2.1030606@noaa.gov> <48EA767C.2050102@noaa.gov> Message-ID: OK I got the "Hello World" developed on 10.5 intel working on 10.4 PPC. On Mon, 6 Oct 2008, Christopher Barker wrote: > Why compile yourself? Why not put in the standard place? > (/Library/Frameworks...) Stubborn unixy-ness and a desire to keep things clean and separate so I can easily clean it out when bugs (like this) pop up and upgrade and use different versions and replicate on other machines etc. >> svn: Can't connect to host 'svn.eby-sarna.com': Connection refused > > was that with the py2app install, or the macholib upgrade that you got that > error? That was from "easy_install macholib==dev" But you are correct it was a firewall issue. It worked when I used a different network. I then ran "py2applet hello.py" (not even using py2app and setup.py directly) and it built the .app without complaining. Well, there is an awful lot of output, so I might have missed a complaint, but I think it built it fine. I moved it to a different machine, double-clicked, and it printed "hello world" to the Console. So I now have Python and py2app working. I'll build and add wxWidgets code and see if it continues to work. In summary, the macholib that ships with Python (or is it py2app?) seems to have a bug that you identified in a previous email and fetching the latest dev version (via easy_install) solves it. Thanks for your help. I am pretty sure I'll be back for more. -k. From mac at cstarrett.com Mon Oct 6 23:49:49 2008 From: mac at cstarrett.com (Charles Starrett) Date: Mon, 6 Oct 2008 14:49:49 -0700 Subject: [Pythonmac-SIG] IDLE on Python-2.6 release version In-Reply-To: <1c2a2c590810061234v24080b6ey4e3c6b2ada663aef@mail.gmail.com> References: <1c2a2c590810061234v24080b6ey4e3c6b2ada663aef@mail.gmail.com> Message-ID: I had an identical experience on 10.4 and it was my first install of Python (other than what Apple included in the OS install). Deleting all the Python 2.6 files and installing Python 2.5.2 worked like a charm. It's gotta be a build problem. (Similarly, I noticed that Python2.6 created /Applications/Python rather than /Applications/MacPython 2.6. Is that an intentional change?) ~~Charles On Oct 6, 2008, at 12:34 PM, Kent Johnson wrote: > Rajanikanth Jammalamadaka rajanikanth at gmail.com wrote: > Thanks for your reply Kevin. I installed Tk 8.5 but now I get this > error: > > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/Current/bin/ > idle", > line 5, in > main() > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/idlelib/PyShell.py", > line 1382, in main > root = Tk(className="Idle") > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/lib-tk/Tkinter.py", > line 1645, in __init__ > self._loadtk() > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/lib-tk/Tkinter.py", > line 1659, in _loadtk > % (_tkinter.TK_VERSION, tk_version) > RuntimeError: tk.h version (8.4) doesn't match libtk.a version (8.5) > > ------------------- > > I am seeing this same problem with Python 2.6 on Mac OSX 10.4. > First I had > ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/ > 2.6/lib/python2.6/lib-dynload/_tkinter.so, > 2) > > I installed ActiveState Tk 8.5, now I see the error above. Somehow > _tkinter.TK_VERSION is '8.4' but the version of Tk that is searched > and loaded is 8.5. > > I previously installed Python 2.6rc2 and rc3 from source, could that > have something to do with this? I do seem to be loading the correct > _tkinter.so: > In [3]: _tkinter.__file__ > Out[3]: '/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/lib-dynload/_tkinter.so' > > and > kent $ ls -l /Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/lib-dynload/_tkinter.so > -rwxrwxr-x 1 root admin 225936 Oct 1 19:49 > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib- > dynload/_tkinter.so > > I hesitate to blame my tools but this looks to me like a build problem > in the _tkinter module... > > Also the Python 2.6 installer did not install /Applications/MacPython > 2.6 at all. > > Kent > > PS Apologies to pythonmac-sig-owner, I originally sent this to that > address by mistake... > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From kw at codebykevin.com Mon Oct 6 23:53:23 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Mon, 06 Oct 2008 17:53:23 -0400 Subject: [Pythonmac-SIG] tcl/tk version confusion with tkinter in Python 2.6, on OS X In-Reply-To: <3a570171-1ae8-4023-a44c-1c8dee93c0ae@p59g2000hsd.googlegroups.com> References: <3a570171-1ae8-4023-a44c-1c8dee93c0ae@p59g2000hsd.googlegroups.com> Message-ID: <48EA88D3.3000803@codebykevin.com> njwilson23 at gmail.com wrote: > I'm having trouble with tkinter on a new installation of Python (2.6), > built with the framework option from source that was downloaded from > python.org. I'm running OS 10.4 on a PowerPC G4. > > The problem first arose when I tried to run matplotlib - it couldn't > find tcl/tk because it was searching for 8.5, and I had 8.4. I found > and built tcl/tk 8.5, which led to a new error, reproduced below: > > Traceback (most recent call last): > File "brownian2.py", line 55, in > main() > File "brownian2.py", line 41, in main > root = Tk() > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/lib-tk/Tkinter.py", line 1645, in __init__ > self._loadtk() > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/lib-tk/Tkinter.py", line 1659, in _loadtk > % (_tkinter.TK_VERSION, tk_version) > RuntimeError: tk.h version (8.4) doesn't match libtk.a version (8.5) > > I'm a bit of a neophyte - can anyone tell me how to go about fixing > this? I've found some information by searching the list and Google, > but no helpful solutions. > > Thanks, > Nat I haven't yet installed Python 2.6, but I've seen this error reported here and on the MacPython list. Based on what I'm seeing in the error message and in the setup.py file in the source code, it appears that Python 2.6 is looking in /System/Library/Frameworks for a Tcl/Tk installation rather than in /Library/Frameworks, which is second on the list of places to look. Tcl/Tk 8.4 comes standard with OS X in 10.4 and 10.5, and it's installed in /System/Library/Frameworks. The problem is that Python 2.6 seems to be linked against Tcl/Tk 8.5--is this correct?--and when it finds Tcl/tk 8.4, it returns an error. You can avoid this problem by building Python yourself and putting /Library/Frameworks first on the search path for Tcl/Tk. Look in setup.py in the source code, around line 1438 (in the 'detect_tkinter_darwin' function), and either comment out /System/Library or put it underneath /Library/Frameworks. This is what the official build from Python.org should do--look first in /Library/Frameworks and then fall back on /System/Library/Frameworks. I'm not sure why it doesn't. Should a bug report be filed against this? If the Mac build of Python 2.6 consistently looks in /System/Library/Frameworks for Tcl/Tk, it won't run Tkinter applications. It makes the build pretty much useless for anyone needing it to run Tkinter apps, including Idle. I'd say it's a showstopper issue. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From Hubert.Holin at lmd.polytechnique.fr Tue Oct 7 15:00:01 2008 From: Hubert.Holin at lmd.polytechnique.fr (Hubert Holin) Date: Tue, 7 Oct 2008 15:00:01 +0200 Subject: [Pythonmac-SIG] How to build a 4-ways universal Python 2.6 on MacOS X 10.5.5/XCode 3.1.1? Message-ID: Somewhere in the E.U., le 07/10/2008 Bonjour I am having some difficulty building a 4-ways universal Python 2.6 on MacOS X 10.5.5/XCode 3.1.1. The hardware I am attempting the build on is an aging twin-G5 (a 64-bits architecture)... I am aware of the incompatibility of Tcl/Tk with 64-bits architectures, which is not an issue for me (I nonetheless installed the latest ActiveState build, and changed setup.py to first look in / Library/Frameworks/). When I invoke configure thus: ./configure --enable-framework --enable-universalsdk --with-universal- archs="all" --with-cxx-main=gcc-4.2 the operation is a failure (no Makefile is generated) because configure reports it can't figure out the size of an "int". Removing the --with-universal-archs="all" option does result in a Makefile being produced but only for 32-bits architectures. Note that I had to add the --with-cxx-main=gcc-4.2 option as otherwise gcc-4.0 was selected. What I have googled so far hints at problems in building what I am after, but it is unclear if these have been overcome. What am I missing? Merci Hubert Holin From dave.opstad at monotypeimaging.com Tue Oct 7 18:52:55 2008 From: dave.opstad at monotypeimaging.com (Dave Opstad) Date: Tue, 07 Oct 2008 09:52:55 -0700 Subject: [Pythonmac-SIG] tcl/tk version confusion with tkinter in Python 2.6, on OS X In-Reply-To: <48EA88D3.3000803@codebykevin.com> Message-ID: Kevin Walzer wrote: > Should a bug report be filed against this? If the Mac build of Python > 2.6 consistently looks in /System/Library/Frameworks for Tcl/Tk, it > won't run Tkinter applications. It makes the build pretty much useless > for anyone needing it to run Tkinter apps, including Idle. I'd say it's > a showstopper issue. I believe there is currently a bug for this problem: http://bugs.python.org/issue4017 It looks like it's still unresolved. Dave From jacqueminv at gmail.com Tue Oct 7 22:58:24 2008 From: jacqueminv at gmail.com (Valentin Jacquemin) Date: Tue, 7 Oct 2008 22:58:24 +0200 Subject: [Pythonmac-SIG] Application launch issue Message-ID: Hello, I have an issue with my registrer.app. When I launch it from the command line all is fine but when I double click on it from the finder, I get an error: ImportError: No module named traceback. My application list some files in the current directory and then it rename each file according to a specific rule. I am on python 2.5, I use the os, sys and pdflib libraries. The OS is Leopard 10.5.5. Could anyone help me? Best regards, Valentin Jacquemin -------------- next part -------------- An HTML attachment was scrubbed... URL: From mankoff at gmail.com Thu Oct 9 16:55:48 2008 From: mankoff at gmail.com (Ken Mankoff) Date: Thu, 9 Oct 2008 10:55:48 -0400 (EDT) Subject: [Pythonmac-SIG] Import Error / Library Version Message-ID: Hi PythonMac-SIG, I posted this on the wxpython-mac list (sorry for dupe) but was not able to solve the issue, so I'm trying here. I've succeeded in getting a python script running on 10.5 intel and then transferred and running on 10.4 ppc via py2app thanks to a recent thread in this group. I've now run into what appears to be a wx specific problem. When I double-click on a small Hello World wxPython app, I get the following error message: > Hello Error. An unexpected error occurred during the execution of > the main script > > ImportError: > dlopen(/Users/mankoff/Desktop/Hello.app/Contents/Resources/lib/python2.5/wx/_core_.so, > 2): Library not loaded /usr/lib/libiconv.2.dylib > > Referenced from > /Users/mankoff/Desktop/Hello.app/Contents/MacOS/../Frameworks/libwx_macud-2.8.2.dylib > > Reason: Incompatible library version: libwx_macud-2.8.0.dylib > requires version 7.0.0 or later, but libiconv.2.dylib provides > version 5.0.0 I created the app with: python setup.py py2app Where 'which python' shows it is my python.org build installed in /opt/python/2.5.2/. The setup.py script is: [code] from distutils.core import setup import py2app py2app_options = dict( ) setup( app=['hello.py'], options=dict( py2app=py2app_options, ) ) [/code] And the hello.py code is: [code] import wx app = wx.PySimpleApp() frame = wx.Frame(None, wx.ID_ANY, "Hello World") frame.Show(True) app.MainLoop() [/code] Any help will be much appreciated. Thanks, -k. From Martin.Toennishoff at 1und1.de Thu Oct 9 19:33:40 2008 From: Martin.Toennishoff at 1und1.de (=?iso-8859-1?Q?Martin_T=F6nnishoff?=) Date: Thu, 9 Oct 2008 19:33:40 +0200 Subject: [Pythonmac-SIG] Appscript Python module / Applescript to python conversion Message-ID: Hello, sorry to annoy you with a noobish question but I just don't understand what I am doing wrong... I am relatively new to Python but its better than Applescript to me. Can you please help me to get this right? How do I convert a string to the required "unicode_text" type wich is noth the python builtin one. Reading the manual and google didn't help. Your help would be very much appreciated. Im using an Intel Macbook with Leopard 10.5.5, Python 2.5.1 and the newest appscript release. You can find appscript on appscript.sourceforge.net. I'm trying to do the following: # coding: utf-8 from appscript import * import random import time #start & open safari browser safari= app('Safari') safari.activate() safari.document.URL.set("http://www.google.de") #wait for browser to open page foo = 5 + int(random.random()*10) time.sleep(foo) #do some javascript manipulation on the loaded page jscript= u"window.alert('foo');" safari.do_JavaScript(jscript) And this is the error message I am getting: Traceback (most recent call last): File "scan.py", line 22, in safari.do_JavaScript(jscript) File "/Library/Python/2.5/site-packages/appscript/reference.py", line 439, in __call__ raise CommandError(self, (args, kargs), e) appscript.reference.CommandError: CommandError -1700: Can't make some data into the expected type. Failed command: app(u'/Applications/Safari.app').do_JavaScript(u"window.alert('foo');") Help says: >>> safari.help('-t do_JavaScript') ============================================================================== Help (-t do_JavaScript) Reference: app(u'/Applications/Safari.app') ------------------------------------------------------------------------------ Terminology for do_JavaScript command Command: do_JavaScript -- Applies a string of JavaScript code to a document. unicode_text -- The JavaScript code to evaluate. [in_ : tab] -- The tab that the JavaScript should be evaluated in. Result: anything ============================================================================== Thank you very much in advance. Yours Martin T?nnishoff -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Thu Oct 9 20:21:35 2008 From: nad at acm.org (Ned Deily) Date: Thu, 09 Oct 2008 11:21:35 -0700 Subject: [Pythonmac-SIG] Appscript Python module / Applescript to python conversion References: Message-ID: In article , Martin T?nnishoff wrote: > Can you please help me to get this right? How do I convert a string to the > required "unicode_text" type wich is noth > the python builtin one. The error message is misleading you. The problem is not the string; it's that you are not targeting the correct reference. [...] > safari.document.URL.set("http://www.google.de") > > #wait for browser to open page > foo = 5 + int(random.random()*10) > time.sleep(foo) > > #do some javascript manipulation on the loaded page > jscript= u"window.alert('foo');" > > safari.do_JavaScript(jscript) You need a reference to the specific document not to the application: safari.document.do_JavaScript(jscript) -- Ned Deily, nad at acm.org From Chris.Barker at noaa.gov Thu Oct 9 22:37:19 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 09 Oct 2008 13:37:19 -0700 Subject: [Pythonmac-SIG] setuptools namespace packages and py2app Message-ID: <48EE6B7F.1090809@noaa.gov> Hi all, Has anyone gotten py2app to work with namespace packages? I found this: http://pypi.python.org/pypi/rod.recipe.py2app Which I may be able to adapt for my needs, but it sounds like a major kludge, which I'd rather avoid. Has anyone come up with a better solution? Speaking of which -- is anyone maintaining py2app? I wonder if it's time to merge with bb-freeze: http://pypi.python.org/pypi/bbfreeze/ It is using modulegraph, so has at least that in common with py2app, and they seemed to have solved many of the egg issues, and are under active development. -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 smithharder at gmail.com Fri Oct 10 04:45:27 2008 From: smithharder at gmail.com (Jon Smith) Date: Thu, 9 Oct 2008 19:45:27 -0700 Subject: [Pythonmac-SIG] ScriptingBridge vs. AppScript Message-ID: Hi, I've been using Appscript and have been incredibly happy with it. However I'm having a ton of problems getting the list of tracks from my library. I was assuming the problem was with my library/iTunes itself however I can get the track list with ScriptingBridge. Am I doing something wrong? Why would ScriptingBridge work and AppScript Timeout? Any ideas. #!/usr/bin/env python from ScriptingBridge import * from appscript import * def main(argv=None): itunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes") lib = itunes.sources()[0].playlists()[0] tracks = lib.tracks() print len(tracks) tracks2 = app(u'/Applications/iTunes.app').library_playlists['Library'].file_tracks.get() print len(tracks2) if __name__ == "__main__": sys.exit(main()) Results: kona:Python joe$ time python tt.py Python: unknown type name "tdta". 38447 Traceback (most recent call last): File "tt.py", line 23, in sys.exit(main()) File "tt.py", line 19, in main tracks2 = app(u'/Applications/iTunes.app').library_playlists['Library'].file_tracks.get() File "/Library/Python/2.5/site-packages/appscript-0.18.1-py2.5-macosx-10.5-i386.egg/appscript/reference.py", line 439, in __call__ appscript.reference.CommandError: CommandError -609: connectionInvalid Failed command: app(u'/Applications/iTunes.app').library_playlists['Library'].file_tracks.get() real 2m1.152s user 0m0.687s sys 0m0.129s -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Fri Oct 10 05:59:37 2008 From: nad at acm.org (Ned Deily) Date: Thu, 09 Oct 2008 20:59:37 -0700 Subject: [Pythonmac-SIG] ScriptingBridge vs. AppScript References: Message-ID: In article , "Jon Smith" wrote: > I've been using Appscript and have been incredibly happy with it. However > I'm having a ton of problems getting the list of tracks from my library. I > was assuming the problem was with my library/iTunes itself however I can get > the track list with ScriptingBridge. Am I doing something wrong? Why would > ScriptingBridge work and AppScript Timeout? Any ideas. > > #!/usr/bin/env python > from ScriptingBridge import * > from appscript import * > > def main(argv=None): > itunes = > SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes") > lib = itunes.sources()[0].playlists()[0] > tracks = lib.tracks() > print len(tracks) > tracks2 = > app(u'/Applications/iTunes.app').library_playlists['Library'].file_tracks.get( > ) FWIW, appscript seems to have no problems for me returning a track list of length 21361. You're not quite doing an Apple-to-app(le)script comparison, though. I get a somewhat faster response from iTunes if I construct an appscript reference similar to your SB one: app('iTunes').sources()[0].playlists()[0].tracks() This is using the pre-release appscript 0.19 with the python.org python 2.5.2 on 10.5.5 Intel. I see your track count is 38447. 2**16 > 38447 > 2**15, so could there possibly be some overflow problem somewhere? -- Ned Deily, nad at acm.org From craiglewiston at gmail.com Fri Oct 10 07:20:08 2008 From: craiglewiston at gmail.com (Craig Lewiston) Date: Fri, 10 Oct 2008 01:20:08 -0400 Subject: [Pythonmac-SIG] Py2app & Xcode deployment problem: KeyError: u'PyObjCXcode' Message-ID: <297e0f2c0810092220s19835d2egd21d2b27a7899492@mail.gmail.com> Hi, I'm developing a PyObjC application in Xcode and Interface Builder, and am having a problem related to py2app and Xcode. I can build and run my application just fine under development, but am having a problem with running the application in deployment (build works just fine). I can build my app just fine from the command line ($ python setup.py py2app), however, when I try and run the application, I am getting the following error: KeyError: u'PyObjCXcode' and the result from the Console: Traceback (most recent call last): File "/Users/craig/src/HomeApp/dist/HomeApp.app/Contents/Resources/__boot__.py", line 31, in ? _run('HomeApp.py') File "/Users/craig/src/HomeApp/dist/HomeApp.app/Contents/Resources/__boot__.py", line 28, in _run execfile(path, globals(), globals()) File "/Users/craig/src/HomeApp/dist/HomeApp.app/Contents/Resources/HomeApp.py", line 9, in ? info = NSBundle.mainBundle().infoDictionary()[u'PyObjCXcode'] File "objc/_convenience.pyc", line 187, in __getitem__objectForKey_ File "objc/_convenience.pyc", line 523, in container_unwrap KeyError: u'PyObjCXcode' 2008-10-10 01:03:22.675 HomeApp[3298] HomeApp Error 2008-10-10 01:03:22.676 HomeApp[3298] An unexpected error has occurred during execution of the main script KeyError: u'PyObjCXcode' The only reference I've found to a problem like this is here: http://osdir.com/ml/python.pyobjc.devel/2005-11/msg00015.html The workaround solution offered there was: "the workaround is to recompile the bootstrap in py2app. If you delete it (py2app/bundletemplate/prebuilt/main I think) then it should recompile itself next time you build an app" I deleted prebuilt/main, but it didn't fix the problem. For reference, I have two versions of python installed, 2.4.4 and 2.5, but 2.4.4 is set as my default. I'm running Mac OS X.4.11 on PowerPC. My Py2app is only installed for python 2.4.4. I had a prior compatibility problem between Xcode & Py2app, in that Xcode did not see Py2app (presumable because Xcode used 2.5, not 2.4.4), but got around this by writing a custom build command that invokes 2.4.4. My hunch is that the problem is related to the key PyObjCXcode not existing within the infoDictionary for the mainBundle. The error happens at the line: info = NSBundle.mainBundle().infoDictionary()[u'PyObjCXcode'] Beyond this, however, I'm at a loss. Any ideas? Thanks in advance, Craig The only other reference I've found to a keyerror like this is here: From smithharder at gmail.com Fri Oct 10 20:10:01 2008 From: smithharder at gmail.com (Jon Smith) Date: Fri, 10 Oct 2008 11:10:01 -0700 Subject: [Pythonmac-SIG] ScriptingBridge vs. AppScript In-Reply-To: References: Message-ID: Saddly, I get the same error with :t2 = app('iTunes').sources()[0].playlists()[0].tracks() print len(t2) Which I think is a more Apples to Apples comparison. I suspect something different is being done in the ScriptingBridge than in appscript. I'll give the pre-release appscript a try and see if there is a difference. -Joe On Thu, Oct 9, 2008 at 8:59 PM, Ned Deily wrote: > In article > , > "Jon Smith" wrote: > > I've been using Appscript and have been incredibly happy with it. However > > I'm having a ton of problems getting the list of tracks from my library. > I > > was assuming the problem was with my library/iTunes itself however I can > get > > the track list with ScriptingBridge. Am I doing something wrong? Why > would > > ScriptingBridge work and AppScript Timeout? Any ideas. > > > > #!/usr/bin/env python > > from ScriptingBridge import * > > from appscript import * > > > > def main(argv=None): > > itunes = > > SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes") > > lib = itunes.sources()[0].playlists()[0] > > tracks = lib.tracks() > > print len(tracks) > > tracks2 = > > > app(u'/Applications/iTunes.app').library_playlists['Library'].file_tracks.get( > > ) > > FWIW, appscript seems to have no problems for me returning a track list > of length 21361. You're not quite doing an Apple-to-app(le)script > comparison, though. I get a somewhat faster response from iTunes if I > construct an appscript reference similar to your SB one: > > app('iTunes').sources()[0].playlists()[0].tracks() > > This is using the pre-release appscript 0.19 with the python.org python > 2.5.2 on 10.5.5 Intel. > > I see your track count is 38447. 2**16 > 38447 > 2**15, so could there > possibly be some overflow problem somewhere? > > -- > Ned Deily, > nad at acm.org > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hengist.podd at virgin.net Fri Oct 10 19:46:05 2008 From: hengist.podd at virgin.net (has) Date: Fri, 10 Oct 2008 18:46:05 +0100 Subject: [Pythonmac-SIG] ScriptingBridge vs. AppScript Message-ID: <8330208D-446B-4E5F-A9E5-32977B71E859@virgin.net> Jon Smith wrote: > I've been using Appscript and have been incredibly happy with it. > However > I'm having a ton of problems getting the list of tracks from my > library. I > was assuming the problem was with my library/iTunes itself however I > can get > the track list with ScriptingBridge. Am I doing something wrong? Why > would > ScriptingBridge work and AppScript Timeout? Any ideas. > > #!/usr/bin/env python > from ScriptingBridge import * > from appscript import * > > def main(argv=None): > itunes = > SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes") > lib = itunes.sources()[0].playlists()[0] > tracks = lib.tracks() > print len(tracks) > tracks2 = > app(u'/Applications/ > iTunes.app').library_playlists['Library'].file_tracks.get() > print len(tracks2) Your SB and appscript examples are actually doing very different things [1]. The SB code is sending a 'count' event to iTunes and getting back an integer indicating the number of tracks in the playlist. The appscript code is sending a 'get' event and getting back a list of references to the tracks in that playlist. Here's some direct comparisons of counting vs. getting (I've normalised everything else for clarity): - counting tracks in SB and appscript: itunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes") lib = itunes.sources()[0].playlists()[0] tracks_ref = lib.tracks() print len(tracks_ref) itunes = app(id='com.apple.iTunes') lib = itunes.sources[1].playlists[1] tracks_ref = lib.tracks print tracks_ref.count(each=k.item) - getting tracks in SB and appscript: itunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes") lib = itunes.sources()[0].playlists()[0] tracks_list = lib.tracks().get() print tracks_list itunes = app(id='com.apple.iTunes') lib = itunes.sources[1].playlists[1] tracks_list = lib.tracks.get() print tracks_list Anyway, I'm guessing you've a very large playlist and by the time iTunes has constructed a list of references to every track in it your 'get' event has timed out. To increase the timeout duration in appscript, include a 'timeout' argument in the 'get' command, e.g.: itunes = app(id='com.apple.iTunes') lib = itunes.sources[1].playlists[1] tracks_list = lib.tracks.get(timeout=600) # 10 minute timeout print tracks_list HTH has [1] It's an easy mistake though to make as SB obfuscates its internal workings even more than AppleScript. Despite the misleading name, SBElementArray is *not* a real array at all, and creating one does not automatically send a 'get' event to the target application to obtain a list of references (you have to invoke its -get method for that). -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From joe at strout.net Sat Oct 11 00:06:01 2008 From: joe at strout.net (Joe Strout) Date: Fri, 10 Oct 2008 16:06:01 -0600 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python Message-ID: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> Hi All, Some of you may remember me from almost ten years ago -- I used to be quite active, and even contributed substantially to the MacPython IDE way back in the day. Then I dropped out of the Python scene entirely. Let's call that my "dark age," and call what's happening to that now being "over." :) So now I see that Python is installed on all Macs by default; this is cool. However, where are the Mac modules? Most of the references I find on the net point to dead links, or are woefully out of date. has only a few Mac-specific modules, and those are pretty meager -- just dealing with files and such. Where's the macspeech module, for example? (I tried "import macspeech" just for a lark, but it didn't work.) Thanks, - Joe From Chris.Barker at noaa.gov Sat Oct 11 00:39:28 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 10 Oct 2008 15:39:28 -0700 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python In-Reply-To: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> References: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> Message-ID: <48EFD9A0.4070403@noaa.gov> Joe Strout wrote: > Some of you may remember me from almost ten years ago wow! is it really that long? But yes, I remember you. Didn't you work on a plotting package, too? > However, where are the Mac modules? If you mean the Mac-specific stuff, most of that is pretty well deprecated, though I think some of it lives on in the Carbon library: import Carbon However, OS-X really is a very different (and better) beast than the old MacOS, so I think you're better off using PyObjC to do Cocoa stuff, or sticking with Cross-platform libraries like wxPython. Welcome back, -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 Sat Oct 11 00:48:37 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 10 Oct 2008 15:48:37 -0700 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python In-Reply-To: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> References: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> Message-ID: <48EFDBC5.9000806@noaa.gov> Joe Strout wrote: > However, where are the Mac modules? Most of the references I > find on the net point to dead links, or are woefully out of date. Did you find this? http://docs.python.org/library/mac.html#mac-specific-services -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 Sat Oct 11 14:50:00 2008 From: hengist.podd at virgin.net (has) Date: Sat, 11 Oct 2008 13:50:00 +0100 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python In-Reply-To: References: Message-ID: <2CA1C2DE-CA6B-4A73-B587-8A8CD8F4F74B@virgin.net> Christopher Barker wrote: > If you mean the Mac-specific stuff, most of that is pretty well > deprecated, Deprecated, largely unmaintained, often buggy and/or obsolete, and completely gone as of Python 3: http://docs.python.org/dev/3.0/ > However, OS-X really is a very different (and better) beast than the > old MacOS, so I think you're better off using PyObjC to do Cocoa > stuff, or sticking with Cross-platform libraries like wxPython. PyObjC, py2app and appscript certainly make me a happy bunny. And don't forget there's a complete Unix environment with various OS X additions hiding beneath the surface as well, e.g.: import subprocess subprocess.call(['say', 'hello world']) HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From mankoff at gmail.com Sun Oct 12 00:18:35 2008 From: mankoff at gmail.com (Ken Mankoff) Date: Sat, 11 Oct 2008 18:18:35 -0400 (EDT) Subject: [Pythonmac-SIG] Import Error / Library Version In-Reply-To: References: Message-ID: On Thu, 9 Oct 2008, Ken Mankoff wrote: > Hi PythonMac-SIG, > > I posted this on the wxpython-mac list (sorry for dupe) but was > not able to solve the issue, so I'm trying here. > > I've succeeded in getting a python script running on 10.5 intel > and then transferred and running on 10.4 ppc via py2app thanks to > a recent thread in this group. I've now run into what appears to > be a wx specific problem. > > When I double-click on a small Hello World wxPython app, I get the > following error message: > >> Hello Error. An unexpected error occurred during the execution of >> the main script >> >> ImportError: >> dlopen(/Users/mankoff/Desktop/Hello.app/Contents/Resources/lib/python2.5/wx/_core_.so, >> 2): Library not loaded /usr/lib/libiconv.2.dylib >> >> Referenced from >> /Users/mankoff/Desktop/Hello.app/Contents/MacOS/../Frameworks/libwx_macud-2.8.2.dylib >> >> Reason: Incompatible library version: libwx_macud-2.8.0.dylib >> requires version 7.0.0 or later, but libiconv.2.dylib provides >> version 5.0.0 > > I created the app with: > > python setup.py py2app > > Where 'which python' shows it is my python.org build installed in > /opt/python/2.5.2/. > > > The setup.py script is: > [code] > from distutils.core import setup > import py2app > py2app_options = dict( ) > setup( > app=['hello.py'], > options=dict( > py2app=py2app_options, > ) > ) >[/code] > > And the hello.py code is: > [code] > import wx > app = wx.PySimpleApp() > frame = wx.Frame(None, wx.ID_ANY, "Hello World") > frame.Show(True) > app.MainLoop() > [/code] > > Any help will be much appreciated. > > Thanks, > > -k. > I just discovered this is a wxWidgets bug, not wxPython. I'll track it down there. -k. From hengist.podd at virgin.net Sun Oct 12 12:42:52 2008 From: hengist.podd at virgin.net (has) Date: Sun, 12 Oct 2008 11:42:52 +0100 Subject: [Pythonmac-SIG] str.decode() behaves differently in 2.5 and 2.6 Message-ID: <7CF251FB-6C97-4DAE-9871-350ADE53025D@virgin.net> Hi folks, Figure I should check here before filing a bug. Anyone understand the following discrepancy between 2.5 and 2.6: $ python2.5 Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> '\x41\x00'.decode('utf16') u'A' $ python2.6 Python 2.6 (trunk:66714:66715M, Oct 1 2008, 18:36:04) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> '\x41\x00'.decode('utf16') u'\u4100' OS X 10.5.5/i386 using default 2.5.1 Python installation vs. the Python 2.6 framework distribution from python.org. has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From hraban at fiee.net Sun Oct 12 14:30:15 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Sun, 12 Oct 2008 14:30:15 +0200 Subject: [Pythonmac-SIG] str.decode() behaves differently in 2.5 and 2.6 In-Reply-To: <7CF251FB-6C97-4DAE-9871-350ADE53025D@virgin.net> References: <7CF251FB-6C97-4DAE-9871-350ADE53025D@virgin.net> Message-ID: <04FFAAC5-08A6-45FD-95B2-34841222FF56@fiee.net> Am 2008-10-12 um 12:42 schrieb has: > Figure I should check here before filing a bug. Anyone understand > the following discrepancy between 2.5 and 2.6: > > $ python2.5 > Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> '\x41\x00'.decode('utf16') > u'A' same with 2.5.2: Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> '\x41\x00'.decode('utf16') u'A' > $ python2.6 > Python 2.6 (trunk:66714:66715M, Oct 1 2008, 18:36:04) > [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> '\x41\x00'.decode('utf16') > u'\u4100' \u4100 is some Chinese character - clearly a bug I'd say. Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From just at letterror.com Sun Oct 12 15:27:21 2008 From: just at letterror.com (Just van Rossum) Date: Sun, 12 Oct 2008 15:27:21 +0200 Subject: [Pythonmac-SIG] str.decode() behaves differently in 2.5 and 2.6 In-Reply-To: <7CF251FB-6C97-4DAE-9871-350ADE53025D@virgin.net> References: <7CF251FB-6C97-4DAE-9871-350ADE53025D@virgin.net> Message-ID: It seems as if 2.5 uses native byte order by default, and 2.6 big endian (if there's no Byte Orde Mark). Maybe a bug, maybe a bug fix, I don't know :). In the meantime, just use 'utf-16be' or 'uft-16le' explicitly or make sure there's a BOM. Just On Oct 12, 2008, at 12:42 PM, has wrote: > Hi folks, > > Figure I should check here before filing a bug. Anyone understand > the following discrepancy between 2.5 and 2.6: > > $ python2.5 > Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> '\x41\x00'.decode('utf16') > u'A' > > $ python2.6 > Python 2.6 (trunk:66714:66715M, Oct 1 2008, 18:36:04) > [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> '\x41\x00'.decode('utf16') > u'\u4100' > > > OS X 10.5.5/i386 using default 2.5.1 Python installation vs. the > Python 2.6 framework distribution from python.org. > > has > -- > Control AppleScriptable applications from Python, Ruby and ObjC: > http://appscript.sourceforge.net > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From Chris.Barker at noaa.gov Mon Oct 13 18:49:17 2008 From: Chris.Barker at noaa.gov (Chris.Barker) Date: Mon, 13 Oct 2008 09:49:17 -0700 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python In-Reply-To: <31D24822-E8F8-4668-8317-8079AD1F37BE@strout.net> References: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> <48EFDBC5.9000806@noaa.gov> <31D24822-E8F8-4668-8317-8079AD1F37BE@strout.net> Message-ID: <48F37C0D.6020402@noaa.gov> Joe Strout wrote: > But what if we want to do some of them from a > wxPython app (only when we detect we're running on a Mac, of course)? Good question -- can pyObjC play well with wx? Anyone know? -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 joe at strout.net Tue Oct 14 19:36:20 2008 From: joe at strout.net (Joe Strout) Date: Tue, 14 Oct 2008 11:36:20 -0600 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python In-Reply-To: <48F37C0D.6020402@noaa.gov> References: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> <48EFDBC5.9000806@noaa.gov> <31D24822-E8F8-4668-8317-8079AD1F37BE@strout.net> <48F37C0D.6020402@noaa.gov> Message-ID: <318A7EBB-31C5-4CB3-ABED-C3DBAD4C33AC@strout.net> On Oct 13, 2008, at 10:49 AM, Chris.Barker wrote: >> But what if we want to do some of them from a wxPython app (only >> when we detect we're running on a Mac, of course)? > > Good question -- can pyObjC play well with wx? Anyone know? Or more generally: can you invoke some Cocoa functionality from any generic Python app, or does it have to be a PyObjC app through and through? For example: suppose we wanted to take the clean but Windows-only "speech" package: ...and add Mac OS X support to it. The speech facilities in Cocoa (or Carbon, for that matter) are pretty easy to use; but this is a generic module, that ought to work in any Python app, whether it's got a wx GUI or even no GUI at all. Is this possible, and how would we go about it? Thanks, - Joe From Jack.Jansen at cwi.nl Tue Oct 14 23:39:12 2008 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue, 14 Oct 2008 23:39:12 +0200 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python In-Reply-To: <318A7EBB-31C5-4CB3-ABED-C3DBAD4C33AC@strout.net> References: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> <48EFDBC5.9000806@noaa.gov> <31D24822-E8F8-4668-8317-8079AD1F37BE@strout.net> <48F37C0D.6020402@noaa.gov> <318A7EBB-31C5-4CB3-ABED-C3DBAD4C33AC@strout.net> Message-ID: <3C42A36A-D47B-4449-84AD-B9775F039F94@cwi.nl> On 14-Oct-2008, at 19:36 , Joe Strout wrote: > On Oct 13, 2008, at 10:49 AM, Chris.Barker wrote: > >>> But what if we want to do some of them from a wxPython app (only >>> when we detect we're running on a Mac, of course)? >> >> Good question -- can pyObjC play well with wx? Anyone know? > > Or more generally: can you invoke some Cocoa functionality from any > generic Python app, or does it have to be a PyObjC app through and > through? > > For example: suppose we wanted to take the clean but Windows-only > "speech" package: > > > > ...and add Mac OS X support to it. The speech facilities in Cocoa > (or Carbon, for that matter) are pretty easy to use; but this is a > generic module, that ought to work in any Python app, whether it's > got a wx GUI or even no GUI at all. Is this possible, and how would > we go about it? Some simple things "just work", also in command line tools. These are usually the CoreFoundation things that are pretty passive objects (CFDictionaries and such). Some things work fine in a command line tool, as long as you make your command line tool have a run loop by allocating an NSRunLoop and calling one of it's run methods. But this wil require restructuring your app a bit. You may get away with running the runloop in a separate thread, but I have no experience with this (does anyone else?). I wouldn't be surprised if your speech stuff would fall in this category. Some things will contact the window server, and this is not only obviously gui-related things like dialogs and such but also more subtle ones like some AppleEvents stuff. These will still work from a command line app, but they will probably not work from, say, a CGI script (as there's no window server). Hmm, maybe the speech stuff falls in this category after all, Apple may not want you to access the speaker if you're not the owner of the screen (the "you" here being the person running the script). -- 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: From joe at strout.net Tue Oct 14 23:58:19 2008 From: joe at strout.net (Joe Strout) Date: Tue, 14 Oct 2008 15:58:19 -0600 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python In-Reply-To: <3C42A36A-D47B-4449-84AD-B9775F039F94@cwi.nl> References: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> <48EFDBC5.9000806@noaa.gov> <31D24822-E8F8-4668-8317-8079AD1F37BE@strout.net> <48F37C0D.6020402@noaa.gov> <318A7EBB-31C5-4CB3-ABED-C3DBAD4C33AC@strout.net> <3C42A36A-D47B-4449-84AD-B9775F039F94@cwi.nl> Message-ID: On Oct 14, 2008, at 3:39 PM, Jack Jansen wrote: > Some simple things "just work", also in command line tools. These > are usually the CoreFoundation things that are pretty passive > objects (CFDictionaries and such). > > Some things work fine in a command line tool, as long as you make > your command line tool have a run loop by allocating an NSRunLoop... > > Some things will contact the window server OK, I'm fine with (and used to, from other environments) those sorts of limitations. So in Python, how would you go about accessing those things? Just import objc and make the same calls you would in a real PyObjC app? Though I've written a couple of toy PyObjC apps on my own by now, I'm still struggling to really understand what I'm doing and how it all works. I don't suppose anyone has an example of some Cocoa call that should work in any Python app on the Mac? Thanks, - Joe From joe at strout.net Wed Oct 15 00:06:56 2008 From: joe at strout.net (Joe Strout) Date: Tue, 14 Oct 2008 16:06:56 -0600 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python In-Reply-To: References: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> <48EFDBC5.9000806@noaa.gov> <31D24822-E8F8-4668-8317-8079AD1F37BE@strout.net> <48F37C0D.6020402@noaa.gov> <318A7EBB-31C5-4CB3-ABED-C3DBAD4C33AC@strout.net> <3C42A36A-D47B-4449-84AD-B9775F039F94@cwi.nl> Message-ID: On Oct 14, 2008, at 3:58 PM, Joe Strout wrote: > OK, I'm fine with (and used to, from other environments) those sorts > of limitations. So in Python, how would you go about accessing > those things? Just import objc and make the same calls you would in > a real PyObjC app? Just to show I'm making an effort... here's code that works fine in a PyObjC app, but doesn't seem to be working in interactive mode: >> import objc >>> from Foundation import * >>> synth = NSSpeechSynthesizer.alloc().initWithVoice_(None) Traceback (most recent call last): File "", line 1, in NameError: name 'NSSpeechSynthesizer' is not defined Poking around in Foundation, sure enough, NSSpeechSynthesizer isn't there. A lot of other stuff is, like NSError, though. Where should NSSpeechSynthesizer be imported from, and why don't I need any other imports in my PyObjC source file? Thanks, - Joe From joe at strout.net Wed Oct 15 00:24:01 2008 From: joe at strout.net (Joe Strout) Date: Tue, 14 Oct 2008 16:24:01 -0600 Subject: [Pythonmac-SIG] newbie questions about Mac APIs in Python In-Reply-To: References: <5A929E6C-9349-47C1-AE76-3BA962F5B127@strout.net> <48EFDBC5.9000806@noaa.gov> <31D24822-E8F8-4668-8317-8079AD1F37BE@strout.net> <48F37C0D.6020402@noaa.gov> <318A7EBB-31C5-4CB3-ABED-C3DBAD4C33AC@strout.net> <3C42A36A-D47B-4449-84AD-B9775F039F94@cwi.nl> Message-ID: <0E12E52C-6018-48BC-92F7-38518A7B07D2@strout.net> On Oct 14, 2008, at 4:06 PM, Joe Strout wrote: > Poking around in Foundation, sure enough, NSSpeechSynthesizer isn't > there. A lot of other stuff is, like NSError, though. Where should > NSSpeechSynthesizer be imported from, and why don't I need any other > imports in my PyObjC source file? Sheesh, I really need to find an email client with a 5-minute outgoing mail delay... somehow, pressing the "Send" key always seems to kick my brain into gear. In this case, I discovered the "Find Selected Text in Documentation" contextual menu command in XCode, which led me to the NSSpeechSynthesizer Class Reference, which points out that this is in the AppKit framework. So, modifying my earlier attempt a bit... >>> import AppKit >>> synth = AppKit.NSSpeechSynthesizer.alloc().initWithVoice_(None) >>> synth.startSpeakingString_(u"Hello world!") True ...and it works! Certainly not as easy as "speak", but easy enough. And in its own way, it's very cool that you can read the Apple docs for any (?) Cocoa class and just use it as-is from Python. Man, it's good to be back! Cheers, - Joe -- Joe Strout joe at strout.net Words of wisdom from Helen Philpot: From joe at strout.net Wed Oct 15 05:34:58 2008 From: joe at strout.net (Joe Strout) Date: Tue, 14 Oct 2008 21:34:58 -0600 Subject: [Pythonmac-SIG] Example of stand-alone NSRunLoop? Message-ID: I had great success using NSSpeechSynthesizer today, but my attempts to use NSSpeechRecognizer haven't gone nearly so well. Here's what I'm trying to do: ----- from Foundation import * import AppKit class SRDelegate(NSObject): def speechRecognizer_didRecognizeCommand_(self,sender,cmd): print "speechRecognizer_didRecognizeCommand_", cmd recog = AppKit.NSSpeechRecognizer.alloc().init() recog.setCommands_([u"red", u"green", u"blue"]) d = SRDelegate.alloc().init() recog.setDelegate_(d) print "Listening..." recog.startListening() # Now we need a NSRunLoop... runLoop = NSRunLoop.alloc() # note: no init() method? runLoop.run() ----- However, runLoop.run() returns immediately (or nearly so), instead of waiting. Reading the docs, this is expected behavior if the run loop doesn't have any "input sources," but I'm stumped in trying to give it one. Unfortunately, I'm even more of a newbie to Cocoa than I am to Python... can anyone share a clue? Thanks, - Joe From Jack.Jansen at cwi.nl Wed Oct 15 11:25:58 2008 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed, 15 Oct 2008 11:25:58 +0200 Subject: [Pythonmac-SIG] Example of stand-alone NSRunLoop? In-Reply-To: References: Message-ID: <179B37CC-0C8D-4B84-AB19-6CDA3BF4CA67@cwi.nl> On 15 okt 2008, at 05:34, Joe Strout wrote: > # Now we need a NSRunLoop... > runLoop = NSRunLoop.alloc() # note: no init() method? > runLoop.run() I think allocating a runloop is hardly ever what you need: there's one already, and you want to get that: runLoop = NSRunLoop.mainRunLoop() This indeed brings up the speech listener window-let (Can't test it, no microphone right now). This is a paradigm you'll come across often in Cocoa: there's a lot of objects of which there is one instance per application, and there's a class method to get that instance. NSApplication, NSFontManager, NSNotificationCentre, too many to mention, really. -- 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 ronaldoussoren at mac.com Wed Oct 15 11:58:44 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 15 Oct 2008 11:58:44 +0200 Subject: [Pythonmac-SIG] Example of stand-alone NSRunLoop? Message-ID: <121066051600554396154613583856851372902-Webmail2@me.com> On Wednesday, October 15, 2008, at 11:25AM, "Jack Jansen" wrote: > >On 15 okt 2008, at 05:34, Joe Strout wrote: >> # Now we need a NSRunLoop... >> runLoop = NSRunLoop.alloc() # note: no init() method? This is definitely wrong, you must always call some kind of init method after calling alloc. >> runLoop.run() > >I think allocating a runloop is hardly ever what you need: there's one >already, and you want to get that: > > runLoop = NSRunLoop.mainRunLoop() Or better yet: runLoop = NSRunLoop.currentRunLoop(). The difference is that mainRunLoop returns the run loop for the main thread, currentRunLoop returns the run loop for the current thread. Ronald From joe at strout.net Wed Oct 15 16:27:24 2008 From: joe at strout.net (Joe Strout) Date: Wed, 15 Oct 2008 08:27:24 -0600 Subject: [Pythonmac-SIG] Speech Recognition example (was Re: Example of stand-alone NSRunLoop) In-Reply-To: <121066051600554396154613583856851372902-Webmail2@me.com> References: <121066051600554396154613583856851372902-Webmail2@me.com> Message-ID: <4D679A40-AB55-4603-884C-70F7849DF41F@strout.net> Thanks, Jack and Ronald. Using currentRunLoop() or mainRunLoop() makes it the run loop work. I found that I also needed to call setListensInForegroundOnly_(False), since a simple terminal app is never considered to be in the foreground, and so would not otherwise be able to listen. With that modification, it works great! For the archives, here's a complete working demo of Mac speech recognition (below). Incidentally, it seems that SR has taken a step backwards in Cocoa. Carbon lets you specify a language model (i.e. grammar), which allows for commands with parameters for example. The Cocoa approach is much more limited, only allowing you to specify a set of simple fixed commands. Even the docs admit this: > The NSSpeechSynthesizer and NSSpeechRecognizer classes provide the > Cocoa interface to the lower-level Carbon technologies of Speech > Synthesis and Speech Recognition, respectively. If you require > greater control of speech than permitted by the Cocoa classes, you > may use the underlying Carbon frameworks instead. This is odd, since I thought Carbon was going away (not going to work on 64-bit machines), and Cocoa was the officially blessed API now. Makes me worry a bit about the whole SR functionality, which has always been a bit of an unwanted stepchild. Time will tell, I guess. But anyway, here's the code -- thanks to all for your help. (And if you spot anything in the code that doesn't follow standard Python idioms, please do correct me, as I'm eager to learn.) Cheers, - Joe ----- #!/usr/bin/Python # # Stand-alone Cocoa speech recognition test. # from Foundation import * import AppKit import sys class SRDelegate(NSObject): def speechRecognizer_didRecognizeCommand_(self,sender,cmd): print "speechRecognizer_didRecognizeCommand_", cmd if cmd == u"Quit the test.": sys.exit() recog = AppKit.NSSpeechRecognizer.alloc().init() recog.setCommands_( [ u"Test the speech recognizer.", u"What is the airspeed velocity of an unladen swallow?", u"What is your quest?", u"What is the capital of Assyria?", u"Quit the test."]) recog.setListensInForegroundOnly_(False) d = SRDelegate.alloc().init() recog.setDelegate_(d) print "Listening..." recog.startListening() # Now we need to enter the run loop... runLoop = NSRunLoop.currentRunLoop() runLoop.run() ----- From hengist.podd at virgin.net Wed Oct 15 21:07:16 2008 From: hengist.podd at virgin.net (has) Date: Wed, 15 Oct 2008 20:07:16 +0100 Subject: [Pythonmac-SIG] str.decode() behaves differently in 2.5 and 2.6 In-Reply-To: References: <7CF251FB-6C97-4DAE-9871-350ADE53025D@virgin.net> Message-ID: <4566942F-634B-42C0-A85C-9B85F7E34898@virgin.net> On 12 Oct 2008, at 14:27, Just van Rossum wrote: > It seems as if 2.5 uses native byte order by default, and 2.6 big > endian (if there's no Byte Orde Mark). Maybe a bug, maybe a bug fix, > I don't know :). In the meantime, just use 'utf-16be' or 'uft-16le' > explicitly or make sure there's a BOM. After further digging, it looks like it's a manifestation of a known issue in 2.6's C API: http://bugs.python.org/issue4060 Anyway, I've added a workaround to my code as suggested. Thanks, has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From joe at strout.net Thu Oct 16 19:28:19 2008 From: joe at strout.net (Joe Strout) Date: Thu, 16 Oct 2008 11:28:19 -0600 Subject: [Pythonmac-SIG] Python-Mac wiki? Message-ID: <915F894C-546F-418F-A849-6493B55E52B2@strout.net> This mailing list is great, but it'd be nice to have a wiki we could all contribute docs, explanations, and examples to as well. Is there something like that already set up? Thanks, - Joe -- Joe Strout joe at strout.net Words of wisdom from Helen Philpot: From hraban at fiee.net Thu Oct 16 19:38:24 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Thu, 16 Oct 2008 19:38:24 +0200 Subject: [Pythonmac-SIG] Python-Mac wiki? In-Reply-To: <915F894C-546F-418F-A849-6493B55E52B2@strout.net> References: <915F894C-546F-418F-A849-6493B55E52B2@strout.net> Message-ID: <680B5E2D-B6F2-47B2-B094-EF5A88E13EF9@fiee.net> Am 2008-10-16 um 19:28 schrieb Joe Strout: > This mailing list is great, but it'd be nice to have a wiki we could > all contribute docs, explanations, and examples to as well. Is > there something like that already set up? http://wiki.python.org/moin/MacPython/ But needs a caring maintainer... Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From eykd at eykd.net Thu Oct 16 20:30:33 2008 From: eykd at eykd.net (David Eyk) Date: Thu, 16 Oct 2008 13:30:33 -0500 Subject: [Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources Message-ID: Under setuptools 0.6c9, py2app 0.3.6, OS X 10.4.11, when running the py2app command, modulegraph raises an ImportError trying to find pkg_resources. I'm not sure if this is a setuptools issue, a py2app issue, or a modulegraph issue. Here's the output: $ ./bin/python-local setup.py py2app running py2app running build_py running egg_info writing requirements to src/bash.egg-info/requires.txt writing src/bash.egg-info/PKG-INFO writing top-level names to src/bash.egg-info/top_level.txt writing dependency_links to src/bash.egg-info/dependency_links.txt writing entry points to src/bash.egg-info/entry_points.txt writing manifest file 'src/bash.egg-info/SOURCES.txt' running build_scripts Traceback (most recent call last): File "/Users/deyk/code/py/spaaace/trunk/eggs/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 548, in _run self.run_normal() File "/Users/deyk/code/py/spaaace/trunk/eggs/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 600, in run_normal mf = self.get_modulefinder() File "/Users/deyk/code/py/spaaace/trunk/eggs/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 508, in get_modulefinder debug=debug, File "build/bdist.macosx-10.3-fat/egg/modulegraph/find_modules.py", line 243, in find_modules find_needed_modules(mf, scripts, includes, packages) File "build/bdist.macosx-10.3-fat/egg/modulegraph/find_modules.py", line 171, in find_needed_modules mf.import_hook(mod) File "build/bdist.macosx-10.3-fat/egg/modulegraph/modulegraph.py", line 245, in import_hook q, tail = self.find_head_package(parent, name) File "build/bdist.macosx-10.3-fat/egg/modulegraph/modulegraph.py", line 296, in find_head_package raise ImportError, "No module named " + qname ImportError: No module named pkg_resources > /Users/deyk/code/py/spaaace/trunk/build/bdist.macosx-10.3-fat/egg/modulegraph/modulegraph.py(296)find_head_package() (Pdb) import setuptools (Pdb) setuptools.__version__ '0.6c9' (Pdb) import pkg_resources (Pdb) As you can see, pkg_resources is importable, at least from within the debugger, but I don't understand how exactly modulegraph works its magic. Any ideas? (I've attached my setup.py, in case it might shed light.) Thanks for your time. David Eyk -------------- next part -------------- A non-text attachment was scrubbed... Name: setup.py Type: text/x-python Size: 1813 bytes Desc: not available URL: From Chris.Barker at noaa.gov Thu Oct 16 20:54:07 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 16 Oct 2008 11:54:07 -0700 Subject: [Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources In-Reply-To: References: Message-ID: <48F78DCF.1030108@noaa.gov> David Eyk wrote: > Under setuptools 0.6c9, py2app 0.3.6, OS X 10.4.11, when running the > py2app command, modulegraph raises an ImportError trying to find > pkg_resources. I'm not sure if this is a setuptools issue, a py2app > issue, or a modulegraph issue. Well, py2app was never designed to use eggs. In particular, I'm in the middle of a pkg_resources nightmare. However, I haven't had any trouble getting the app to build, I have my problems at run time. A few things to suggest: 1) Use the latest versions of py2app and modulegraph from SVN. $ easy_install modulegraph==dev and $ easy_install py2app==dev will do it, and you may also need: $ easy_install macholib==dev That will get you py2app 0.4.2 2) Make sure all your eggs are NOT zipped, which requires: $ easy_install -Z NameOfPackage however, I don't think that works in place, so you need to uninstall them first, if you have them installed as zip packages: $ easy_install -m NameOfPackage then delete the egg itself by hand, then run easy_install again. It's possible that all you have to do is unzip the zipped eggs, but I've never tried that. The trickiest one to do is setuptools itself, as it defaults to a zipped install. I had to clean out the entire thing, and install it again with something like: $ ez_setup -Z setuptools Try all that, and let us know what happens. By the way, py2app has seen minimal maintenance lately, which is a real bummer. However, there is a bit of hope. The author of bb-freeze is looking at OS_X, and may make a bb-freeze--py2app merger of sorts. -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 otu at iptech-ghana.com Thu Oct 16 18:11:25 2008 From: otu at iptech-ghana.com (otu at iptech-ghana.com) Date: Thu, 16 Oct 2008 11:11:25 -0500 (CDT) Subject: [Pythonmac-SIG] Macpython installation Message-ID: <50253.41.210.29.255.1224173485.squirrel@www.iptech-ghana.com> Dear sir, I am using a Mac, Processor- PowerPC G4, Memory- 384MB SDRAM Operating System- Mac OS X Version 10.3.9 I have installed MacPYthon , 2.3, 2.5 and lately 2.6. For all these versions I could not access the IDLE IDE. It was not that difficult in windows. What am I doing wrong? Please help Bennedy From Chris.Barker at noaa.gov Thu Oct 16 22:11:30 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 16 Oct 2008 13:11:30 -0700 Subject: [Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources In-Reply-To: References: <48F78DCF.1030108@noaa.gov> Message-ID: <48F79FF2.4090601@noaa.gov> David Eyk wrote: > /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/MacOS/bash > malformed object (unknown load command 8) > stripping saved 18312668 bytes (12069072 / 30381740) That may be a warning, rather than an error -- did you try running the app? I also thought that was fixed (a similar issue was) in the latest macholib -- did you update that too? This may be a problem that comes a goes, too -- make sure you delete "build" and "dist" and try again. -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 pythonmac at rebertia.com Thu Oct 16 22:17:42 2008 From: pythonmac at rebertia.com (Chris Rebert) Date: Thu, 16 Oct 2008 13:17:42 -0700 Subject: [Pythonmac-SIG] Macpython installation In-Reply-To: <50253.41.210.29.255.1224173485.squirrel@www.iptech-ghana.com> References: <50253.41.210.29.255.1224173485.squirrel@www.iptech-ghana.com> Message-ID: <47c890dc0810161317p5de49da1h8088fa208703a09e@mail.gmail.com> On Thu, Oct 16, 2008 at 9:11 AM, wrote: > Dear sir, > I am using a Mac, > Processor- PowerPC G4, > Memory- 384MB SDRAM > Operating System- Mac OS X Version 10.3.9 > > I have installed MacPYthon , 2.3, 2.5 and lately 2.6. For all these > versions I could not access the IDLE IDE. It was not that difficult in > windows. How have you been trying to access it? What happens when you try to access it? Do you have Apple's version of X Windows installed correctly? What happens when you run python -c 'import Tkinter' in Terminal? IDLE works fine for me, though I have Python installed from Fink, which could be a factor. Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com > What am I doing wrong? > Please help > Bennedy > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From Chris.Barker at noaa.gov Thu Oct 16 22:34:13 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 16 Oct 2008 13:34:13 -0700 Subject: [Pythonmac-SIG] Macpython installation In-Reply-To: <47c890dc0810161317p5de49da1h8088fa208703a09e@mail.gmail.com> References: <50253.41.210.29.255.1224173485.squirrel@www.iptech-ghana.com> <47c890dc0810161317p5de49da1h8088fa208703a09e@mail.gmail.com> Message-ID: <48F7A545.4000806@noaa.gov> Chris Rebert wrote: >> Operating System- Mac OS X Version 10.3.9 10.3 is getting pretty old. I think the pythons from python.org are supposed to work with it, but I wouldn't know. >> I have installed MacPYthon , 2.3, 2.5 and lately 2.6. I think there are issues with TK and 2.6 -- it's still pretty new. However 2.5 is working out of the box for me on 10.4 anyway. > How have you been trying to access it? What happens when you try to access it? > Do you have Apple's version of X Windows installed correctly? That shouldn't be required for the framework build -- it's not using X Fink is a while different story. -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 Thu Oct 16 23:17:55 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 16 Oct 2008 14:17:55 -0700 Subject: [Pythonmac-SIG] Macpython installation In-Reply-To: <2EA06FF9-396E-43B7-B87F-63D47BA707BA@strout.net> References: <50253.41.210.29.255.1224173485.squirrel@www.iptech-ghana.com> <47c890dc0810161317p5de49da1h8088fa208703a09e@mail.gmail.com> <48F7A545.4000806@noaa.gov> <2EA06FF9-396E-43B7-B87F-63D47BA707BA@strout.net> Message-ID: <48F7AF83.2020107@noaa.gov> Joe Strout wrote: > On Oct 16, 2008, at 2:34 PM, Christopher Barker wrote: >> However 2.5 is working out of the box for me on 10.4 anyway. > For my own curiosity, how do you invoke it? I've heard about IDLE but > haven't found any actual instructions for launching it yet. There is a *.app in Applications/MacPython 2.5 Though I don't actually use it, I only tested it just before I wrote that post. -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 Oct 17 01:10:32 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 16 Oct 2008 16:10:32 -0700 Subject: [Pythonmac-SIG] Macpython installation In-Reply-To: <8E3BD292-80CF-483F-AF77-F9EFFBD51F62@strout.net> References: <50253.41.210.29.255.1224173485.squirrel@www.iptech-ghana.com> <47c890dc0810161317p5de49da1h8088fa208703a09e@mail.gmail.com> <48F7A545.4000806@noaa.gov> <2EA06FF9-396E-43B7-B87F-63D47BA707BA@strout.net> <48F7AF83.2020107@noaa.gov> <8E3BD292-80CF-483F-AF77-F9EFFBD51F62@strout.net> Message-ID: <48F7C9E8.7000108@noaa.gov> Joe, Your messages are going only to me. That may be intentional, but if you want them to go to the list, you need to "reply all". Joe Strout wrote: > Ah, but I didn't actually install MacPython; I just opened up a terminal > window and typed "Python" and said "ooh, how nice, it's pre-installed!" > > What else am I missing because of this procedure? What's the difference > between "MacPython" and "Python which comes pre-installed on a Mac"? MacPython is simply the python build that you can get from python.org. With OS-X 10.5, Apple included Python2.5.1, which was the latest at the time of the release. However, historically, they have never upgraded python between OS-X releases, which has been the case so for -- the most recent 2.5 is not 2.5.2, and python2.6 is out now. There are reasons to use Apple's Python and other reasons to use the python.org build. In short: If you want to use py2app and deploy to other versions of OS-X, then use the python.org build. If you want to easily install binaries that others build, there are more for the python.org build. If you upgrade packages that Apple provides, things may not work right, either for your code or Apple's. If you want IDLE, (and TK? ) then apparently you need the python.org version. So -- unless the download and install is onerous, or if you need the couple things Apple provides that are not open-source (I don't remember what they are -- googling should help), then I'd use the Python.org 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 skip at pobox.com Fri Oct 17 16:40:25 2008 From: skip at pobox.com (skip at pobox.com) Date: Fri, 17 Oct 2008 09:40:25 -0500 Subject: [Pythonmac-SIG] Python-Mac wiki? In-Reply-To: <915F894C-546F-418F-A849-6493B55E52B2@strout.net> References: <915F894C-546F-418F-A849-6493B55E52B2@strout.net> Message-ID: <18680.41945.576135.822974@montanaro-dyndns-org.local> Joe> This mailing list is great, but it'd be nice to have a wiki we Joe> could all contribute docs, explanations, and examples to as well. Joe> Is there something like that already set up? The old MacPython wiki was migrated as a subtree of the main Python wiki a couple years ago: http://wiki.python.org/moin/FrontPage?action=fullsearch&context=180&value=MacPython&titlesearch=Titles Skip From Chris.Barker at noaa.gov Fri Oct 17 18:56:58 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 17 Oct 2008 09:56:58 -0700 Subject: [Pythonmac-SIG] Adding sub-packages in py2app Message-ID: <48F8C3DA.5030805@noaa.gov> Hi all, I find I sometimes need to add a sub-package or module that wasn't pickle dup my py2app, and can't figure out how to do it. The problem is thus: say I have a module I'm using that's part of a bigger package. It might get imported like so: from BigPackage.SubPackage import Amodule If I add it to the includes list like this: OPTIONS = {... 'includes': ['BigPackage.SubPackage.Amodule'], } It gets included, but as "Amodule", so it would have to be imported as: import Amodule If do this: 'packages' : [BigPackage] all of BigPackage gets included, but if it's big, and all I need is the one module, that's a lot of extra stuff. is there a way to handle this??? NOTE: If I was really importing the way I do above, py2app should pick it up and it'll get included properly, but sometimes that stuff is getting import with __import__ or, when unpacking a pickle, or..., so I do need to tell py2app to include it. -thanks, -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 Fri Oct 17 19:34:48 2008 From: hengist.podd at virgin.net (has) Date: Fri, 17 Oct 2008 18:34:48 +0100 Subject: [Pythonmac-SIG] Anyone have 10.5.5 on a G5? Message-ID: <7ED7C523-5ADD-475B-834A-2470854ED573@virgin.net> Hi folks, Trying to get py-appscript 0.19.0 out the door, but I've a user reporting big problems trying to install it on their system and need to find out if it's their system or appscript that's at fault. Need a quick favour from someone with a copy of 10.5.5 on a G5: would you mind grabbing a copy of the latest py-appscript trunk (rev 589) from svn and seeing if builds and installs correctly via easy_install? Something like: svn checkout http://appscript.svn.sourceforge.net/svnroot/appscript/py-appscript/trunk py-appscript-0.19.0 easy_install --verbose appscript-0.19.0 (If you're not familiar with Subversion, drop me an email and I can send a .tar.gz.) Many thanks, has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From eykd at eykd.net Fri Oct 17 20:55:35 2008 From: eykd at eykd.net (David Eyk) Date: Fri, 17 Oct 2008 13:55:35 -0500 Subject: [Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources In-Reply-To: <48F78DCF.1030108@noaa.gov> References: <48F78DCF.1030108@noaa.gov> Message-ID: My apologies to Chris Barker--I accidentally took this discussion off the list, too. A common newbie mistake, it appears? His advice fixed my initial issue, but py2app is still failing mysteriously on me, now for different reasons. I've reconstructed the pertinent bits of my further problem below: On Thu, Oct 16, 2008 at 3:11 PM, Christopher Barker wrote: >> David Eyk wrote: >> >> That got me halfway there! Let me briefly plug zc.buildout here: I've >> been using it on all my projects since PyCon, and it made these tweaks >> quite easy to implement, with a few changes to my buildout.cfg and >> setup.py. >> On to further problems, now: py2app builds about half of my app >> package, but fails with the following message: >> >> /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/MacOS/bash >> malformed object (unknown load command 8) >> stripping saved 18312668 bytes (12069072 / 30381740) > That may be a warning, rather than an error -- did you try running the app? I did. Here's the console output: >>>> kernel : INFO Starting up. kernel : ERROR AUGGH!!!! Run in circles! Scream and shout! Traceback (most recent call last): File "kernel.pyo", line 106, in main File "kernel.pyo", line 38, in initView File "bash/view.pyo", line 43, in ImportError: cannot import name space root : ERROR File "kernel.pyo", line 106, in main File "kernel.pyo", line 38, in initView File "bash/view.pyo", line 43, in root : ERROR ImportError: cannot import name space root : ERROR Entering debugger post-mortem: /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/Resources/bash/view.pyo(43)() (Pdb) kernel : INFO Main: Finished. <<<<< Interestingly: $ ls /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/Resources/ PythonApplet.icns __boot__.py data/ lib/ site.pyc Spaaace.py __error__.sh include/ site.py* No kernel.pyo, and no bash package actually exist inside the app bundle. I see them in "build/bdist.macosx-10.3-fat/python2.5-standalone/app/collect/", but nowhere else. The run-time error is the same when I move the app somewhere else and run it. It seems to still be importing them out of the build tree, and pretending they're in the bundle tree. Weird! The module that it's trying to import, space.py, isn't in the build tree. This may be the source of my trouble, as the build-time error was complaining about the bash package which contains space.py, so I'll look into it. Still, everything runs and imports trouble-free in the development environment. Weird! I tried attaching py2app's console output, but it was too big for the mailing list. If you're interested in perusing it, you'll find it at http://eykd.net/pub/py2app-output.txt > I also thought that was fixed (a similar issue was) in the latest macholib > -- did you update that too? I believe so. I have 1.2 installed. > This may be a problem that comes a goes, too -- make sure you delete "build" > and "dist" and try again. Nope. Consistently fails. Thanks for your help in puzzling this out. David From Chris.Barker at noaa.gov Fri Oct 17 22:03:46 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 17 Oct 2008 13:03:46 -0700 Subject: [Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources In-Reply-To: References: <48F78DCF.1030108@noaa.gov> Message-ID: <48F8EFA2.9080009@noaa.gov> David Eyk wrote: > My apologies to Chris Barker--I accidentally took this discussion off > the list, too. A common newbie mistake, it appears? well, I really hate lists configured this way, but it's been debated ad-infinitum, and we'll just have to agree to disagree. > Thanks for your help in puzzling this out. sorry, but I'm out of ideas now -- do do some googling for the: malformed object (unknown load command 8) error, it looks familiar. Also, have you got py2app to work with a really simple, tiny app? That should at least tell you what a working app bundle should look like. -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 eykd at eykd.net Fri Oct 17 23:28:44 2008 From: eykd at eykd.net (David Eyk) Date: Fri, 17 Oct 2008 16:28:44 -0500 Subject: [Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources In-Reply-To: <48F8EFA2.9080009@noaa.gov> References: <48F78DCF.1030108@noaa.gov> <48F8EFA2.9080009@noaa.gov> Message-ID: On Fri, Oct 17, 2008 at 3:03 PM, Christopher Barker wrote: > well, I really hate lists configured this way, but it's been debated > ad-infinitum, and we'll just have to agree to disagree. I've just never run into one before. I just about made the same mistake replying to this. :) > sorry, but I'm out of ideas now -- do do some googling for the: > malformed object (unknown load command 8) That's the first thing I did. :( Nothing I can make sense of--that is, nothing py2app related. > Also, have you got py2app to work with a really simple, tiny app? That > should at least tell you what a working app bundle should look like. That's a good idea. As I may have mentioned, I've used py2app successfully before, with a wxPython app. But that probably doesn't qualify as simple or tiny. :) I'll take a stab at a simple app over the weekend. Thanks. David From saptarshi.guha at gmail.com Sun Oct 19 00:15:45 2008 From: saptarshi.guha at gmail.com (Saptarshi Guha) Date: Sat, 18 Oct 2008 18:15:45 -0400 Subject: [Pythonmac-SIG] Calling a python objc class method from cocoa Message-ID: <8EB24BAD-AC01-416C-B8C3-5A2E64CAE3F9@gmail.com> Hello, I have a mainly cocoa app which uses some Python modules. I need to call a classmethod of a NSObject subclass written in python from Cocoa =Structure= After loading the Python interpreter, i call this method -(void)initialize { Class pySocket = NSClassFromString(@"pySocket"); NSLog(@"%@",pySocket); [pySocket setdefaulttimeout:10]; } pySocket: from Foundation import * import socket class pySocket(NSObject): #no init method right now, only want to run class methods @classmethod def setdefaulttimeout(cls,timeout): socket.setdefaulttimeout(timeout) ==Error== I get the following error: 2008-10-18 17:48:14.227 argnostic[10697:10b] pySocket 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 How then do I call a Python NSObject subclasses classmethods from cocoa? Thank you Saptarshi Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha -------------- next part -------------- An HTML attachment was scrubbed... URL: From listsin at integrateddevcorp.com Sun Oct 19 03:09:28 2008 From: listsin at integrateddevcorp.com (s s) Date: Sat, 18 Oct 2008 21:09:28 -0400 Subject: [Pythonmac-SIG] Calling a python objc class method from cocoa In-Reply-To: <8EB24BAD-AC01-416C-B8C3-5A2E64CAE3F9@gmail.com> References: <8EB24BAD-AC01-416C-B8C3-5A2E64CAE3F9@gmail.com> Message-ID: <20DC7DE8-7E33-4E99-AB02-29E4AE1ABCEA@integrateddevcorp.com> Try using: def setdefaulttimeout_(cls,timeout): Since your method would be setdefaulttimeout: in objc, it's necessary to replace the ':' with an underscore in your Python code. S aka Steve Steiner On Oct 18, 2008, at 6:15 PM, Saptarshi Guha wrote: > Hello, > I have a mainly cocoa app which uses some Python modules. I need to > call a classmethod of a NSObject subclass written in > python from Cocoa > =Structure= > > After loading the Python interpreter, i call this method > > -(void)initialize > { > Class pySocket = NSClassFromString(@"pySocket"); > NSLog(@"%@",pySocket); > [pySocket setdefaulttimeout:10]; > } > > pySocket: > > from Foundation import * > import socket > class pySocket(NSObject): > #no init method right now, only want to run class methods > @classmethod > def setdefaulttimeout(cls,timeout): > socket.setdefaulttimeout(timeout) > > ==Error== > > I get the following error: > 2008-10-18 17:48:14.227 argnostic[10697:10b] pySocket > 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket > setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 > 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket > setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 > > How then do I call a Python NSObject subclasses classmethods from > cocoa? > Thank you > Saptarshi > > > Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig On Oct 18, 2008, at 6:15 PM, Saptarshi Guha wrote: > Hello, > I have a mainly cocoa app which uses some Python modules. I need to > call a classmethod of a NSObject subclass written in > python from Cocoa > =Structure= > > After loading the Python interpreter, i call this method > > -(void)initialize > { > Class pySocket = NSClassFromString(@"pySocket"); > NSLog(@"%@",pySocket); > [pySocket setdefaulttimeout:10]; > } > > pySocket: > > from Foundation import * > import socket > class pySocket(NSObject): > #no init method right now, only want to run class methods > @classmethod > def setdefaulttimeout(cls,timeout): > socket.setdefaulttimeout(timeout) > > ==Error== > > I get the following error: > 2008-10-18 17:48:14.227 argnostic[10697:10b] pySocket > 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket > setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 > 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket > setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 > > How then do I call a Python NSObject subclasses classmethods from > cocoa? > Thank you > Saptarshi > > > Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From saptarshi.guha at gmail.com Sun Oct 19 06:46:15 2008 From: saptarshi.guha at gmail.com (Saptarshi Guha) Date: Sun, 19 Oct 2008 00:46:15 -0400 Subject: [Pythonmac-SIG] Calling a python objc class method from cocoa In-Reply-To: <20DC7DE8-7E33-4E99-AB02-29E4AE1ABCEA@integrateddevcorp.com> References: <8EB24BAD-AC01-416C-B8C3-5A2E64CAE3F9@gmail.com> <20DC7DE8-7E33-4E99-AB02-29E4AE1ABCEA@integrateddevcorp.com> Message-ID: <8E423418-BA1A-494A-BE0E-F27036F06EEF@gmail.com> Hello, 1) I tried your suggestion @classmethod def setdefaulttimeout_(cls,timeout): NSLog("Timeout") and called Class pySocket = NSClassFromString(@"pySocket"); [pySocket setdefaulttimeout:10]; And now I get a " Program received signal: ?EXC_BAD_ACCESS?. and gdb starts (Any information required?) 2)Also if I'm calling PyObjc NSObject subclasses from Objective C - i dont need to add underscores, i think the underscores are only required if called Objective C methods (to get around the ":"), e.g I could add the following instance method def moo(self): NSLog("Moo") Instantiate pySocket in objective-c and call [v moo] (v is a pySocket instance) and this works. However, I cant seem to call the class method. Pyobjc v 2 Regards Saptarshi On Oct 18, 2008, at 9:09 PM, s s wrote: > Try using: > > def setdefaulttimeout_(cls,timeout): > > Since your method would be setdefaulttimeout: in objc, it's > necessary to replace the ':' with an underscore in your Python code. > > S > aka Steve Steiner > > > On Oct 18, 2008, at 6:15 PM, Saptarshi Guha wrote: >> Hello, >> I have a mainly cocoa app which uses some Python modules. I need >> to call a classmethod of a NSObject subclass written in >> python from Cocoa >> =Structure= >> >> After loading the Python interpreter, i call this method >> >> -(void)initialize >> { >> Class pySocket = NSClassFromString(@"pySocket"); >> NSLog(@"%@",pySocket); >> [pySocket setdefaulttimeout:10]; >> } >> >> pySocket: >> >> from Foundation import * >> import socket >> class pySocket(NSObject): >> #no init method right now, only want to run class methods >> @classmethod >> def setdefaulttimeout(cls,timeout): >> socket.setdefaulttimeout(timeout) >> >> ==Error== >> >> I get the following error: >> 2008-10-18 17:48:14.227 argnostic[10697:10b] pySocket >> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >> >> How then do I call a Python NSObject subclasses classmethods from >> cocoa? >> Thank you >> Saptarshi >> >> >> Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > On Oct 18, 2008, at 6:15 PM, Saptarshi Guha wrote: > >> Hello, >> I have a mainly cocoa app which uses some Python modules. I need >> to call a classmethod of a NSObject subclass written in >> python from Cocoa >> =Structure= >> >> After loading the Python interpreter, i call this method >> >> -(void)initialize >> { >> Class pySocket = NSClassFromString(@"pySocket"); >> NSLog(@"%@",pySocket); >> [pySocket setdefaulttimeout:10]; >> } >> >> pySocket: >> >> from Foundation import * >> import socket >> class pySocket(NSObject): >> #no init method right now, only want to run class methods >> @classmethod >> def setdefaulttimeout(cls,timeout): >> socket.setdefaulttimeout(timeout) >> >> ==Error== >> >> I get the following error: >> 2008-10-18 17:48:14.227 argnostic[10697:10b] pySocket >> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >> >> How then do I call a Python NSObject subclasses classmethods from >> cocoa? >> Thank you >> Saptarshi >> >> >> Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha Meade's Maxim: Always remember that you are absolutely unique, just like everyone else. -------------- next part -------------- An HTML attachment was scrubbed... URL: From saptarshi.guha at gmail.com Sun Oct 19 06:56:14 2008 From: saptarshi.guha at gmail.com (Saptarshi Guha) Date: Sun, 19 Oct 2008 00:56:14 -0400 Subject: [Pythonmac-SIG] Calling a python objc class method from cocoa In-Reply-To: <8E423418-BA1A-494A-BE0E-F27036F06EEF@gmail.com> References: <8EB24BAD-AC01-416C-B8C3-5A2E64CAE3F9@gmail.com> <20DC7DE8-7E33-4E99-AB02-29E4AE1ABCEA@integrateddevcorp.com> <8E423418-BA1A-494A-BE0E-F27036F06EEF@gmail.com> Message-ID: Hello, My apologies, please forget the point numbered (2). My embarrassing bad. regards Saptarshi > > > 2)Also if I'm calling PyObjc NSObject subclasses from Objective C - > i dont need to add underscores, i think the underscores are > only required if called Objective C methods (to get around the ":"), > e.g I could add the following instance method > def moo(self): > NSLog("Moo") > Instantiate pySocket in objective-c and call [v moo] (v is a > pySocket instance) and this works. > > However, I cant seem to call the class method. > > Pyobjc v 2 > Regards > Saptarshi > > On Oct 18, 2008, at 9:09 PM, s s wrote: > >> Try using: >> >> def setdefaulttimeout_(cls,timeout): >> >> Since your method would be setdefaulttimeout: in objc, it's >> necessary to replace the ':' with an underscore in your Python code. >> >> S >> aka Steve Steiner >> >> >> On Oct 18, 2008, at 6:15 PM, Saptarshi Guha wrote: >>> Hello, >>> I have a mainly cocoa app which uses some Python modules. I need >>> to call a classmethod of a NSObject subclass written in >>> python from Cocoa >>> =Structure= >>> >>> After loading the Python interpreter, i call this method >>> >>> -(void)initialize >>> { >>> Class pySocket = NSClassFromString(@"pySocket"); >>> NSLog(@"%@",pySocket); >>> [pySocket setdefaulttimeout:10]; >>> } >>> >>> pySocket: >>> >>> from Foundation import * >>> import socket >>> class pySocket(NSObject): >>> #no init method right now, only want to run class methods >>> @classmethod >>> def setdefaulttimeout(cls,timeout): >>> socket.setdefaulttimeout(timeout) >>> >>> ==Error== >>> >>> I get the following error: >>> 2008-10-18 17:48:14.227 argnostic[10697:10b] pySocket >>> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >>> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >>> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >>> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >>> >>> How then do I call a Python NSObject subclasses classmethods from >>> cocoa? >>> Thank you >>> Saptarshi >>> >>> >>> Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> On Oct 18, 2008, at 6:15 PM, Saptarshi Guha wrote: >> >>> Hello, >>> I have a mainly cocoa app which uses some Python modules. I need >>> to call a classmethod of a NSObject subclass written in >>> python from Cocoa >>> =Structure= >>> >>> After loading the Python interpreter, i call this method >>> >>> -(void)initialize >>> { >>> Class pySocket = NSClassFromString(@"pySocket"); >>> NSLog(@"%@",pySocket); >>> [pySocket setdefaulttimeout:10]; >>> } >>> >>> pySocket: >>> >>> from Foundation import * >>> import socket >>> class pySocket(NSObject): >>> #no init method right now, only want to run class methods >>> @classmethod >>> def setdefaulttimeout(cls,timeout): >>> socket.setdefaulttimeout(timeout) >>> >>> ==Error== >>> >>> I get the following error: >>> 2008-10-18 17:48:14.227 argnostic[10697:10b] pySocket >>> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >>> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >>> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >>> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >>> >>> How then do I call a Python NSObject subclasses classmethods from >>> cocoa? >>> Thank you >>> Saptarshi >>> >>> >>> Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >> > > Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha > Meade's Maxim: > Always remember that you are absolutely unique, > just like everyone else. > Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha Timing must be perfect now. Two-timing must be better than perfect. -------------- next part -------------- An HTML attachment was scrubbed... URL: From saptarshi.guha at gmail.com Sun Oct 19 07:05:21 2008 From: saptarshi.guha at gmail.com (Saptarshi Guha) Date: Sun, 19 Oct 2008 01:05:21 -0400 Subject: [Pythonmac-SIG] Calling a python objc class method from cocoa In-Reply-To: <20DC7DE8-7E33-4E99-AB02-29E4AE1ABCEA@integrateddevcorp.com> References: <8EB24BAD-AC01-416C-B8C3-5A2E64CAE3F9@gmail.com> <20DC7DE8-7E33-4E99-AB02-29E4AE1ABCEA@integrateddevcorp.com> Message-ID: Thank you! I got it. I can;t send numbers to the python method. I have to send NSObjects. Got it. Thanks Regards Saptarshi On Oct 18, 2008, at 9:09 PM, s s wrote: > Try using: > > def setdefaulttimeout_(cls,timeout): > > Since your method would be setdefaulttimeout: in objc, it's > necessary to replace the ':' with an underscore in your Python code. > > S > aka Steve Steiner > > > On Oct 18, 2008, at 6:15 PM, Saptarshi Guha wrote: >> Hello, >> I have a mainly cocoa app which uses some Python modules. I need >> to call a classmethod of a NSObject subclass written in >> python from Cocoa >> =Structure= >> >> After loading the Python interpreter, i call this method >> >> -(void)initialize >> { >> Class pySocket = NSClassFromString(@"pySocket"); >> NSLog(@"%@",pySocket); >> [pySocket setdefaulttimeout:10]; >> } >> >> pySocket: >> >> from Foundation import * >> import socket >> class pySocket(NSObject): >> #no init method right now, only want to run class methods >> @classmethod >> def setdefaulttimeout(cls,timeout): >> socket.setdefaulttimeout(timeout) >> >> ==Error== >> >> I get the following error: >> 2008-10-18 17:48:14.227 argnostic[10697:10b] pySocket >> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >> >> How then do I call a Python NSObject subclasses classmethods from >> cocoa? >> Thank you >> Saptarshi >> >> >> Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > On Oct 18, 2008, at 6:15 PM, Saptarshi Guha wrote: > >> Hello, >> I have a mainly cocoa app which uses some Python modules. I need >> to call a classmethod of a NSObject subclass written in >> python from Cocoa >> =Structure= >> >> After loading the Python interpreter, i call this method >> >> -(void)initialize >> { >> Class pySocket = NSClassFromString(@"pySocket"); >> NSLog(@"%@",pySocket); >> [pySocket setdefaulttimeout:10]; >> } >> >> pySocket: >> >> from Foundation import * >> import socket >> class pySocket(NSObject): >> #no init method right now, only want to run class methods >> @classmethod >> def setdefaulttimeout(cls,timeout): >> socket.setdefaulttimeout(timeout) >> >> ==Error== >> >> I get the following error: >> 2008-10-18 17:48:14.227 argnostic[10697:10b] pySocket >> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >> 2008-10-18 17:48:14.228 argnostic[10697:10b] *** +[pySocket >> setdefaulttimeout:]: unrecognized selector sent to class 0x3b33d0 >> >> How then do I call a Python NSObject subclasses classmethods from >> cocoa? >> Thank you >> Saptarshi >> >> >> Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > Saptarshi Guha | saptarshi.guha at gmail.com | http://www.stat.purdue.edu/~sguha Underlying Principle of Socio-Genetics: Superiority is recessive. -------------- next part -------------- An HTML attachment was scrubbed... URL: From idan at pixane.net Sun Oct 19 19:40:14 2008 From: idan at pixane.net (Idan Gazit) Date: Sun, 19 Oct 2008 19:40:14 +0200 Subject: [Pythonmac-SIG] Symlinks? Newbie / macpython alongside leopard python Message-ID: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> Hi Folks, Now that 2.6 is released, I wanted to install it on my local machine. What I'm having trouble wrapping my head around is how to make sure that macpython 2.6 doesn't break anything involving leopard python. If I want macpython / 2.6 to be the default python interpreter -- what is the best route? I can think of the two following ways: 1. Change $PATH so that /usr/local/bin precedes /usr/bin 2. Symlink /usr/bin/python to /usr/local/bin/python or to /Library/ Frameworks/Python.framework/Versions/2.6/bin/python What's the "best practice" here? Should I just get used to invoking python as python2.6? Is there another way? -Idan From kw at codebykevin.com Sun Oct 19 19:48:08 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Sun, 19 Oct 2008 13:48:08 -0400 Subject: [Pythonmac-SIG] Symlinks? Newbie / macpython alongside leopard python In-Reply-To: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> References: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> Message-ID: <48FB72D8.9030308@codebykevin.com> Idan Gazit wrote: > Hi Folks, > > Now that 2.6 is released, I wanted to install it on my local machine. > What I'm having trouble wrapping my head around is how to make sure that > macpython 2.6 doesn't break anything involving leopard python. > > If I want macpython / 2.6 to be the default python interpreter -- what > is the best route? I can think of the two following ways: > > 1. Change $PATH so that /usr/local/bin precedes /usr/bin > > 2. Symlink /usr/bin/python to /usr/local/bin/python or to > /Library/Frameworks/Python.framework/Versions/2.6/bin/python > > What's the "best practice" here? Should I just get used to invoking > python as python2.6? Is there another way? > > -Idan > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > The installer will modify your path settings so that MacPython comes up before the version shipped by Apple. However, the current Mac build of Python 2.5 is broken if you need to run Tkinter apps such as IDLE: http://bugs.python.org/issue4017 I don't recommend installing it--build it yourself from source. (See the bug report for some instructions on how to work around the difficulties the current build runs into.) Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From pythonmac at rebertia.com Sun Oct 19 20:00:16 2008 From: pythonmac at rebertia.com (Chris Rebert) Date: Sun, 19 Oct 2008 11:00:16 -0700 Subject: [Pythonmac-SIG] Symlinks? Newbie / macpython alongside leopard python In-Reply-To: <48FB72D8.9030308@codebykevin.com> References: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> <48FB72D8.9030308@codebykevin.com> Message-ID: <47c890dc0810191100x76081c84ic1ef124999f97a21@mail.gmail.com> On Sun, Oct 19, 2008 at 10:48 AM, Kevin Walzer wrote: > Idan Gazit wrote: >> >> Hi Folks, >> >> Now that 2.6 is released, I wanted to install it on my local machine. What >> I'm having trouble wrapping my head around is how to make sure that >> macpython 2.6 doesn't break anything involving leopard python. >> >> If I want macpython / 2.6 to be the default python interpreter -- what is >> the best route? I can think of the two following ways: >> >> 1. Change $PATH so that /usr/local/bin precedes /usr/bin >> >> 2. Symlink /usr/bin/python to /usr/local/bin/python or to >> /Library/Frameworks/Python.framework/Versions/2.6/bin/python >> >> What's the "best practice" here? Should I just get used to invoking python >> as python2.6? Is there another way? >> >> -Idan >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > The installer will modify your path settings so that MacPython comes up > before the version shipped by Apple. However, the current Mac build of > Python 2.5 is broken if you need to run Tkinter apps such as IDLE: > > http://bugs.python.org/issue4017 > > I don't recommend installing it--build it yourself from source. (See the bug > report for some instructions on how to work around the difficulties the > current build runs into.) I believe the Fink package for Python 2.5 also handles the paths correctly and I can confirm that it works with IDLE. Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com > > Kevin > > -- > 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 > From idan at pixane.net Sun Oct 19 20:08:22 2008 From: idan at pixane.net (Idan Gazit) Date: Sun, 19 Oct 2008 20:08:22 +0200 Subject: [Pythonmac-SIG] Symlinks? Newbie / macpython alongside leopard python In-Reply-To: <48FB72D8.9030308@codebykevin.com> References: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> <48FB72D8.9030308@codebykevin.com> Message-ID: On Oct 19, 2008, at 7:48 PM, Kevin Walzer wrote: > The installer will modify your path settings so that MacPython comes > up before the version shipped by Apple. However, the current Mac > build of Python 2.5 is broken if you need to run Tkinter apps such > as IDLE: Hm, Dunno why, but it certainly isn't the case, even after quitting out of / relaunching terminal. I don't see anything in /etc/paths or /etc/ paths.d different, nor is there any change to ~/.MacOSX/ environment.plist, nor is there any change to ~/.profile -- so if something is happening, I'm not seeing it. Perhaps a reboot? Will try and report success/failure. Thanks for the help, -Idan From kw at codebykevin.com Sun Oct 19 20:12:20 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Sun, 19 Oct 2008 14:12:20 -0400 Subject: [Pythonmac-SIG] Symlinks? Newbie / macpython alongside leopard python In-Reply-To: References: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> <48FB72D8.9030308@codebykevin.com> Message-ID: <48FB7884.5010703@codebykevin.com> Idan Gazit wrote: > On Oct 19, 2008, at 7:48 PM, Kevin Walzer wrote: > >> The installer will modify your path settings so that MacPython comes >> up before the version shipped by Apple. However, the current Mac build >> of Python 2.5 is broken if you need to run Tkinter apps such as IDLE: > > Hm, > > Dunno why, but it certainly isn't the case, even after quitting out of / > relaunching terminal. I don't see anything in /etc/paths or /etc/paths.d > different, nor is there any change to ~/.MacOSX/environment.plist, nor > is there any change to ~/.profile -- so if something is happening, I'm > not seeing it. Perhaps a reboot? Will try and report success/failure. > > Thanks for the help, > > -Idan > > What does "echo $PATH" show in Terminal? In my case it shows something like this: /Library/Frameworks/Python.framework/Versions/Current/bin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/bin:/ The installer script for 2.4 added these bits to my ~/.profile: # Setting PATH for MacPython 2.4 # The orginal version is saved in .profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" export PATH Not sure if 2.6 does the same, but I thought it did. It certainly doesn't touch /etc/paths.d, nor should it. ~/.MacOSX/environment.plist isn't affected either as far as I know. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From idan at pixane.net Sun Oct 19 20:24:32 2008 From: idan at pixane.net (Idan Gazit) Date: Sun, 19 Oct 2008 20:24:32 +0200 Subject: [Pythonmac-SIG] Symlinks? Newbie / macpython alongside leopard python In-Reply-To: <48FB7884.5010703@codebykevin.com> References: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> <48FB72D8.9030308@codebykevin.com> <48FB7884.5010703@codebykevin.com> Message-ID: <428E1537-EE80-4251-9E1E-A4AABB81671F@pixane.net> On Oct 19, 2008, at 8:12 PM, Kevin Walzer wrote: > > What does "echo $PATH" show in Terminal? In my case it shows > something like this: > > /Library/Frameworks/Python.framework/Versions/Current/bin:/sw/bin:/ > sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/ > usr/local/bin:/ > Nope, certainly nothing about python added by the installer. I re-ran it and made sure ("customize") that all the options were checked, but the installer didn't touch my .profile or .bash_profile at all. /usr/local/git/bin:/Users/idan/projects/aws/ec2/bin:/usr/bin:/bin:/usr/ sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin I'd like to make sure I have my system setup OK so I don't waste a few days down the road on Mysterious Voodoo Issues -- I can just go ahead and put macpython's /Library/Frameworks/..blahblah.. at the top of my path. Is there anything else I need to do that's "supposed" to be handled by the installer script? -Idan From idan at pixane.net Sun Oct 19 20:29:42 2008 From: idan at pixane.net (Idan Gazit) Date: Sun, 19 Oct 2008 20:29:42 +0200 Subject: [Pythonmac-SIG] Symlinks? Newbie / macpython alongside leopard python In-Reply-To: <48FB7884.5010703@codebykevin.com> References: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> <48FB72D8.9030308@codebykevin.com> <48FB7884.5010703@codebykevin.com> Message-ID: On Oct 19, 2008, at 8:12 PM, Kevin Walzer wrote: > > Not sure if 2.6 does the same, but I thought it did. It certainly > doesn't touch /etc/paths.d, nor should it. ~/.MacOSX/ > environment.plist isn't affected either as far as I know. A little bit of rooting around inside the installer packages / subpackages shows two postflight scripts, one in PythonFramework and one in PythonSystemFixes. Neither one of them seems to take any action regarding the path at all. That being said my understanding of installer packages is roughly zero. If I could be clued into where these post-install scripts are supposed to be I can attempt some detective-work on my own. Thanks, Idan From kw at codebykevin.com Sun Oct 19 21:45:44 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Sun, 19 Oct 2008 15:45:44 -0400 Subject: [Pythonmac-SIG] Symlinks? Newbie / macpython alongside leopard python In-Reply-To: References: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> <48FB72D8.9030308@codebykevin.com> <48FB7884.5010703@codebykevin.com> Message-ID: <48FB8E68.5050606@codebykevin.com> Idan Gazit wrote: > On Oct 19, 2008, at 8:12 PM, Kevin Walzer wrote: >> >> Not sure if 2.6 does the same, but I thought it did. It certainly >> doesn't touch /etc/paths.d, nor should it. ~/.MacOSX/environment.plist >> isn't affected either as far as I know. > > A little bit of rooting around inside the installer packages / > subpackages shows two postflight scripts, one in PythonFramework and one > in PythonSystemFixes. Neither one of them seems to take any action > regarding the path at all. > > That being said my understanding of installer packages is roughly zero. > If I could be clued into where these post-install scripts are supposed > to be I can attempt some detective-work on my own. > > Thanks, > > Idan > > Not sure what the problem is. As I said before, if the installer no longer modifies your $PATH, then something has changed in the installation process over the past year or so. Can any of the Python maintainers on the Mac shed some light on this? Ronald, any ideas? Or is someone else putting together the official python.org build? In any event, it is seriously broken, and I hope that someone puts together a new build in the near future. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From Chris.Barker at noaa.gov Mon Oct 20 01:28:57 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sun, 19 Oct 2008 16:28:57 -0700 Subject: [Pythonmac-SIG] Symlinks? Newbie / macpython alongside leopard python In-Reply-To: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> References: <9795A2BB-6009-4257-B71B-4A026CE62B36@pixane.net> Message-ID: <48FBC2B9.5040202@noaa.gov> Idan Gazit wrote: > If I want macpython / 2.6 to be the default python interpreter -- what > is the best route? I can think of the two following ways: > > 1. Change $PATH so that /usr/local/bin precedes /usr/bin > > 2. Symlink /usr/bin/python to /usr/local/bin/python or to > /Library/Frameworks/Python.framework/Versions/2.6/bin/python > > What's the "best practice" here? change $PATH - DO NOT mess with /usr/bin at all. If the installer isn't doing it for you (I think it did for me), then do it by hand. Note that I think my PATH may have been set to: /Library/Frameworks/Python.framework/Versions/current/bin/python and the installer changed the "current" link. I actually changed that link back to 2.5, as there are too many modules that don't yet work with 2.6, so I consider it experimental. I'm at home an Mac-less right now, so I may have a detail wrong.... -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception From amos at latteier.com Mon Oct 20 01:42:55 2008 From: amos at latteier.com (Amos Latteier) Date: Sun, 19 Oct 2008 19:42:55 -0400 Subject: [Pythonmac-SIG] easy_install broken on new macbook (includes solution) In-Reply-To: <6bcfeef70810191122x4b4386dfq4d5ee99bb800eb9b@mail.gmail.com> References: <6bcfeef70810191122x4b4386dfq4d5ee99bb800eb9b@mail.gmail.com> Message-ID: <6bcfeef70810191642q4730b26dg9af55b28f1fe070b@mail.gmail.com> Hi, I just got a new aluminum macbook. It's great expect that it seems to ship with a broken easy_install. I tracked down the problem and submitted a bug to apple (bug #6302565). I'm sending the details to this mailing list in hopes that it can help others, or perhaps others can point out a better solution. -Amos The easy_install python command line tool fails to install python package that include c extensions on my new macbook. Here's how to reproduce the problem: $ easy_install simple_json You will get an error message that ends with an error message like this: No eggs found in /var/folders/Bb/BbkWGUJ4FGe9coHkryLH4U+++TI/-Tmp-/easy_install 3CNYn-/simplejson-2.0.3/egg-dist-tmp-EOUkj5 (setup script problem?) error: Could not find required distribution simplejson You don't have to use simple_json, any python package with c extensions will trigger the problem. The problem is that the apple-specific version of pkg_resources.py (in /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python) shipped with the new macbooks changes the macos version number (line 165): def _macosx_vers(_cache=[]): if not _cache: # don't call sw_vers because that causes a SIGTRAP in gdb _cache = [['10.5', '1']] return _cache[0] Previously the version was 10.5, not 10.5.1. This change is a problem because the regular expression that checks version numbers (on line 194) doesn't work with it. macosVersionString = re.compile(r"macosx-(\d+)\.(\d+)(.*)") One solution is to change the regular expression to something like the following: macosVersionString = re.compile(r"macosx-(\d+)\.(\d+).*?-(.*)") I have verified that this fix solves the problem for me. From bob at redivi.com Mon Oct 20 01:50:10 2008 From: bob at redivi.com (Bob Ippolito) Date: Sun, 19 Oct 2008 16:50:10 -0700 Subject: [Pythonmac-SIG] easy_install broken on new macbook (includes solution) In-Reply-To: <6bcfeef70810191642q4730b26dg9af55b28f1fe070b@mail.gmail.com> References: <6bcfeef70810191122x4b4386dfq4d5ee99bb800eb9b@mail.gmail.com> <6bcfeef70810191642q4730b26dg9af55b28f1fe070b@mail.gmail.com> Message-ID: <6a36e7290810191650i11c885dco2f38e05616058d1b@mail.gmail.com> I dunno about the bug, but simple_json is not what you should be installing... The package name is simplejson. -bob On Sun, Oct 19, 2008 at 4:42 PM, Amos Latteier wrote: > Hi, > > I just got a new aluminum macbook. It's great expect that it seems to > ship with a broken easy_install. I tracked down the problem and > submitted a bug to apple (bug #6302565). I'm sending the details > to this mailing list in hopes that it can help others, or perhaps others > can point out a better solution. > > -Amos > > The easy_install python command line tool fails to install python > package that include c extensions on my new macbook. > > Here's how to reproduce the problem: > > $ easy_install simple_json > > You will get an error message that ends with an error message like this: > > No eggs found in > /var/folders/Bb/BbkWGUJ4FGe9coHkryLH4U+++TI/-Tmp-/easy_install > 3CNYn-/simplejson-2.0.3/egg-dist-tmp-EOUkj5 (setup script problem?) > error: Could not find required distribution simplejson > > You don't have to use simple_json, any python package with c > extensions will trigger the problem. > > The problem is that the apple-specific version of pkg_resources.py (in > /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python) > shipped with the new macbooks changes the macos version number (line > 165): > > def _macosx_vers(_cache=[]): > if not _cache: > # don't call sw_vers because that causes a SIGTRAP in gdb > _cache = [['10.5', '1']] > return _cache[0] > > Previously the version was 10.5, not 10.5.1. This change is a problem > because the regular expression that checks version numbers (on line > 194) doesn't work with it. > > macosVersionString = re.compile(r"macosx-(\d+)\.(\d+)(.*)") > > One solution is to change the regular expression to something like the > following: > > macosVersionString = re.compile(r"macosx-(\d+)\.(\d+).*?-(.*)") > > I have verified that this fix solves the problem for me. > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From amos at latteier.com Mon Oct 20 02:08:37 2008 From: amos at latteier.com (Amos Latteier) Date: Sun, 19 Oct 2008 20:08:37 -0400 Subject: [Pythonmac-SIG] easy_install broken on new macbook (includes solution) In-Reply-To: <6a36e7290810191650i11c885dco2f38e05616058d1b@mail.gmail.com> References: <6bcfeef70810191122x4b4386dfq4d5ee99bb800eb9b@mail.gmail.com> <6bcfeef70810191642q4730b26dg9af55b28f1fe070b@mail.gmail.com> <6a36e7290810191650i11c885dco2f38e05616058d1b@mail.gmail.com> Message-ID: <6bcfeef70810191708k3917bfcdl9016b734017720ac@mail.gmail.com> > I dunno about the bug, but simple_json is not what you should be > installing... The package name is simplejson. Thanks for pointing out the typo. I updated my bug report. However, this doesn't resolve the problem. In fact I ran into the problem originally using zc.buildout, building PIL and pycurl. I picked easy_install and simplejson and a simpler way to reproduce the bug. One more thing: my fix assumes that 10.5.1 is compatible with 10.5 for the purposes of python packages. I think that this is the case, but I'm not positive. Also the fact that they've changed pkg_resources to use 10.5.1 implies to me that perhaps there will be a 10.5.2 or something like that. I'm not sure what version of the OS this would represent (since these numbers don't seem to correspond to normal OS identifiers) or whether it should be considered compatible. Anyway I hope that this information may be helpful to others. -Amos From dwf at cs.toronto.edu Mon Oct 20 09:47:26 2008 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Mon, 20 Oct 2008 03:47:26 -0400 Subject: [Pythonmac-SIG] Anyone have 10.5.5 on a G5? In-Reply-To: <7ED7C523-5ADD-475B-834A-2470854ED573@virgin.net> References: <7ED7C523-5ADD-475B-834A-2470854ED573@virgin.net> Message-ID: <718513D7-9BD5-453A-AAF9-51508DA9524E@cs.toronto.edu> On 17-Oct-08, at 1:34 PM, has wrote: > Hi folks, > > Trying to get py-appscript 0.19.0 out the door, but I've a user > reporting big problems trying to install it on their system and need > to find out if it's their system or appscript that's at fault. > > Need a quick favour from someone with a copy of 10.5.5 on a G5: > would you mind grabbing a copy of the latest py-appscript trunk (rev > 589) from svn and seeing if builds and installs correctly via > easy_install? > > Something like: > > svn checkout http://appscript.svn.sourceforge.net/svnroot/appscript/py-appscript/trunk > py-appscript-0.19.0 > easy_install --verbose appscript-0.19.0 > > (If you're not familiar with Subversion, drop me an email and I can > send a .tar.gz.) Hi Has, I just happened to have a fresh install of 10.5.5 on a G5 I have access to, convenient! Looks like it worked for me: dwf at morrislab:~$ easy_install --verbose py-appscript-0.19.0 Processing py-appscript-0.19.0 Running setup.py bdist_egg --dist-dir /Users/dwf/py-appscript-0.19.0/ egg-dist-tmp-mivUiG running bdist_egg running egg_info creating lib/appscript.egg-info writing lib/appscript.egg-info/PKG-INFO writing top-level names to lib/appscript.egg-info/top_level.txt writing dependency_links to lib/appscript.egg-info/dependency_links.txt writing manifest file 'lib/appscript.egg-info/SOURCES.txt' writing manifest file 'lib/appscript.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.3-fat/egg running install_lib running build_py creating build creating build/lib.macosx-10.3-fat-2.5 copying lib/mactypes.py -> build/lib.macosx-10.3-fat-2.5 copying lib/osax.py -> build/lib.macosx-10.3-fat-2.5 creating build/lib.macosx-10.3-fat-2.5/CarbonX copying lib/CarbonX/__init__.py -> build/lib.macosx-10.3-fat-2.5/CarbonX copying lib/CarbonX/AE.py -> build/lib.macosx-10.3-fat-2.5/CarbonX copying lib/CarbonX/kAE.py -> build/lib.macosx-10.3-fat-2.5/CarbonX copying lib/CarbonX/kOSA.py -> build/lib.macosx-10.3-fat-2.5/CarbonX creating build/lib.macosx-10.3-fat-2.5/aem copying lib/aem/__init__.py -> build/lib.macosx-10.3-fat-2.5/aem copying lib/aem/aemcodecs.py -> build/lib.macosx-10.3-fat-2.5/aem copying lib/aem/aemconnect.py -> build/lib.macosx-10.3-fat-2.5/aem copying lib/aem/aemreference.py -> build/lib.macosx-10.3-fat-2.5/aem copying lib/aem/aemsend.py -> build/lib.macosx-10.3-fat-2.5/aem copying lib/aem/findapp.py -> build/lib.macosx-10.3-fat-2.5/aem copying lib/aem/kae.py -> build/lib.macosx-10.3-fat-2.5/aem copying lib/aem/mactypes.py -> build/lib.macosx-10.3-fat-2.5/aem copying lib/aem/typewrappers.py -> build/lib.macosx-10.3-fat-2.5/aem creating build/lib.macosx-10.3-fat-2.5/appscript copying lib/appscript/__init__.py -> build/lib.macosx-10.3-fat-2.5/ appscript copying lib/appscript/defaultterminology.py -> build/lib.macosx-10.3- fat-2.5/appscript copying lib/appscript/genericreference.py -> build/lib.macosx-10.3- fat-2.5/appscript copying lib/appscript/keywordwrapper.py -> build/lib.macosx-10.3- fat-2.5/appscript copying lib/appscript/reference.py -> build/lib.macosx-10.3-fat-2.5/ appscript copying lib/appscript/referencerenderer.py -> build/lib.macosx-10.3- fat-2.5/appscript copying lib/appscript/reservedkeywords.py -> build/lib.macosx-10.3- fat-2.5/appscript copying lib/appscript/terminology.py -> build/lib.macosx-10.3-fat-2.5/ appscript copying lib/appscript/terminologyparser.py -> build/lib.macosx-10.3- fat-2.5/appscript running build_ext building 'aem.ae' extension creating build/temp.macosx-10.3-fat-2.5 creating build/temp.macosx-10.3-fat-2.5/ext gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd - fno-common -dynamic -DNDEBUG -g -O3 -I/Library/Frameworks/ Python.framework/Versions/2.5/include/python2.5 -c ext/ae.c -o build/ temp.macosx-10.3-fat-2.5/ext/ae.o - DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_3 gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g - bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/ext/ ae.o -o build/lib.macosx-10.3-fat-2.5/aem/ae.so -framework CoreFoundation -framework ApplicationServices -framework Carbon creating build/bdist.macosx-10.3-fat creating build/bdist.macosx-10.3-fat/egg creating build/bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/__init__.py -> build/ bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/ae.so -> build/ bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/aemcodecs.py -> build/ bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/aemconnect.py -> build/ bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/aemreference.py -> build/ bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/aemsend.py -> build/ bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/findapp.py -> build/ bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/kae.py -> build/ bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/mactypes.py -> build/ bdist.macosx-10.3-fat/egg/aem copying build/lib.macosx-10.3-fat-2.5/aem/typewrappers.py -> build/ bdist.macosx-10.3-fat/egg/aem creating build/bdist.macosx-10.3-fat/egg/appscript copying build/lib.macosx-10.3-fat-2.5/appscript/__init__.py -> build/ bdist.macosx-10.3-fat/egg/appscript copying build/lib.macosx-10.3-fat-2.5/appscript/defaultterminology.py - > build/bdist.macosx-10.3-fat/egg/appscript copying build/lib.macosx-10.3-fat-2.5/appscript/genericreference.py -> build/bdist.macosx-10.3-fat/egg/appscript copying build/lib.macosx-10.3-fat-2.5/appscript/keywordwrapper.py -> build/bdist.macosx-10.3-fat/egg/appscript copying build/lib.macosx-10.3-fat-2.5/appscript/reference.py -> build/ bdist.macosx-10.3-fat/egg/appscript copying build/lib.macosx-10.3-fat-2.5/appscript/referencerenderer.py - > build/bdist.macosx-10.3-fat/egg/appscript copying build/lib.macosx-10.3-fat-2.5/appscript/reservedkeywords.py -> build/bdist.macosx-10.3-fat/egg/appscript copying build/lib.macosx-10.3-fat-2.5/appscript/terminology.py -> build/bdist.macosx-10.3-fat/egg/appscript copying build/lib.macosx-10.3-fat-2.5/appscript/terminologyparser.py - > build/bdist.macosx-10.3-fat/egg/appscript creating build/bdist.macosx-10.3-fat/egg/CarbonX copying build/lib.macosx-10.3-fat-2.5/CarbonX/__init__.py -> build/ bdist.macosx-10.3-fat/egg/CarbonX copying build/lib.macosx-10.3-fat-2.5/CarbonX/AE.py -> build/ bdist.macosx-10.3-fat/egg/CarbonX copying build/lib.macosx-10.3-fat-2.5/CarbonX/kAE.py -> build/ bdist.macosx-10.3-fat/egg/CarbonX copying build/lib.macosx-10.3-fat-2.5/CarbonX/kOSA.py -> build/ bdist.macosx-10.3-fat/egg/CarbonX copying build/lib.macosx-10.3-fat-2.5/mactypes.py -> build/ bdist.macosx-10.3-fat/egg copying build/lib.macosx-10.3-fat-2.5/osax.py -> build/ bdist.macosx-10.3-fat/egg byte-compiling build/bdist.macosx-10.3-fat/egg/aem/__init__.py to __init__.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/aem/aemcodecs.py to aemcodecs.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/aem/aemconnect.py to aemconnect.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/aem/aemreference.py to aemreference.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/aem/aemsend.py to aemsend.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/aem/findapp.py to findapp.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/aem/kae.py to kae.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/aem/mactypes.py to mactypes.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/aem/typewrappers.py to typewrappers.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/appscript/__init__.py to __init__.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/appscript/ defaultterminology.py to defaultterminology.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/appscript/ genericreference.py to genericreference.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/appscript/ keywordwrapper.py to keywordwrapper.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/appscript/reference.py to reference.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/appscript/ referencerenderer.py to referencerenderer.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/appscript/ reservedkeywords.py to reservedkeywords.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/appscript/ terminology.py to terminology.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/appscript/ terminologyparser.py to terminologyparser.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/CarbonX/__init__.py to __init__.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/CarbonX/AE.py to AE.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/CarbonX/kAE.py to kAE.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/CarbonX/kOSA.py to kOSA.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/mactypes.py to mactypes.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/osax.py to osax.pyc creating stub loader for aem/ae.so byte-compiling build/bdist.macosx-10.3-fat/egg/aem/ae.py to ae.pyc creating build/bdist.macosx-10.3-fat/egg/EGG-INFO writing lib/appscript.egg-info/native_libs.txt copying lib/appscript.egg-info/PKG-INFO -> build/bdist.macosx-10.3-fat/ egg/EGG-INFO copying lib/appscript.egg-info/SOURCES.txt -> build/bdist.macosx-10.3- fat/egg/EGG-INFO copying lib/appscript.egg-info/dependency_links.txt -> build/ bdist.macosx-10.3-fat/egg/EGG-INFO copying lib/appscript.egg-info/top_level.txt -> build/ bdist.macosx-10.3-fat/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... creating '/Users/dwf/py-appscript-0.19.0/egg-dist-tmp-mivUiG/ appscript-0.19.0-py2.5-macosx-10.3-fat.egg' and adding 'build/ bdist.macosx-10.3-fat/egg' to it removing 'build/bdist.macosx-10.3-fat/egg' (and everything under it) Moving appscript-0.19.0-py2.5-macosx-10.3-fat.egg to /Library/ Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages Adding appscript 0.19.0 to easy-install.pth file Saving /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ site-packages/easy-install.pth Installed /Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/appscript-0.19.0-py2.5-macosx-10.3-fat.egg Processing dependencies for appscript==0.19.0 Finished processing dependencies for appscript==0.19.0 From joe at strout.net Mon Oct 20 23:46:39 2008 From: joe at strout.net (Joe Strout) Date: Mon, 20 Oct 2008 15:46:39 -0600 Subject: [Pythonmac-SIG] IDE that doesn't look awful? Message-ID: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> Hi all, I'd heard good things about Wing IDE (including that it was written with wxPython, and I know that wxPython can make decent Mac apps with a bit of care). So I downloaded the disk image today, and man -- is it ever ugly! It's really not a Mac app at all, but an X-Window app, with all the usual cruft that brings. Even XCode is better than that. I know I shouldn't care, but... somehow, I do. Is there any Python IDE that looks and feels more like a proper Mac app? Thanks, - Joe From kw at codebykevin.com Mon Oct 20 23:59:30 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Mon, 20 Oct 2008 17:59:30 -0400 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> Message-ID: <48FCFF42.6010804@codebykevin.com> Joe Strout wrote: > Hi all, > > I'd heard good things about Wing IDE (including that it was written with > wxPython, and I know that wxPython can make decent Mac apps with a bit > of care). So I downloaded the disk image today, and man -- is it ever > ugly! It's really not a Mac app at all, but an X-Window app, with all > the usual cruft that brings. Even XCode is better than that. I know I > shouldn't care, but... somehow, I do. > > Is there any Python IDE that looks and feels more like a proper Mac app? > > Thanks, > - Joe > Joe, WingIDE is written using PyGtk, not wxPython. So yeah, it's an ugly X11 app. There are lots of Python-aware editors out there (i.e. with syntax awareness) but nothing as slick as Xcode is for Cocoa development, and certainly nothing else with an integrated GUI builder (unless you are writing a PyObjC app, in which case Xcode is probably your best bet). Komodo is a fairly robust editor and has both free and commercial editions; it's built on Mozilla, so doesn't look perfectly native, but it is better than WingIDE. A lot of folks on this list swear by Vim or Emacs (Aquamacs is a very nice Emacs variant optimized for Mac UI conventions). I actually just use plain old IDLE. It's had some basic Mac UI adaptations, and works nicely for me. But then, I use Tk/Tkinter as my GUI toolkit, so I actually prefer to use a Tk-based app as a reference point (for both good and bad aspects). --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From Chris.Barker at noaa.gov Tue Oct 21 00:09:58 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 20 Oct 2008 15:09:58 -0700 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> Message-ID: <48FD01B6.8070501@noaa.gov> Joe Strout wrote: > I'd heard good things about Wing IDE (including that it was written with > wxPython, I think it was written with pyGTK, actually, which explains why it's an X app, and why it's "awful" on a Mac. > Is there any Python IDE that looks and feels more like a proper Mac app? Komodo isn't to bad. There are a slew of wxPython based editors/IDEs. Not all of them are well-tested on the Mac, but most work OK. Editra comes with wxPython and is pretty mac friendly. I'm using Peppy, which is still missing a few key features, and is little-tested on the Mac, but it has a few core features/structure that I think are key -- so I'm hoping it will get more mature, and that I'll be able to contribute more to it some day. SPE is pretty feature-full. ScrIDE has been buggy in the past, but I haven't looked at it ages. A lot of folks like TextMate. You may find more ideas here: http://wiki.python.org/moin/PythonEditors -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 joe at strout.net Tue Oct 21 00:11:01 2008 From: joe at strout.net (Joe Strout) Date: Mon, 20 Oct 2008 16:11:01 -0600 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <48FCFF42.6010804@codebykevin.com> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> <48FCFF42.6010804@codebykevin.com> Message-ID: <603AAABE-91CE-4071-8D1D-A0CDE362B77E@strout.net> On Oct 20, 2008, at 3:59 PM, Kevin Walzer wrote: > WingIDE is written using PyGtk, not wxPython. So yeah, it's an ugly > X11 app. Ah, that explains it. > There are lots of Python-aware editors out there (i.e. with syntax > awareness) but nothing as slick as Xcode is for Cocoa development, > and certainly nothing else with an integrated GUI builder (unless > you are writing a PyObjC app, in which case Xcode is probably your > best bet). I don't expect an integrated GUI builder at this point. The main feature I'd really like is code completion, which Xcode only sort-of does, but I think it could be done better. > Komodo is a fairly robust editor and has both free and commercial > editions; it's built on Mozilla, so doesn't look perfectly native, > but it is better than WingIDE. A lot of folks on this list swear by > Vim or Emacs (Aquamacs is a very nice Emacs variant optimized for > Mac UI conventions). =P I hadn't heard of Aquamacs, but even so, I remember Emacs from my college days, and I'm pretty sure it's not what I'm looking for. For reference, my favorite text editor is TextWrangler (or if I'm feeling spendy, BBEdit) -- it's beautifully written with great attention to detail, and is designed with the Mac ethos through and through. But while it can syntax-color Python code just fine and provide a simple function pop-up, it doesn't do any code completion. That's really a must-have feature for me, given my propensity to make typos, and Python's propensity to cheerfully accept them until the code is actually exercised. > I actually just use plain old IDLE. It's had some basic Mac UI > adaptations, and works nicely for me. But then, I use Tk/Tkinter as > my GUI toolkit, so I actually prefer to use a Tk-based app as a > reference point (for both good and bad aspects). I'd like to try IDLE, but it isn't included in the standard Mac installation, and I'm reluctant to install MacPython just to get it. On the other hand, I do have other Tkinter apps (like NLTK) working just fine, so maybe I could just download IDLE by itself and give it a try. On the third hand, I have a feeling that my own apps are going to be either Cocoa or wx (or some Frankensteinian hybrid of both), so given the choice, I'd prefer a wx-based IDE for the same reason that you prefer a Tk-based one. Thanks, - Joe From mankoff at gmail.com Tue Oct 21 00:21:44 2008 From: mankoff at gmail.com (Ken Mankoff) Date: Mon, 20 Oct 2008 18:21:44 -0400 (EDT) Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <603AAABE-91CE-4071-8D1D-A0CDE362B77E@strout.net> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> <48FCFF42.6010804@codebykevin.com> <603AAABE-91CE-4071-8D1D-A0CDE362B77E@strout.net> Message-ID: On Mon, 20 Oct 2008, Joe Strout wrote: > I hadn't heard of Aquamacs, but even so, I remember Emacs from my > college days, and I'm pretty sure it's not what I'm looking for. It probably isn't what you want, but it has changed since most peoples college days. It does have a UI now. > For reference, my favorite text editor is TextWrangler (or if I'm > feeling spendy, BBEdit) -- it's beautifully written with great > attention to detail, and is designed with the Mac ethos through > and through. But while it can syntax-color Python code just fine > and provide a simple function pop-up, it doesn't do any code > completion. What about this plugin for BBEdit or TextWrangler? http://www.versiontracker.com/dyn/moreinfo/macosx/13788 -k. From robin at alldunn.com Tue Oct 21 01:11:26 2008 From: robin at alldunn.com (Robin Dunn) Date: Mon, 20 Oct 2008 16:11:26 -0700 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <48FD01B6.8070501@noaa.gov> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> <48FD01B6.8070501@noaa.gov> Message-ID: <48FD101E.2090701@alldunn.com> Christopher Barker wrote: > Joe Strout wrote: >> I'd heard good things about Wing IDE (including that it was written >> with wxPython, > > I think it was written with pyGTK, actually, which explains why it's an > X app, and why it's "awful" on a Mac. Given that I'm Mr. wxPython I'm sometimes a bit embarrassed to admit that I've been using WingIDE more and more lately (transitioning from Emacs) instead of one of the wx-based editors. Almost every day I cuss at it for being so butt ugly on Mac and not being native, but I still keep on using it because I haven't yet found anything that comes close to beating it on features and functionality. The auto-complete is very thorough and useful, the debugger is excellent, and there is a ton of other goodness in there too. It makes working on a *very* large code base that was 99.5% written by someone besides me *much* easier to deal with than it would have been otherwise, so I just grit my teeth and live with the ugliness. P.S. If anybody can convince Wingware to sponsor a wx port of WingIDE I know somebody who would be willing to work on it. ;-) -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! From Chris.Barker at noaa.gov Tue Oct 21 01:26:54 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 20 Oct 2008 16:26:54 -0700 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <48FD101E.2090701@alldunn.com> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> <48FD01B6.8070501@noaa.gov> <48FD101E.2090701@alldunn.com> Message-ID: <48FD13BE.9040903@noaa.gov> Robin Dunn wrote: > Given that I'm Mr. wxPython I'm sometimes a bit embarrassed to admit > that I've been using WingIDE more and more lately (transitioning from > Emacs) instead of one of the wx-based editors. Almost every day I cuss > at it for being so butt ugly on Mac and not being native, but I still > keep on using it because I haven't yet found anything that comes close > to beating it on features and functionality. The auto-complete is very > thorough and useful, I don't remember auto-completion being on your list of features for a "pry-emacs-from-my-hands" list... It would be nice though -- Rob, any plans to add that to Peppy? > the debugger is excellent, Have you tried winPDB? It has some layout issues on the Mac, but it's worked for me. Rob, have you given thought to integrating winPDB into Peppy? that would be nice. > P.S. If anybody can convince Wingware to sponsor a wx port I do wonder why they chose GTK in the first place, but what can you do? Joe Strout wrote: > On Oct 20, 2008, at 4:09 PM, Christopher Barker wrote: > >> I'm using Peppy > Interesting -- that one's not on the wiki (perhaps you would add it?). > I'll give it a try. Out of curiosity, what are the key features in your > view? - Multiple top-level windows (Frames, in wx parlance) - being able to have the same file open in multiple windows - extensible in python (though I never seem to have the time to make use of that!) - customizable major/minor modes for different kinds of files. - Windows, Mac, Linux - Not just a python editor. I guess the key thing about Peppy for me is that every other wxPython editor I tried was missing not just a key feature or two, but it's architecture seemed to make it virtually impossible to add the feature. Peppy is lacking in maturity, but it's architecture is quite flexible. By the way, I've written a setup.py, etc, so that you can get an py2app bundle of Peppy (in alias mode), which is critical to making it act like a Mac app -- putting in in the doc, drag&dropping files on it, etc. I think it's in Peppy SVN, but if not, ask me... And yes, you'll need a new wxPython. -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 trentm at activestate.com Tue Oct 21 01:51:41 2008 From: trentm at activestate.com (Trent Mick) Date: Mon, 20 Oct 2008 16:51:41 -0700 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <48FCFF42.6010804@codebykevin.com> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> <48FCFF42.6010804@codebykevin.com> Message-ID: <48FD198D.8070801@activestate.com> Kevin Walzer wrote: > Joe Strout wrote: >> Is there any Python IDE that looks and feels more like a proper Mac app? >>... > Komodo is a fairly robust editor and has both free and commercial > editions; it's built on Mozilla, so doesn't look perfectly native, but Hi all, I'd be interesting in comments on some of the UI work we've been doing in the latest Komodo 5.0 builds. http://downloads.activestate.com/Komodo/nightly/komodoedit/latest-trunk/ We've done a fair amount of work towards making it feel more native on Mac OS X. Still a long way to go (mostly on windows other than the main one), but definitely better than the current release version (Komodo 4.4). Note that these "nightly" builds are pre-release builds. Cheers, Trent -- Trent Mick trentm at activestate.com From nad at acm.org Tue Oct 21 03:23:48 2008 From: nad at acm.org (Ned Deily) Date: Mon, 20 Oct 2008 18:23:48 -0700 Subject: [Pythonmac-SIG] IDE that doesn't look awful? References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> <48FD01B6.8070501@noaa.gov> Message-ID: In article <48FD01B6.8070501 at noaa.gov>, Christopher Barker wrote: > A lot of folks like TextMate. "Python Usage 101" @ -- Ned Deily, nad at acm.org From robin at alldunn.com Tue Oct 21 07:25:35 2008 From: robin at alldunn.com (Robin Dunn) Date: Mon, 20 Oct 2008 22:25:35 -0700 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <48FD13BE.9040903@noaa.gov> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> <48FD01B6.8070501@noaa.gov> <48FD101E.2090701@alldunn.com> <48FD13BE.9040903@noaa.gov> Message-ID: <48FD67CF.2040604@alldunn.com> Christopher Barker wrote: > Robin Dunn wrote: >> Given that I'm Mr. wxPython I'm sometimes a bit embarrassed to admit >> that I've been using WingIDE more and more lately (transitioning from >> Emacs) instead of one of the wx-based editors. Almost every day I >> cuss at it for being so butt ugly on Mac and not being native, but I >> still keep on using it because I haven't yet found anything that comes >> close to beating it on features and functionality. The auto-complete >> is very thorough and useful, > > I don't remember auto-completion being on your list of features for a > "pry-emacs-from-my-hands" list... I had no idea what I was missing until I spent a little time with it. The static and on the fly code analysis that Wing does is really powerful. I can make a change in one file and then even without saving it I can be working in another file and be able to see the names I just added show up in the appropriate auto-complete lists. > > It would be nice though -- Rob, any plans to add that to Peppy? > >> the debugger is excellent, > > Have you tried winPDB? It has some layout issues on the Mac, but it's > worked for me. I've used it before, but it's been a while. It's good, but Wing can do lots more. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! From andrea.gavana at gmail.com Tue Oct 21 11:49:22 2008 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Tue, 21 Oct 2008 10:49:22 +0100 Subject: [Pythonmac-SIG] ANN: GUI2Exe 0.2 Message-ID: Hi All, I am happy to announce the release of GUI2Exe 0.2 :-D I apologize for the huge cross-posting, I just wanted to let py2exe, py2app, PyInstaller, cx_Freeze and bbFreeze users aware of the existence of GUI2Exe, but from now on the announcements will go to the GUI2Exe mailing list only to avoid cluttering of the various mailing lists. First of all, I would like to thank Cody Precord for the huge work he has done and for the nice suggestions he has given to me, and the wxPython mailing list users for tips on how to improve the general usability of GUI2Exe. What is it? =========== GUI2Exe is a Graphical User Interface frontend to all the "executable builders" available for the Python programming language. It can be used to build standalone Windows executables, Linux applications and Mac OS application bundles and plugins starting from Python scripts. GUI2Exe is (my) first attempt to unify all the available "executable builders" for Python in a single and simple to use graphical user interface. GUI2Exe supports the following compilers: * py2exe (Windows) * py2app (Mac OS) * PyInstaller (all platforms) * cx_Freeze (Windows and Linux) * bbFreeze (Windows and Linux) Requirements ============ GUI2Exe is distributed as Python source code, and it requires: * Python 2.3+ ; * wxPython 2.8.7+ ansi/unicode (unicode recommended); * One (or more) of the Python executable builders. Features ======== GUI2Exe has a number of features, namely: * Saves and stores your work in a database, displaying all your projects in a tree control; * Possibility to export the Setup.py file, even though you shouldn't ever need anymore to have a Setup.py file, as everything is done automagically inside GUI2Exe; * Ability to change the Python version to use to build the executable; * Allows the user to insert custom Python code in the "in-memory" Setup.py file, which will be properly included at runtime during the building process; * Allows the user to add post-processing custom code, which will be executed at the end of the building process. Useful for cleaning up; * Possibility to view the full build output coming from the compiler; * Allows the user to add data_files (for the executable builders that support this option) either by selecting a bunch of files all together or using a directory-recursive approach, which will include all files and sub-folders in the selected folders as data_files; * "Super" tooltips for the users to better understand the various options; * GUI2Exe projects can be saved also to a file (and not only in the database): the exported project may then be checked into version control software like CVS or SVN, modified and then reloaded into GUI2Exe; * Ability to test the executable: if the executable crashes, GUI2Exe will notice it and report to you the traceback for inspection; * [py2exe-only]: After a building process, choosing the menu Builds => Missing modules or Builds => Binary dependencies, you will be presented respectively with a list of modules py2exe thinks are missing or a list of binary dependencies (dlls) py2exe has found. And much more :-D Project information =================== Project home page & downloads: http://code.google.com/p/gui2exe Bleeding edge SVN repository (out of sync at the moment, please use the zip file in the download section of the home page for the moment): svn checkout http://gui2exe.googlecode.com/svn/trunk/ gui2exe-read-only Project mailing list: http://groups.google.com/group/gui2exe Help translating GUI2Exe in your language! https://launchpad.net/gui2exe Please report bugs, success stories ( :-D ) and requests of improvements to the GUI2Exe mailing list: http://groups.google.com/group/gui2exe Or use the google-Trac issues handler here: http://code.google.com/p/gui2exe/issues/list Happy Python hacking :-D Andrea. "Imagination Is The Only Weapon In The War Against Reality." http://xoomer.alice.it/infinity77/ From goodmansond at gmail.com Tue Oct 21 16:52:02 2008 From: goodmansond at gmail.com (DeanG) Date: Tue, 21 Oct 2008 09:52:02 -0500 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <603AAABE-91CE-4071-8D1D-A0CDE362B77E@strout.net> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> <48FCFF42.6010804@codebykevin.com> <603AAABE-91CE-4071-8D1D-A0CDE362B77E@strout.net> Message-ID: Eclipse on OS X with PyDev is also pretty spiffy. I've heard decent things about Eric (Qt) also but I got Eclipse up and running first. - DeanG On Mon, Oct 20, 2008 at 5:11 PM, Joe Strout wrote: > On Oct 20, 2008, at 3:59 PM, Kevin Walzer wrote: > >> WingIDE is written using PyGtk, not wxPython. So yeah, it's an ugly X11 >> app. > > Ah, that explains it. > >> There are lots of Python-aware editors out there (i.e. with syntax >> awareness) but nothing as slick as Xcode is for Cocoa development, and >> certainly nothing else with an integrated GUI builder (unless you are >> writing a PyObjC app, in which case Xcode is probably your best bet). > > I don't expect an integrated GUI builder at this point. The main feature > I'd really like is code completion, which Xcode only sort-of does, but I > think it could be done better. ... > Thanks, > - Joe > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From hraban at fiee.net Tue Oct 21 18:59:21 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Tue, 21 Oct 2008 18:59:21 +0200 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> Message-ID: Am 2008-10-20 um 23:46 schrieb Joe Strout: > Is there any Python IDE that looks and feels more like a proper Mac > app? Since nobody else mentioned it: I use Eclipse/Aptana with PyDev, because I mostly deal with web projects and need to edit HTML, CSS, JavaScript, PHP, XML, TeX etc. as well. But Eclipse isn't really a typical Mac app, even if the feeling gets better. On my old G4/400 it was unusable slow (like every Java app), on a G5 or a newer Mac mini it runs well. Otherwise I would have stayed with SPE (FYI: it includes the debugger Winpdb and the GUI builder wxGlade; I never used them). Additionally I like TextWrangler for the lighter editing tasks, esp. because it starts really fast. The easy way of switching encodings is just great! (Most editors can't do that at all, don't understand why.) But it has some nasty mis-features (modal search dialog, Cmd-Shift-S is *not* "save as"...) jEdit is Java-ugly; a lot of plugins don't work well on a Mac... SciTE is X11 only. Tried Komodo once but didn't like it. I don't run EmacsOS (I don't need another operating system). vi is good for remote jobs. Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From joe at strout.net Tue Oct 21 19:45:02 2008 From: joe at strout.net (Joe Strout) Date: Tue, 21 Oct 2008 11:45:02 -0600 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> Message-ID: On Oct 21, 2008, at 10:59 AM, Henning Hraban Ramm wrote: > Otherwise I would have stayed with SPE (FYI: it includes the > debugger Winpdb and the GUI builder wxGlade; I never used them). I tried SPE last night, and it looks promising... but the developer seems to be determined to discourage new users. Its "home page" appears to be just a blog, that hardly mentions SPE at all. A well- hidden "download" link takes you to here: ...where ten different files are listed under "SPE 0.8.4" (and even to get that far you must choose to investigate or ignore something above it called "sdxf"). Nothing explains what all these are or which to download. I mulled this over for a while and finally downloaded the first one, SPE-0.8.4.c-wx2.6.1.0-no_setup.zip, and unzipped it. There as no README, so I took a guess on running the SPE.py file, and this finally brought up something that looks like an IDE... but I can't get even the simplest one-line "Hello World" script to actually run. The Help menu takes you to a page offering to sell you a manual for a $5 or more "donation," but I'm not ready to donate yet, as I can't tell that it's even going to work, and no email address for the author is given anywhere that I can find. (I did finally find a web form where I could submit a question, which I did yesterday, and haven't yet received a reply.) So, while it does look like a nice editor and isn't half as ugly as Wing, it's certainly not very inviting when it comes to actual use. I'm still hopeful though that these difficulties can be overcome. (I forgot to mention it, since in my mind it's implied by "IDE", but a debugger really is a must-have feature, and SPE at least claims to have one.) > Additionally I like TextWrangler for the lighter editing tasks, esp. > because it starts really fast. TextWrangler's start time doesn't matter to me, since I have it open at all times anyway. :) But yes, you can't beat TW for performance. I also love how it integrates with the command line, providing the edit and twdiff commands for example (twdiff is especially nice in conjunction with svn). > The easy way of switching encodings is just great! (Most editors > can't do that at all, don't understand why.) Agreed. > jEdit is Java-ugly; a lot of plugins don't work well on a Mac... > SciTE is X11 only. > Tried Komodo once but didn't like it. > I don't run EmacsOS (I don't need another operating system). > vi is good for remote jobs. I appreciate the reviews. So far, SPE looks most promising to me, if I can get over the initial hurdles. Peppy also looks decent, though I think it's just an editor (no debugger). Same for Editra. I should probably go back through and write a brief review of all the ones I'm trying; there are other Python IDE reviews out there, but none geared to the user wanting a Mac experience. Best, - Joe From ed at leafe.com Tue Oct 21 19:39:55 2008 From: ed at leafe.com (Ed Leafe) Date: Tue, 21 Oct 2008 12:39:55 -0500 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> Message-ID: <2F3F3886-A1FB-4AD3-B44D-1F9402411F62@leafe.com> On Oct 21, 2008, at 11:59 AM, Henning Hraban Ramm wrote: > jEdit is Java-ugly; a lot of plugins don't work well on a Mac... > SciTE is X11 only. > Tried Komodo once but didn't like it. > I don't run EmacsOS (I don't need another operating system). > vi is good for remote jobs. I guess I should put in a plug for the Dabo Editor. It provides word completion, Intellisense (code completion), calltips for methods, syntax coloring for many languages/formats, and lots more. Here are some screenshots of it running on OS X: http://dabodev.com/wiki/Screenshots -- Ed Leafe From hraban at fiee.net Tue Oct 21 20:14:19 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Tue, 21 Oct 2008 20:14:19 +0200 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> Message-ID: <9AE8BFBA-4F79-4BB2-A427-F49BEBAF179C@fiee.net> Am 2008-10-21 um 19:45 schrieb Joe Strout: >> Otherwise I would have stayed with SPE (FYI: it includes the >> debugger Winpdb and the GUI builder wxGlade; I never used them). > > I tried SPE last night, and it looks promising... but the developer > seems to be determined to discourage new users. Its "home page" > appears to be just a blog, that hardly mentions SPE at all. A well- > hidden "download" link takes you to here: pythonide.stani.be/> You're right; Stani changed SPE's homepage several times, and I don't know if the "real" SPE homepage still exists anywhere. I'd suggest to take the SVN version: http://pythonide.blogspot.com/2007/02/how-to-download-latest-spe-from_26.html http://developer.berlios.de/projects/python/ svn checkout svn://svn.berlios.de/python/spe/trunk/_spe The _spe directory is supposed to be in the Python path, e.g. site- packages/_spe You can run "spe" from there (e.g. set an alias in your .profile). >> Additionally I like TextWrangler for the lighter editing tasks, >> esp. because it starts really fast. > TextWrangler's start time doesn't matter to me, since I have it open > at all times anyway. :) But yes, you can't beat TW for > performance. I also love how it integrates with the command line, > providing the edit and twdiff commands for example (twdiff is > especially nice in conjunction with svn). Never used twdiff, but "edit" all the time :-) Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From brendansimons at yahoo.ca Wed Oct 22 15:21:51 2008 From: brendansimons at yahoo.ca (Brendan Simons) Date: Wed, 22 Oct 2008 06:21:51 -0700 (PDT) Subject: [Pythonmac-SIG] IDE that doesn't look awful? Message-ID: <959306.82052.qm@web30008.mail.mud.yahoo.com> I'll offer a counter opinion to say that I quite like Komodo. If you can live with just text highlighting and the ability to run scripts from the editor, I like textwrangler. -- Brendan Simons __________________________________________________________________ Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail. Click on Options in Mail and switch to New Mail today or register for free at http://mail.yahoo.ca From joe at strout.net Wed Oct 22 17:13:36 2008 From: joe at strout.net (Joe Strout) Date: Wed, 22 Oct 2008 09:13:36 -0600 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <959306.82052.qm@web30008.mail.mud.yahoo.com> References: <959306.82052.qm@web30008.mail.mud.yahoo.com> Message-ID: <63D682F2-2123-4E9A-B03E-7F2F27EFA44C@strout.net> On Oct 22, 2008, at 7:21 AM, Brendan Simons wrote: > I'll offer a counter opinion to say that I quite like Komodo. I appreciate the input. However, I have to admit a bias towards an IDE actually written in Python, for several reasons. > If you can live with just text highlighting and the ability to run > scripts from the editor, I like textwrangler. I do like TextWrangler too, and it's certainly better than nothing. But it's not what I would consider an IDE. FYI, I've been most impressed so far with Editra. It's still a little green (it took me a while to figure out how to run a script, for example, and some of the cursor movement in the editor isn't quite right yet), but it's got great code completion and pop-up method signatures, and a very flexible plug-in architecture that I think is going to serve it well as it grows. The author has been very responsive and helpful, too, and cares about Mac users -- for example, it's available as a prepackaged app with a nice high-res icon and so on. It's a wxPython app and the author is open to contributions, so I will probably roll up my sleeves and see what I can do to help it along. Best, - Joe From trentm at activestate.com Wed Oct 22 18:30:57 2008 From: trentm at activestate.com (Trent Mick) Date: Wed, 22 Oct 2008 09:30:57 -0700 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <63D682F2-2123-4E9A-B03E-7F2F27EFA44C@strout.net> References: <959306.82052.qm@web30008.mail.mud.yahoo.com> <63D682F2-2123-4E9A-B03E-7F2F27EFA44C@strout.net> Message-ID: <48FF5541.7080602@activestate.com> Joe Strout wrote: > On Oct 22, 2008, at 7:21 AM, Brendan Simons wrote: > >> I'll offer a counter opinion to say that I quite like Komodo. > > I appreciate the input. However, I have to admit a bias towards an IDE > actually written in Python, for several reasons. Most of the logic in Komodo is written in Python. Most of the UI is written in XUL and JavaScript, but most of the guts are in Python. The ohloh page for OpenKomodo (the svn repository for Komodo Edit) gives an approximate percentage breakdown by language: http://www.ohloh.net/projects/openkomodo/analyses/latest Note that I suspect that chart is mistaking XUL and XBL (XML dialects for defining UI) as "HTML". Trent -- Trent Mick trentm at activestate.com From Chris.Barker at noaa.gov Wed Oct 22 19:13:27 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 22 Oct 2008 10:13:27 -0700 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <959306.82052.qm@web30008.mail.mud.yahoo.com> References: <959306.82052.qm@web30008.mail.mud.yahoo.com> Message-ID: <48FF5F37.3020304@noaa.gov> Brendan Simons wrote: > I like textwrangler. So do I, for a lot of things, but one thing that really bugs me is that it simply does not do code indentation properly. In fact, IIRC, there was a thread about this quite some years ago, in which someone (was it you, Joe?) posted a note back from BareBones, essentially saying: "you shouldn't want to do that, so we'll never support it). Which brings up a core issue with TextWrangler -- it's closed source, and not really extensible, so we in the Python community CAN NOT make a good python mode, even if we want to. That's like "buying a car with the hood welded shut", as they say. In fact, I don't think I put this on my list earlier, but one of things I like about Peppy is that it is the only editor I've tried, other than Emacs, that does code indentation properly. Here is what I mean by properly: The key gets mapped to an "indent this line" method, rather than a tab character (or X spaces). The key gets mapped to a "de-indent this line" method, when the cursor is at the beginning of the line. Exactly what those methods do should be language (and maybe user-preference) dependent. For Python, they should be: "indent this line": - indenting is four spaces, always. not tabs, ever. - anywhere on the line, try to indent the code "properly" -match the previous line - if the previous line starts a block (:), indent one more level. - if the current line continues the previous line (unclosed parentheses), indent to match the open paren in the line above. "de-indent this line": - if in the indent space in the beginning of a line, remove one level of indentation. - if in the "extra" whitespace of a continuation line, remove one space. I suppose I should post this somewhere like the pyXides list.... and yes, Joe, It would be nice to write up a review of your evaluations from a Mac perspective. Joe Strout wrote: > FYI, I've been most impressed so far with Editra. I'll need to take a look again and see why I rejected it in favor of Peppy -- I honestly don't remember. > It's a wxPython app and the author is open to contributions, so I will > probably roll up my sleeves and see what I can do to help it along. Add an interface to winPDB! Ed Leafe wrote: > I guess I should put in a plug for the Dabo Editor. I've got to ask: With the dozen or so wxPython-based editors out there -- why not use and improve one of them, rather than write your own? What does Dabo Editor's architecture provide that none of the others do? -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 Wed Oct 22 20:57:47 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 22 Oct 2008 11:57:47 -0700 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <48FF5F37.3020304@noaa.gov> References: <959306.82052.qm@web30008.mail.mud.yahoo.com> <48FF5F37.3020304@noaa.gov> Message-ID: <48FF77AB.4030601@noaa.gov> Christopher Barker wrote: > Joe Strout wrote: >> FYI, I've been most impressed so far with Editra. > > I'll need to take a look again and see why I rejected it in favor of > Peppy -- I honestly don't remember. OK, I've taken a look again: First, it really is nicely put together, polished and packaged well (particularly on the Mac) -- it even offered to download an updated version for me -- very nice. Here are my issues, relating to the list I sent earlier about Peppy: It does support multiple top-level windows, and but I can't seem to view the same file in two different Windows -- that is really a nice feature. I can open the same file in two windows, but the editor seems to treat them as independent -- when I make a change i one, it doesn't show up in the other, though when I save it, the other triggers a "the fie has changed on disk, do you want me to re-load it" dialog. I can't figure out how working with different types of files work - -when I open a python file, it is doing python-specific things, but how do I set that? I see the Settings->Lexers menu, but type-specific behavior goes beyond syntax highlighting. Also, I loaded a *.txt file, and somehow got fortran lexing -- that's a bit odd. Switching to plain-text fixed that. Here is my thing about modes -- I see under Preferences->Document->Code that I can set things like Code folding, Auto-completion, etc. However, what if I want those to be different for different languages? That doesn't appear to be supported. How about using tabs to indent one language, and spaces another? And spell checking -- that would be nice. I think Rob implemented it in such a way for Peppy that it could be plugged in to any wxSTC-based editor. one other issue: I get an almost constant stream of: Oct 22 10:56:54 christopher-barkers-power-mac-g5 /Applications/Editra.app/Contents/MacOS/Editra: CGContextRestoreGState: invalid context errors in Console -- this happens with Peppy too, so it's probably a wxSTC error, but I thought you should know. I suppose I should really move this to the pyXide list. -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 joe at strout.net Wed Oct 22 21:54:10 2008 From: joe at strout.net (Joe Strout) Date: Wed, 22 Oct 2008 13:54:10 -0600 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <48FF77AB.4030601@noaa.gov> References: <959306.82052.qm@web30008.mail.mud.yahoo.com> <48FF5F37.3020304@noaa.gov> <48FF77AB.4030601@noaa.gov> Message-ID: <7321AE29-635D-4D4F-9427-E8E56F160329@strout.net> On Oct 22, 2008, at 12:57 PM, Christopher Barker wrote: > Here are my issues, relating to the list I sent earlier about Peppy: (several valid points, mostly about Editra's handling of multiple languages) I'm not so concerned about handling of multiple languages, as I don't intend to use it for anything but Python; I'm content to have a different IDE for each language as long as it does that language really well. (Otherwise, I'd learn to put up with Eclipse.) Your point about editing the same file in two windows, and having them stay constantly in sync, is a good one though. I would guess that wouldn't be too hard to fix, but that's just a guess. > I suppose I should really move this to the pyXide list. I had to google that (and it take a couple of tries to find the relevant link). For the record, this is what I found: ...which sounds like a pretty interesting idea. How much sharing of code among the various IDEs is there? But I guess that's a question for the pyXide list too! Best, - Joe From hraban at fiee.net Wed Oct 22 22:13:41 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Wed, 22 Oct 2008 22:13:41 +0200 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <7321AE29-635D-4D4F-9427-E8E56F160329@strout.net> References: <959306.82052.qm@web30008.mail.mud.yahoo.com> <48FF5F37.3020304@noaa.gov> <48FF77AB.4030601@noaa.gov> <7321AE29-635D-4D4F-9427-E8E56F160329@strout.net> Message-ID: <350A5035-94C8-4275-9524-4AECEFB2FC28@fiee.net> Am 2008-10-22 um 21:54 schrieb Joe Strout: >> I suppose I should really move this to the pyXide list. > > I had to google that (and it take a couple of tries to find the > relevant link). For the record, this is what I found: > > > ...which sounds like a pretty interesting idea. How much sharing of > code among the various IDEs is there? But I guess that's a question > for the pyXide list too! The real link is http://groups.google.com/group/pyxides Stani often uses frame forwarding, I hate that... I remember the beginning of pyxides, they seemed rather enthusiastic at that time; to me it seems the work stalled a long time ago? Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From p at ulmcnett.com Thu Oct 23 01:58:51 2008 From: p at ulmcnett.com (Paul McNett) Date: Wed, 22 Oct 2008 16:58:51 -0700 Subject: [Pythonmac-SIG] Creating Installer for my py2app-generated bundle Message-ID: <48FFBE3B.9030601@ulmcnett.com> Hi, I've successfully created my application bundle (a wxPython-based application) using py2app and now I want to create an installer inside a compressed dmg. I'm having trouble finding examples of how to do this. I've tried running bdist_mpkg which seems to result in a nearly empty package. Am I on the right track? Thanks! Paul From kw at codebykevin.com Thu Oct 23 02:36:34 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 22 Oct 2008 20:36:34 -0400 Subject: [Pythonmac-SIG] Creating Installer for my py2app-generated bundle In-Reply-To: <48FFBE3B.9030601@ulmcnett.com> References: <48FFBE3B.9030601@ulmcnett.com> Message-ID: <48FFC712.8080004@codebykevin.com> Paul McNett wrote: > Hi, > > I've successfully created my application bundle (a wxPython-based > application) using py2app and now I want to create an installer inside a > compressed dmg. > > I'm having trouble finding examples of how to do this. I've tried > running bdist_mpkg which seems to result in a nearly empty package. Am I > on the right track? > > Thanks! > Paul Unless there's a specific reason, an installer is seldom the right way to go on the Mac. Apps are supposed to be standalone and installable via drag-and-drop. The DMG is fine, but if the app is self-contained, don't worry about the installer. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From p at ulmcnett.com Thu Oct 23 03:18:16 2008 From: p at ulmcnett.com (Paul McNett) Date: Wed, 22 Oct 2008 18:18:16 -0700 Subject: [Pythonmac-SIG] Creating Installer for my py2app-generated bundle In-Reply-To: <48FFC712.8080004@codebykevin.com> References: <48FFBE3B.9030601@ulmcnett.com> <48FFC712.8080004@codebykevin.com> Message-ID: <48FFD0D8.4010908@ulmcnett.com> Kevin Walzer wrote: > Paul McNett wrote: >> Hi, >> >> I've successfully created my application bundle (a wxPython-based >> application) using py2app and now I want to create an installer inside >> a compressed dmg. >> >> I'm having trouble finding examples of how to do this. I've tried >> running bdist_mpkg which seems to result in a nearly empty package. Am >> I on the right track? >> >> Thanks! >> Paul > > Unless there's a specific reason, an installer is seldom the right way > to go on the Mac. Apps are supposed to be standalone and installable via > drag-and-drop. The DMG is fine, but if the app is self-contained, don't > worry about the installer. It's a commercial app and the lawyers have stated that the users need to agree to the license terms with every install or upgrade. It seems to me having the user walk through the (now ubiquitous - I think 80% of apps I've installed recently come with a installer) Installer.app steps is the most comfortable way to accomplish this. But... you are right. The drag-drop of the bundle is working just fine and I guess I could have them agree to the license every time they run the app. ;) On Windows I use py2exe and INNOSetup to produce a single-file installer. The lawyers love the result. The app can look for updates online, download, and run the new installer. I'd just like it to be as similar an experience as possible on Mac. Paul From kw at codebykevin.com Thu Oct 23 03:29:58 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 22 Oct 2008 21:29:58 -0400 Subject: [Pythonmac-SIG] Creating Installer for my py2app-generated bundle In-Reply-To: <48FFD0D8.4010908@ulmcnett.com> References: <48FFBE3B.9030601@ulmcnett.com> <48FFC712.8080004@codebykevin.com> <48FFD0D8.4010908@ulmcnett.com> Message-ID: <48FFD396.2030808@codebykevin.com> Paul McNett wrote: > Kevin Walzer wrote: >> Paul McNett wrote: >>> Hi, >>> >>> I've successfully created my application bundle (a wxPython-based >>> application) using py2app and now I want to create an installer >>> inside a compressed dmg. >>> >>> I'm having trouble finding examples of how to do this. I've tried >>> running bdist_mpkg which seems to result in a nearly empty package. >>> Am I on the right track? >>> >>> Thanks! >>> Paul >> >> Unless there's a specific reason, an installer is seldom the right way >> to go on the Mac. Apps are supposed to be standalone and installable >> via drag-and-drop. The DMG is fine, but if the app is self-contained, >> don't worry about the installer. > > It's a commercial app and the lawyers have stated that the users need to > agree to the license terms with every install or upgrade. It seems to me > having the user walk through the (now ubiquitous - I think 80% of apps > I've installed recently come with a installer) Installer.app steps is > the most comfortable way to accomplish this. > > But... you are right. The drag-drop of the bundle is working just fine > and I guess I could have them agree to the license every time they run > the app. ;) > > On Windows I use py2exe and INNOSetup to produce a single-file > installer. The lawyers love the result. The app can look for updates > online, download, and run the new installer. I'd just like it to be as > similar an experience as possible on Mac. > > Paul > > You can add a license file to the DMG that appears when the DMG is launched. There's a bit of hacking/black magic involved in this; buildDMG from ObjectPArk (http://www.objectpark.org/buildDMG.html) is a Perl script that automates the process. Commercial tools like DropDMG can also handle it. (http://c-command.com/dropdmg/), and I think DropDMG has a command-line component. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From p at ulmcnett.com Thu Oct 23 07:10:49 2008 From: p at ulmcnett.com (Paul McNett) Date: Wed, 22 Oct 2008 22:10:49 -0700 Subject: [Pythonmac-SIG] Creating Installer for my py2app-generated bundle In-Reply-To: <48FFD396.2030808@codebykevin.com> References: <48FFBE3B.9030601@ulmcnett.com> <48FFC712.8080004@codebykevin.com> <48FFD0D8.4010908@ulmcnett.com> <48FFD396.2030808@codebykevin.com> Message-ID: <49000759.9070104@ulmcnett.com> Thanks for the other thoughts of alternative approaches, but I've elected to go the installer route as it flows most naturally for me and this application. I figured out how to automate PackageMaker: silly me, I thought that because I'd used py2app I'd need some python-based solution for getting the installer package made. PackageMaker more than solves the problem at hand. Paul From janssen at parc.com Thu Oct 23 20:43:08 2008 From: janssen at parc.com (Bill Janssen) Date: Thu, 23 Oct 2008 11:43:08 PDT Subject: [Pythonmac-SIG] Calling CGWindowList* functions from Python? Message-ID: <57242.1224787388@parc.com> I'm trying to re-implement the example at http://developer.apple.com/samplecode/SonOfGrab/index.html in Python, using the Apple system Python 2.5 on Leopard. But the indicated functions, like CGWindowListCopyWindowInfo, don't seem to be defined in the SWIG-generated Python module CoreGraphics that comes with Leopard. Is there a newer version of this module? Is there a different way to go with this? Any advice would be appreciated. Bill From yoda at isr.ist.utl.pt Fri Oct 24 13:29:09 2008 From: yoda at isr.ist.utl.pt (Rodrigo Ventura) Date: Fri, 24 Oct 2008 12:29:09 +0100 Subject: [Pythonmac-SIG] python 2.6 on mac seems to break compatibility Message-ID: <58519D6E-2A11-41CF-93E3-C0DBE888C62A@isr.ist.utl.pt> I'm having difficulty on compiling PIL on Leopard. PIL used to compile just fine with the system's python (2.5.1 I believe), but with macpython 2.6 it breaks. First of all, I get lots of warnings after almost all gcc calls during compilation that I did't get before. Sample example: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 - DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/ Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/ include/freetype2 -IlibImaging -I/opt/local/include -I/Library/ Frameworks/Python.framework/Versions/2.6/include -I/usr/include -I/ Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c libImaging/RawDecode.c -o build/temp.macosx-10.3-i386-2.6/libImaging/ RawDecode.o In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/ 2.6/include/python2.6/pyport.h:235, from /Library/Frameworks/Python.framework/Versions/ 2.6/include/python2.6/Python.h:58, from libImaging/ImPlatform.h:10, from libImaging/Imaging.h:14, from libImaging/RawDecode.c:17: /usr/include/architecture/ppc/math.h:675: warning: conflicting types for built-in function 'scalb' Another illustrative example: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I/System/ Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/ Tk.framework/Headers -I/opt/local/include/freetype2 -IlibImaging -I/ opt/local/include -I/Library/Frameworks/Python.framework/Versions/2.6/ include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/ 2.6/include/python2.6 -c Tk/tkImaging.c -o build/temp.macosx-10.3- i386-2.6/Tk/tkImaging.o -framework Tcl -framework Tk In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/ 2.6/include/python2.6/pyport.h:235, from /Library/Frameworks/Python.framework/Versions/ 2.6/include/python2.6/Python.h:58, from libImaging/ImPlatform.h:10, from libImaging/Imaging.h:14, from Tk/tkImaging.c:53: /usr/include/architecture/ppc/math.h:675: warning: conflicting types for built-in function 'scalb' i686-apple-darwin9-gcc-4.0.1: -framework: linker input file unused because linking not done i686-apple-darwin9-gcc-4.0.1: Tcl: linker input file unused because linking not done i686-apple-darwin9-gcc-4.0.1: -framework: linker input file unused because linking not done i686-apple-darwin9-gcc-4.0.1: Tk: linker input file unused because linking not done powerpc-apple-darwin9-gcc-4.0.1: -framework: linker input file unused because linking not done powerpc-apple-darwin9-gcc-4.0.1: Tcl: linker input file unused because linking not done powerpc-apple-darwin9-gcc-4.0.1: -framework: linker input file unused because linking not done powerpc-apple-darwin9-gcc-4.0.1: Tk: linker input file unused because linking not done And then it fails with: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g - bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.6/ _imagingtk.o build/temp.macosx-10.3-i386-2.6/Tk/tkImaging.o -L/opt/ local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/ Versions/2.6/lib -L/usr/lib -o build/lib.macosx-10.3-i386-2.6/ _imagingtk.so -framework Tcl -framework Tk ld: in /opt/local/lib/libz.1.dylib, file is not of required architecture for architecture ppc collect2: ld returned 1 exit status lipo: can't open input file: /var/folders/gO/gOEfKG2kElSEfJYMJH7ijU++ +TI/-Tmp-//ccpZdO98.out (No such file or directory) error: command 'gcc' failed with exit status 1 Is there a fix for this? Rodrigo Ventura Institute for Systems and Robotics (www.isr.ist.utl.pt) Instituto Superior T?cnico Lisbon, Portugal From {bymail{ignore} at bestley.co.uk Fri Oct 24 14:07:29 2008 From: {bymail{ignore} at bestley.co.uk (Mark Bestley) Date: Fri, 24 Oct 2008 13:07:29 +0100 Subject: [Pythonmac-SIG] python 2.6 on mac seems to break compatibility References: <58519D6E-2A11-41CF-93E3-C0DBE888C62A@isr.ist.utl.pt> Message-ID: On Fri, 24 Oct 2008 12:29:09 +0100, Rodrigo Ventura wrote: > > I'm having difficulty on compiling PIL on Leopard. PIL used to compile > just fine with the system's python (2.5.1 I believe), but with macpython > 2.6 it breaks. > > First of all, I get lots of warnings after almost all gcc calls during > compilation that I did't get before. Sample example: > > > gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - > fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBJPEG > -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers > -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/ > include/freetype2 -IlibImaging -I/opt/local/include -I/Library/ > Frameworks/Python.framework/Versions/2.6/include -I/usr/include -I/ > Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c > libImaging/RawDecode.c -o build/temp.macosx-10.3-i386-2.6/libImaging/ > RawDecode.o > In file included from /usr/include/math.h:26, > from /Library/Frameworks/Python.framework/Versions/ > 2.6/include/python2.6/pyport.h:235, > from /Library/Frameworks/Python.framework/Versions/ > 2.6/include/python2.6/Python.h:58, > from libImaging/ImPlatform.h:10, > from libImaging/Imaging.h:14, > from libImaging/RawDecode.c:17: > /usr/include/architecture/ppc/math.h:675: warning: conflicting types for > built-in function 'scalb' > > I see /opt/local on your paths - This is from macports - probably a good idea to remove that from your INCLUDE > > > gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g - > bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.6/ > _imagingtk.o build/temp.macosx-10.3-i386-2.6/Tk/tkImaging.o -L/opt/ > local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/ > Versions/2.6/lib -L/usr/lib -o build/lib.macosx-10.3-i386-2.6/ > _imagingtk.so -framework Tcl -framework Tk > ld: in /opt/local/lib/libz.1.dylib, file is not of required architecture > for architecture ppc > collect2: ld returned 1 exit status > lipo: can't open input file: /var/folders/gO/gOEfKG2kElSEfJYMJH7ijU++ > +TI/-Tmp-//ccpZdO98.out (No such file or directory) > error: command 'gcc' failed with exit status 1 > I think this is a macports issue. macports builds as one architecture only The /opt/local/lib/libz.1.dylib is a macports file and your compile command line is for ppc and i386 I would either remove macports from your paths or do your build as one arhitecture only. Or use macports for everything. -- Mark From yoda at isr.ist.utl.pt Fri Oct 24 16:26:26 2008 From: yoda at isr.ist.utl.pt (Rodrigo Ventura) Date: Fri, 24 Oct 2008 15:26:26 +0100 Subject: [Pythonmac-SIG] python 2.6 on mac seems to break compatibility In-Reply-To: References: <58519D6E-2A11-41CF-93E3-C0DBE888C62A@isr.ist.utl.pt> Message-ID: On Oct 24, 2008, at 1:07 PM, Mark Bestley wrote: > I see /opt/local on your paths - This is from macports - probably a > good idea to remove that from your INCLUDE Thank you Mark, it solved (removed from PATH which is strangely used to figure out the libs path) but now I don't have support for JPEG and FREETYPE2, which were in macports... :( Cheers, Rodrigo Ventura Institute for Systems and Robotics (www.isr.ist.utl.pt) Instituto Superior T?cnico Lisbon, Portugal From {bymail{ignore} at bestley.co.uk Fri Oct 24 17:30:47 2008 From: {bymail{ignore} at bestley.co.uk (Mark Bestley) Date: Fri, 24 Oct 2008 16:30:47 +0100 Subject: [Pythonmac-SIG] python 2.6 on mac seems to break compatibility References: <58519D6E-2A11-41CF-93E3-C0DBE888C62A@isr.ist.utl.pt> Message-ID: On Fri, 24 Oct 2008 15:26:26 +0100, Rodrigo Ventura wrote: > > On Oct 24, 2008, at 1:07 PM, Mark Bestley wrote: > >> I see /opt/local on your paths - This is from macports - probably a >> good idea to remove that from your INCLUDE > > > Thank you Mark, it solved (removed from PATH which is strangely used to > figure out the libs path) but now I don't have support for JPEG and > FREETYPE2, which were in macports... :( > Yes which is why I'm staying at 2.5. macports and python seems to be an all one or the otehr propsition I can see several choices 1) Try changing your build files so that they are one architecture only and put macports back on path. 2) Use macports for all - Wait for macports to release 2.6 versions of pil etc - or produce the portfles yourself. a) There is now a macports port of python 2.6 that might be sufficient 3) Use no macports - Build your own copies of the libraries you need not macports and use them in your 2.6 build If 1 works good - 2 or 3 would take more time -- Mark From Chris.Barker at noaa.gov Fri Oct 24 18:37:50 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 24 Oct 2008 09:37:50 -0700 Subject: [Pythonmac-SIG] python 2.6 on mac seems to break compatibility In-Reply-To: References: <58519D6E-2A11-41CF-93E3-C0DBE888C62A@isr.ist.utl.pt> Message-ID: <4901F9DE.4050607@noaa.gov> Mark Bestley wrote: > I can see several choices yup -- it's easy to do all or nothing with macport or fink, though I do see folks using macports to satisfy the dependencies for some python extensions -- I wonder how? > If 1 works good - 2 or 3 would take more time 4) Use the pre-built Universal Framework libs available from: http://www.kyngchaos.com/wiki/doku.php?id=software:frameworks I think UnixImageIO and FreeType will get you everything you need. These are dynamic libs that are built so that they can be used as OS-X Frameworks, and have a structure so that they fit in well with traditional unix builds. you need to do a bit of path manipulation to get the PIL build to find them, but they work fine. The downside is that your PIL will then be dependent on them -- which is not a problem unless you want to distribute your PIL build. I think it would be a good idea to establish these Frameworks as a "standard" way to support these libs with MacPython extensions, but I didn't get much interest when I proposed it, and I haven't had the time to push it myself. I edited PIL's setup.py to support using these Frameworks a while back. I haven't got it tested enough to submit a patch to PIL, but I've enclosed what I did with this message. -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 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: setup.py URL: From eykd at eykd.net Fri Oct 24 19:11:59 2008 From: eykd at eykd.net (David Eyk) Date: Fri, 24 Oct 2008 12:11:59 -0500 Subject: [Pythonmac-SIG] py2app fails on /usr/bin/strip Message-ID: The py2app command is failing for me with a very strange error: ======== /usr/bin/strip: for architecture i386 object: /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/MacOS/bash malformed object (unknown load command 8) stripping saved 18312668 bytes (12069072 / 30381740) ======== This leaves half-baked app bundle in the dist folder. I've googled the error, but I haven't been able to turn up anything understandable or python-related. I've replicated this behavior with a dummy package, which I'm attaching. I have the following environment: OS X: 10.4.11 Python: 2.5.1 setuptools: 0.6c9 py2app: 0.4.2 Can anyone else replicate this error with the attached package? Anyone have an idea what's going on, or how I might fix it? Thanks, David Eyk -------------- next part -------------- A non-text attachment was scrubbed... Name: dummy-0.2.dev.tar.gz Type: application/x-gzip Size: 1400 bytes Desc: not available URL: From {bymail{ignore} at bestley.co.uk Fri Oct 24 19:20:32 2008 From: {bymail{ignore} at bestley.co.uk (Mark Bestley) Date: Fri, 24 Oct 2008 18:20:32 +0100 Subject: [Pythonmac-SIG] python 2.6 on mac seems to break compatibility References: <58519D6E-2A11-41CF-93E3-C0DBE888C62A@isr.ist.utl.pt> <4901F9DE.4050607@noaa.gov> Message-ID: On Fri, 24 Oct 2008 17:37:50 +0100, Christopher Barker wrote: > Mark Bestley wrote: >> I can see several choices > > yup -- it's easy to do all or nothing with macport or fink, though I do > see folks using macports to satisfy the dependencies for some python > extensions -- I wonder how? > I have run a few packages using setup into macports. I have had to edit the build scripts in one case to only compile for one architecture. However I went back to a pure macports and so cannot be certain the compilations worked The macports python is now a framework and will install to /opt/local/Library/Frameworks/Python.framework/Versions/2.5 so I think that setup.py does work I have installed ipython and appscript and my small use of it seems to work -- Mark From Chris.Barker at noaa.gov Fri Oct 24 21:04:32 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 24 Oct 2008 12:04:32 -0700 Subject: [Pythonmac-SIG] python 2.6 on mac seems to break compatibility In-Reply-To: References: <58519D6E-2A11-41CF-93E3-C0DBE888C62A@isr.ist.utl.pt> <4901F9DE.4050607@noaa.gov> Message-ID: <49021C40.1010904@noaa.gov> Mark Bestley wrote: > I have run a few packages using setup into macports. I'm confused - you mean using macport libs with the non-macport framework build? > The macports python is now a framework does macport support Universal binaries? > and will install to > /opt/local/Library/Frameworks/Python.framework/Versions/2.5 so I think > that setup.py does work I have installed ipython and appscript and my small use of it > seems to work Right, this is the all-macport option, which seems to generally work better. -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 janssen at parc.com Sat Oct 25 02:38:00 2008 From: janssen at parc.com (Bill Janssen) Date: Fri, 24 Oct 2008 17:38:00 PDT Subject: [Pythonmac-SIG] Rocket jumping up and down in the dock? Message-ID: <77629.1224895080@parc.com> So sometimes when I run a Python service I get a rocket jumping up and down in the Dock for 30 seconds or so. Usually not, but sometimes. Any idea why this happens? I'm using the /usr/bin/python, consistently. Bill From rgovostes at gmail.com Sat Oct 25 03:52:07 2008 From: rgovostes at gmail.com (Ryan Govostes) Date: Fri, 24 Oct 2008 21:52:07 -0400 Subject: [Pythonmac-SIG] py2app and dependencies Message-ID: <138B6431-B9A1-4C56-98E3-4FD4C25B3C8F@gmail.com> I'm having some trouble with py2app messing up package dependencies. I built py2app from SVN HEAD a few days ago because the version distributed with Apple's Python 2.5 did not appear to support egg dependencies. 1. It is failing to find the text_format module of Google's protobuf package, despite the fact that it is explicitly imported from google.protobuf.message: > from google.protobuf import text_format 2. Another package is not explicitly imported, so I think I have to specify it as a dependency. However, if I add it to the "packages" list, I get an error > ImportError: No module named xyzzy > > /Users/ryan/trunk/build/bdist.macosx-10.5-i386/egg/modulegraph/ > util.py(13)imp_find_module() This is despite the fact that I can import the package with Python interactively. It also fails if I try making a recipe. Is there a way to tell py2app what to include explicitly in these cases? Or should I do some post-build surgery on the resultant .app? Regards, Ryan Govostes From p at ulmcnett.com Sat Oct 25 06:07:41 2008 From: p at ulmcnett.com (Paul McNett) Date: Fri, 24 Oct 2008 21:07:41 -0700 Subject: [Pythonmac-SIG] py2app and dependencies In-Reply-To: <138B6431-B9A1-4C56-98E3-4FD4C25B3C8F@gmail.com> References: <138B6431-B9A1-4C56-98E3-4FD4C25B3C8F@gmail.com> Message-ID: <49029B8D.8000308@ulmcnett.com> Ryan Govostes wrote: > I'm having some trouble with py2app messing up package dependencies. I > built py2app from SVN HEAD a few days ago because the version > distributed with Apple's Python 2.5 did not appear to support egg > dependencies. > > 1. It is failing to find the text_format module of Google's protobuf > package, despite the fact that it is explicitly imported from > google.protobuf.message: > >> from google.protobuf import text_format > > 2. Another package is not explicitly imported, so I think I have to > specify it as a dependency. However, if I add it to the "packages" list, > I get an error > >> ImportError: No module named xyzzy >> > >> /Users/ryan/trunk/build/bdist.macosx-10.5-i386/egg/modulegraph/util.py(13)imp_find_module() >> > > This is despite the fact that I can import the package with Python > interactively. > > It also fails if I try making a recipe. > > > Is there a way to tell py2app what to include explicitly in these cases? > Or should I do some post-build surgery on the resultant .app? Experiment with making a main.py file whose dual purpose in life is to bootstrap your real_main.py file to start your app, and to explicitly import things to make py2app's job easier. Or, I've had good luck with some packages to put them in "includes" instead. Paul From rgovostes at gmail.com Sat Oct 25 06:32:34 2008 From: rgovostes at gmail.com (Ryan Govostes) Date: Sat, 25 Oct 2008 00:32:34 -0400 Subject: [Pythonmac-SIG] py2app and dependencies In-Reply-To: <49029B8D.8000308@ulmcnett.com> References: <138B6431-B9A1-4C56-98E3-4FD4C25B3C8F@gmail.com> <49029B8D.8000308@ulmcnett.com> Message-ID: On Oct 25, 2008, at 12:07 AM, Paul McNett wrote: > Or, I've had good luck with some packages to put them in "includes" > instead. I tried this with one of the dependencies that was imported with __import__. It worked to an extent, except that it did not copy over a .dylib file that is part of the package. It seemed to only include Python files. Is there a way to specify which files to include? Thanks, Ryan Govostes From {bymail{ignore} at bestley.co.uk Sat Oct 25 13:22:39 2008 From: {bymail{ignore} at bestley.co.uk (Mark Bestley) Date: Sat, 25 Oct 2008 12:22:39 +0100 Subject: [Pythonmac-SIG] python 2.6 on mac seems to break compatibility References: <58519D6E-2A11-41CF-93E3-C0DBE888C62A@isr.ist.utl.pt> <4901F9DE.4050607@noaa.gov> <49021C40.1010904@noaa.gov> Message-ID: On Fri, 24 Oct 2008 20:04:32 +0100, Christopher Barker wrote: > Mark Bestley wrote: >> I have run a few packages using setup into macports. > > I'm confused - you mean using macport libs with the non-macport > framework build? > >> The macports python is now a framework > > does macport support Universal binaries? > >> and will install to >> /opt/local/Library/Frameworks/Python.framework/Versions/2.5 so I think >> that setup.py does work I have installed ipython and appscript and my >> small use of it seems to work > > Right, this is the all-macport option, which seems to generally work > better. yes I messed that email up. The full macports option is to use all python libraries from macports ie portd like py25-pil to get Python Imaging and not use setup.py directly What I am now doing is using the macports python interpreter and then adding some libraries to it by using python setup install (and easy_install). This now could work for python 2.6 Whet I have tried in the past is adding some libraries like sip that needed the build script changing but I never fully tested and reverted back to pure macports. Macports I think is single architecture by default - at least from what I have $ file /opt/local/bin/python2.5 /opt/local/bin/python2.5: Mach-O executable i386 However there is a +universal variant which should be on all builds so you could get Universal binaries however not all ports work. A quote from the macports user mailing list MacPorts internally uses the method described in "Configuring for universal binaries" to build universal ports. Some software can't be built universal using those steps. In that case, someone (e.g. the port maintainer, you, another volunteer) must figure out why and how to fix it. Maybe a file (e.g. configure script, Makefile, libtool) can be patched in some way to pass the correct parameters along. In other cases, the build must be repeated once for each architecture and the result glued together with the lipo program. See the openssl and cairo ports for examples of this. MacPorts has no support for this mechanism built in, so ports that need this mechanism get rather convoluted. Sorry for any confusion -- Mark From rgovostes at gmail.com Mon Oct 20 01:15:02 2008 From: rgovostes at gmail.com (Ryan Govostes) Date: Sun, 19 Oct 2008 19:15:02 -0400 Subject: [Pythonmac-SIG] py2app help needed Message-ID: <467595DF-91D7-47D6-B87A-F2800657B282@gmail.com> Hello, I'm trying to use py2app but I'm having a few problems getting it to output what I want. I recently built it and its dependencies from their respective Subversion repositories (usually on pythonmac.org). Right now, my application is not built with all of the needed dependencies, includes some files I don't want it to, and some that it *does* build with aren't found when I import them. Here's an overview of what my project looks like: packageA/ __init__.py setup.py library.dylib ... packageB/ __init__.py setup.py .. mainapp/ mainapp.py setup.py packageX/ Makefile __init__.py ... packageY/ __init__.py ... ... Both packageA and packageB are installed as eggs. I want mainapp to be built with py2app and pull in both packageA and packageB. Furthermore, packageX and packageY should be included. I DO want packageA to include the library.dylib file, but I DON'T want packageX to include the Makefile. Finally, I'd like all .pyc files instead of .py files. As it stands, I'm getting packageA and packageB inside mainapp.app/ Contents/Resources/lib/python2.5/site-packages.zip, but library.dylib is not included. packageX and packageY are in mainapp.app/Contents/ Resources/lib/python2.5, but they include their Makefiles. When I launch the built app, I get a message saying packageX is not found. Here is my setup.py script: from distutils.core import setup import py2app setup( ## PROJECT INFORMATION ## name = "MainApp", version = "3.0", author = "Ryan Govostes, url = "http://www.rgov.org/", ## BUILD DIRECTIVES ## app = [ "mainapp.py" ], options = dict( py2app = dict( packages = [ "packageX", "packageY" ], ) ) ) Sorry if this seems like a rather poor explanation of what I'm trying to do, but I'm at a loss for how to start narrowing down my problems. I welcome any help you can offer me. Regards, Ryan Govostes From hengist.podd at virgin.net Sat Oct 25 17:16:16 2008 From: hengist.podd at virgin.net (has) Date: Sat, 25 Oct 2008 16:16:16 +0100 Subject: [Pythonmac-SIG] Rocket jumping up and down in the dock? Message-ID: <504F3704-070C-4A7D-83C6-576894106ABF@virgin.net> Bill Janssen wrote: > So sometimes when I run a Python service I get a rocket jumping up and > down in the Dock for 30 seconds or so. Usually not, but sometimes. > Any > idea why this happens? I'm using the /usr/bin/python, consistently. If a non-GUI process launched from an .app bundle calls certain OS APIs, OS X automatically upgrades it to full GUI status. e.g. Py- appscript has this problem, despite having no need for a Window Manager connection itself: it calls Process Manager, which is one of the APIs in question, and the python interpreter is packaged as an .app, so you get a bouncing Dock icon any time you use appscript from the command line. By comparison, Ruby's interpreter isn't packaged as an .app, so using rb-appscript won't automatically GUI-fy your ruby process. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From kelsolaar_fool at hotmail.com Sun Oct 26 17:13:09 2008 From: kelsolaar_fool at hotmail.com (kelsolaar_fool at hotmail.com) Date: Sun, 26 Oct 2008 17:13:09 +0100 Subject: [Pythonmac-SIG] Py2App and PyQT Message-ID: Hello, Now that I have my application running and packaged on Windows and Linux, I'm trying to get it working under Mac Os X ( Leopard 10.5.5 ). Everything seem to be fine on compilation side, but when I launch my application I'm getting : Traceback (most recent call last): File "/Volumes/sIBL/src/dist/sIBL_GUI.app/Contents/Resources/__boot__.py", line 137, in _run('sIBL_GUI.py') File "/Volumes/sIBL/src/dist/sIBL_GUI.app/Contents/Resources/__boot__.py", line 134, in _run execfile(path, globals(), globals()) File "/Volumes/sIBL/src/dist/sIBL_GUI.app/Contents/Resources/sIBL_GUI.py", line 71, in from PyQt4.QtCore import * File "PyQt4/QtCore.pyc", line 18, in File "PyQt4/QtCore.pyc", line 15, in __load ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/PyQt4/QtCore.so' not found 2008-10-26 08:55:36.106 sIBL_GUI[432:10b] sIBL_GUI Error 2008-10-26 08:55:36.117 sIBL_GUI[432:10b] sIBL_GUI Error An unexpected error has occurred during execution of the main script ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/PyQt4/QtCore.so' not found This is pretty strange because I actually found that the file is correctly included in "dist/sIBL_GUI.app/Contents/Resources/lib/python2.5/lib-dynload/PyQt4/" directory. Anyone faced this or have an idea ? Thanks, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwf at cs.toronto.edu Mon Oct 27 08:56:45 2008 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Mon, 27 Oct 2008 03:56:45 -0400 Subject: [Pythonmac-SIG] IDE that doesn't look awful? In-Reply-To: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> References: <51932658-548A-4E90-AD51-F29E36C2365B@strout.net> Message-ID: <7B6BA1FC-22D3-4E2B-8E97-AE83B8B93FC1@cs.toronto.edu> On 20-Oct-08, at 5:46 PM, Joe Strout wrote: > Hi all, > > I'd heard good things about Wing IDE (including that it was written > with wxPython, and I know that wxPython can make decent Mac apps > with a bit of care). So I downloaded the disk image today, and man > -- is it ever ugly! It's really not a Mac app at all, but an X- > Window app, with all the usual cruft that brings. Even XCode is > better than that. I know I shouldn't care, but... somehow, I do. > > Is there any Python IDE that looks and feels more like a proper Mac > app? I have to echo an endorsement elsewhere in the thread for pydev on Eclipse. It's really quite polished, and other than the weird tab widgets that Eclipse/SWT uses, looks okay to me. David From Chris.Barker at noaa.gov Mon Oct 27 17:25:34 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 27 Oct 2008 09:25:34 -0700 Subject: [Pythonmac-SIG] py2app and dependencies In-Reply-To: <138B6431-B9A1-4C56-98E3-4FD4C25B3C8F@gmail.com> References: <138B6431-B9A1-4C56-98E3-4FD4C25B3C8F@gmail.com> Message-ID: <4905EB7E.30207@noaa.gov> Ryan Govostes wrote: > I'm having some trouble with py2app messing up package dependencies. I > built py2app from SVN HEAD a few days ago because the version > distributed with Apple's Python 2.5 did not appear to support egg > dependencies. no version of py2app support eggs fully. In general, it supports eggs better when the eggs are unzipped, so you need to be careful to install all of your eggs unzipped: easy_install -Z TheNameOfThePackage you can tell if they are zipped of not by looking at site-packages -- zipped eggs are single files, unzipped ones are directories. > Or should I do some post-build surgery on the resultant .app? you may have to, but it should be a last resort. if your code (or code your using) makes use of pkg_resources, you may need to post-flight install the EGG_INFO stuff into your app. -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 lists+Pythonmac-SIG at hoech.org Tue Oct 28 14:14:01 2008 From: lists+Pythonmac-SIG at hoech.org (=?ISO-8859-15?Q?Florian_H=F6ch?=) Date: Tue, 28 Oct 2008 14:14:01 +0100 Subject: [Pythonmac-SIG] Python 2.6 / appscript 0.18.1 DeprecationWarnings fix Message-ID: <49071019.9050008@hoech.org> Hello list, I hope this is the correct place to send patches to :) I noticed that appscript generates some DeprecationWarnings when used with Python 2.6. It is easily fixed though (I've copied the fixup code verbatim from Python 2.6's ConfigParser.py): --- appscript-0.18.1/Lib/aem/send.py.bak Tue Nov 20 19:57:38 2007 +++ appscript-0.18.1/Lib/aem/send.py Sun Oct 26 19:09:37 2008 @@ -132,6 +132,21 @@ raw : AppleEvent | None -- raw reply event, in case alternate/additional processing of error info is required, or None if error occurred while outgoing event was being sent """ + def _get_message(self): + """Getter for 'message'; needed only to override deprecation in + BaseException.""" + return self.__message + + def _set_message(self, value): + """Setter for 'message'; needed only to override deprecation in + BaseException.""" + self.__message = value + + # BaseException.message has been deprecated since Python 2.6. To prevent + # DeprecationWarning from popping up over this pre-existing attribute, use + # a new property that takes lookup precedence. + message = property(_get_message, _set_message) + def __init__(self, number, message, raw): MacOS.Error.__init__(self, *(message and [number, message] or [number])) self.number, self.message, self.raw = number, message, raw --- appscript-0.18.1/Lib/aemreceive/handlererror.py.bak Tue Nov 20 19:57:38 2007 +++ appscript-0.18.1/Lib/aemreceive/handlererror.py Sun Oct 26 19:09:17 2008 @@ -11,6 +11,22 @@ class EventHandlerError(Exception): """Event-handling callbacks should raise an EventHandlerError exception to send an error message back to client.""" + + def _get_message(self): + """Getter for 'message'; needed only to override deprecation in + BaseException.""" + return self.__message + + def _set_message(self, value): + """Setter for 'message'; needed only to override deprecation in + BaseException.""" + self.__message = value + + # BaseException.message has been deprecated since Python 2.6. To prevent + # DeprecationWarning from popping up over this pre-existing attribute, use + # a new property that takes lookup precedence. + message = property(_get_message, _set_message) + def __init__(self, number, message=None, object=None, coercion=None): self.number = number self.message = message Regards, Florian H?ch From bschollnick at UR.Rochester.edu Tue Oct 28 14:38:47 2008 From: bschollnick at UR.Rochester.edu (Benjamin Schollnick) Date: Tue, 28 Oct 2008 09:38:47 -0400 Subject: [Pythonmac-SIG] Authentication via python? Message-ID: Folks, I?m working on some time machine scripting... In a gist, there is a .Backup.log file that I want to access via readline & python.... >From the MOSX gui, it appears some of the files require root access (eg. Authentication dialog pops up). Now, I am using the applet maker to compile the python to a GUI stub, so I can?t SUDO the python script... Is there some method that I can use to authenticate via the python script internally? I?m in the middle of a google search on this, but I am having no luck at refining my search phrase currently (Macintosh python authenticate)... - Benjamin -------------- next part -------------- An HTML attachment was scrubbed... URL: From vivacarlie at gmail.com Tue Oct 28 16:22:22 2008 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Tue, 28 Oct 2008 10:22:22 -0500 Subject: [Pythonmac-SIG] Authentication via python? In-Reply-To: References: Message-ID: <65fadfc30810280822hecd7157q60ca9643e3b0722e@mail.gmail.com> On Tue, Oct 28, 2008 at 8:38 AM, Benjamin Schollnick < bschollnick at ur.rochester.edu> wrote: > Folks, > > I'm working on some time machine scripting... In a gist, there is a > .Backup.log file that I want to access via readline & python.... > > >From the MOSX gui, it appears some of the files require root access (eg. > Authentication dialog pops up). Now, I am using the applet maker to > compile the python to a GUI stub, so I can't SUDO the python script... Is > there some method that I can use to authenticate via the python script > internally? > > I'm in the middle of a google search on this, but I am having no luck at > refining my search phrase currently (Macintosh python authenticate)... > > - Benjamin > im not sure if python's cocoa services allow access to the "Authorization services API " through python. how good is your C? http://developer.apple.com/documentation/Security/Reference/authorization_ref/Reference/reference.html if you can find a way around it, u need this: http://docs.python.org/library/getpass.html shouldn't this script startout privlaged or otherwise may be exploited? you can sudo gui apps from the commandline or use Psudo, the mac privlage elevation program, http://personalpages.tds.net/~brian_hill/pseudo.html -- "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: From kw at codebykevin.com Tue Oct 28 22:45:28 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 28 Oct 2008 17:45:28 -0400 Subject: [Pythonmac-SIG] Authentication via python? In-Reply-To: References: Message-ID: <490787F8.5070101@codebykevin.com> Benjamin Schollnick wrote: > Folks, > > I?m working on some time machine scripting... In a gist, there is a > .Backup.log file that I want to access via readline & python.... > >>From the MOSX gui, it appears some of the files require root access (eg. > Authentication dialog pops up). Now, I am using the applet maker to compile > the python to a GUI stub, so I can?t SUDO the python script... Is there > some method that I can use to authenticate via the python script internally? > > I?m in the middle of a google search on this, but I am having no luck at > refining my search phrase currently (Macintosh python authenticate)... > > - Benjamin Take a look at Bob Ippolito's authorization package: http://www.undefined.org/python/#Authorization -- Kevin Walzer Code by Kevin http://www.codebykevin.com From kelsolaar_fool at hotmail.com Tue Oct 28 23:51:05 2008 From: kelsolaar_fool at hotmail.com (kelsolaar_fool at hotmail.com) Date: Tue, 28 Oct 2008 23:51:05 +0100 Subject: [Pythonmac-SIG] Py2App and PyQT Message-ID: Ok the QtCore.so problem got solved by adding this line into the __boot__.py : sys.path = [os.path.join(os.environ['RESOURCEPATH'], 'lib', 'python2.5', 'lib-dynload')] + sys.path Now I'm facing another really annoying problem : I need at some point to load jpeg images into my program and Qt jpeg support is done from a plugin library : libqjpeg.dylib under MacOsX and qjpeg4.dll on Windows. On Windows in order to make my packaged program use it (compiling with py2exe) I include a qt.conf file at the root of my software with this as content : [Paths] Prefix = ./PyQt4 Binaries = . and the dll is here : PyQt4\plugins\imageformats\qjpeg4.dll This is working fine, I tried the same or a lot of different locations and combinations on MacOsX and everything failed, resulting in blank thumbnails in my program. That is really annoying and can really compromise the release of it on Mac. Hope someone as an idea ? Thanx, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From janssen at parc.com Wed Oct 29 01:32:25 2008 From: janssen at parc.com (Bill Janssen) Date: Tue, 28 Oct 2008 17:32:25 PDT Subject: [Pythonmac-SIG] appscript and launching apps from "background-only" Python processes Message-ID: <11040.1225240345@parc.com> I'm starting a Python daemon using SystemStarter, and in it I'm using appscript to launch an app (Entourage). I get the following error: CantLaunchApplicationError: CantLaunchApplicationError -606: Application is background-only. If I start the same daemon from the command-line manually, it works fine. I'm guessing that some environment variable is not being set by SystemStarter, which is what makes it "background-only". Can anyone shed some light on this? Bill From jcmendez at alum.mit.edu Wed Oct 29 03:12:03 2008 From: jcmendez at alum.mit.edu (=?ISO-8859-1?Q?Juan_C._M=E9ndez?=) Date: Wed, 29 Oct 2008 10:12:03 +0800 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 66, Issue 30 In-Reply-To: References: Message-ID: <48a27ed0810281912g5ce1da81ocb6a310f765a430d@mail.gmail.com> I use Komodo and love it On Mon, Oct 27, 2008 at 7:00 PM, wrote: > Send Pythonmac-SIG mailing list submissions to > pythonmac-sig at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/pythonmac-sig > or, via email, send a message with subject or body 'help' to > pythonmac-sig-request at python.org > > You can reach the person managing the list at > pythonmac-sig-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Pythonmac-SIG digest..." > > > Today's Topics: > > 1. Py2App and PyQT (kelsolaar_fool at hotmail.com) > 2. Re: IDE that doesn't look awful? (David Warde-Farley) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 26 Oct 2008 17:13:09 +0100 > From: > Subject: [Pythonmac-SIG] Py2App and PyQT > To: > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hello, > > Now that I have my application running and packaged on Windows and Linux, I'm trying to get it working under Mac Os X ( Leopard 10.5.5 ). > Everything seem to be fine on compilation side, but when I launch my application I'm getting : > > Traceback (most recent call last): > File "/Volumes/sIBL/src/dist/sIBL_GUI.app/Contents/Resources/__boot__.py", line 137, in > _run('sIBL_GUI.py') > File "/Volumes/sIBL/src/dist/sIBL_GUI.app/Contents/Resources/__boot__.py", line 134, in _run > execfile(path, globals(), globals()) > File "/Volumes/sIBL/src/dist/sIBL_GUI.app/Contents/Resources/sIBL_GUI.py", line 71, in > from PyQt4.QtCore import * > File "PyQt4/QtCore.pyc", line 18, in > File "PyQt4/QtCore.pyc", line 15, in __load > ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/PyQt4/QtCore.so' not found > 2008-10-26 08:55:36.106 sIBL_GUI[432:10b] sIBL_GUI Error > 2008-10-26 08:55:36.117 sIBL_GUI[432:10b] sIBL_GUI Error > An unexpected error has occurred during execution of the main script > > ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/PyQt4/QtCore.so' not found > > This is pretty strange because I actually found that the file is correctly included in "dist/sIBL_GUI.app/Contents/Resources/lib/python2.5/lib-dynload/PyQt4/" directory. > Anyone faced this or have an idea ? > > Thanks, > > Thomas > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Mon, 27 Oct 2008 03:56:45 -0400 > From: David Warde-Farley > Subject: Re: [Pythonmac-SIG] IDE that doesn't look awful? > To: Joe Strout > Cc: Pythonmac-Sig > Message-ID: <7B6BA1FC-22D3-4E2B-8E97-AE83B8B93FC1 at cs.toronto.edu> > Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes > > On 20-Oct-08, at 5:46 PM, Joe Strout wrote: > >> Hi all, >> >> I'd heard good things about Wing IDE (including that it was written >> with wxPython, and I know that wxPython can make decent Mac apps >> with a bit of care). So I downloaded the disk image today, and man >> -- is it ever ugly! It's really not a Mac app at all, but an X- >> Window app, with all the usual cruft that brings. Even XCode is >> better than that. I know I shouldn't care, but... somehow, I do. >> >> Is there any Python IDE that looks and feels more like a proper Mac >> app? > > I have to echo an endorsement elsewhere in the thread for pydev on > Eclipse. It's really quite polished, and other than the weird tab > widgets that Eclipse/SWT uses, looks okay to me. > > David > > > End of Pythonmac-SIG Digest, Vol 66, Issue 30 > ********************************************* > From nad at acm.org Wed Oct 29 03:15:44 2008 From: nad at acm.org (Ned Deily) Date: Tue, 28 Oct 2008 19:15:44 -0700 Subject: [Pythonmac-SIG] appscript and launching apps from "background-only" Python processes References: <11040.1225240345@parc.com> Message-ID: In article <11040.1225240345 at parc.com>, Bill Janssen wrote: > I'm starting a Python daemon using SystemStarter, and in it I'm using > appscript to launch an app (Entourage). I get the following error: > > CantLaunchApplicationError: CantLaunchApplicationError -606: Application is > background-only. > > If I start the same daemon from the command-line manually, it works > fine. I'm guessing that some environment variable is not being set by > SystemStarter, which is what makes it "background-only". Can anyone > shed some light on this? I suspect the issue is that processes started by SystemStarter are not "connected" to the windowserver and are running as root so attempts to launch Carbon or Cocoa gui apps will fail. Tech note 2083 has a lot of details about this and the perils of launching gui apps from daemons: Also note that in 10.4, Apple introduced launchd which is intended to replace the various startup mechanisms including SystemStarter. launchd includes the capability to define system-wide as well as per-user LaunchAgents (triggered by various conditions) and LaunchDaemons. Peter Borg has written a nifty free app, Lingon, to simplify the creating and editing of launchd plists. HTH -- Ned Deily, nad at acm.org From janssen at parc.com Wed Oct 29 17:56:02 2008 From: janssen at parc.com (Bill Janssen) Date: Wed, 29 Oct 2008 09:56:02 PDT Subject: [Pythonmac-SIG] appscript and launching apps from "background-only" Python processes In-Reply-To: References: <11040.1225240345@parc.com> Message-ID: <92921.1225299362@parc.com> Ned Deily wrote: > Also note that in 10.4, Apple introduced launchd which is intended to > replace the various startup mechanisms including SystemStarter. launchd > includes the capability to define system-wide as well as per-user > LaunchAgents (triggered by various conditions) and LaunchDaemons. Yes. Unfortunately, my server doesn't conform to the rules for launchd daemons, and probably never will. Bill From janssen at parc.com Wed Oct 29 17:58:25 2008 From: janssen at parc.com (Bill Janssen) Date: Wed, 29 Oct 2008 09:58:25 PDT Subject: [Pythonmac-SIG] appscript and launching apps from "background-only" Python processes In-Reply-To: References: <11040.1225240345@parc.com> Message-ID: <92936.1225299505@parc.com> Ned Deily wrote: > In article <11040.1225240345 at parc.com>, Bill Janssen > wrote: > > > I'm starting a Python daemon using SystemStarter, and in it I'm using > > appscript to launch an app (Entourage). I get the following error: > > > > CantLaunchApplicationError: CantLaunchApplicationError -606: Application is > > background-only. > > > > If I start the same daemon from the command-line manually, it works > > fine. I'm guessing that some environment variable is not being set by > > SystemStarter, which is what makes it "background-only". Can anyone > > shed some light on this? > > I suspect the issue is that processes started by SystemStarter are not > "connected" to the windowserver and are running as root so attempts to > launch Carbon or Cocoa gui apps will fail. Tech note 2083 has a lot of > details about this and the perils of launching gui apps from daemons: > > Actually, the process is running under a regular user user-id, and only attempts to launch Entourage (to read the user's address book) when that user is logged in. The use case is kosher; what I need is a way to tell the system that. Bill From hengist.podd at virgin.net Wed Oct 29 19:50:37 2008 From: hengist.podd at virgin.net (has) Date: Wed, 29 Oct 2008 18:50:37 +0000 Subject: [Pythonmac-SIG] Python 2.6 / appscript 0.18.1 DeprecationWarnings fix Message-ID: Florian H?ch wrote: > I hope this is the correct place to send patches to :) As a general rule, best to submit patches directly to the project in question; saves cluttering up discussion lists. (The appscript project doesn't have a bug/patch tracker set up, but you can email patches directly to me.) > I noticed that appscript generates some DeprecationWarnings when used > with Python 2.6. Thanks for the feedback. Yes, I ran into this issue a couple weeks back while testing against Python 2.6 and have fixed it in the svn repository trunk. I've also fixed a Unicode problem caused by changes in how 2.6's UTF-16 codecs behave on OS X (a known issue), so if you're using 2.6 then I recommend installing the latest revision from svn if possible: svn checkout http://appscript.svn.sourceforge.net/svnroot/appscript/py-appscript/trunk py-appscript-trunk BTW, I'm aiming to get the long awaited 0.19.0 (beta 1) release out this week (I'd hoped to have it out sooner but I'm still polishing details), and will post an announcement when that happens. Regards, has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From sring at nd.edu Thu Oct 30 17:31:09 2008 From: sring at nd.edu (Sarah Ring) Date: Thu, 30 Oct 2008 12:31:09 -0400 Subject: [Pythonmac-SIG] py2app error 10810... Message-ID: <70a08d3b0810300931l3a6de6em65f085405068f593@mail.gmail.com> Hello, I'm a student, and I'm trying to turn just a simple python file into a .app with py2app. I installed py2app and it makes a .app folder, but it won't open for some reason. when I try "open hello.app" i get this error: LSOpenFromURLSpec() failed with error -10810 for the file /Users/***/Documents/epics/Fall08/hello.app Does anyone know what this means and how to resolve it? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Thu Oct 30 19:58:08 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 30 Oct 2008 11:58:08 -0700 Subject: [Pythonmac-SIG] py2app error 10810... In-Reply-To: <70a08d3b0810300931l3a6de6em65f085405068f593@mail.gmail.com> References: <70a08d3b0810300931l3a6de6em65f085405068f593@mail.gmail.com> Message-ID: <490A03C0.7020206@noaa.gov> Sarah Ring wrote: > LSOpenFromURLSpec() failed with error -10810 for the file > /Users/***/Documents/epics/Fall08/hello.app > > Does anyone know what this means and how to resolve it? I haven't seen that, but: Does it do the same thing when you double-click on it? Which version of py2app are you using? Which version of Python? What packages are you using? you might want to post your setup.py -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 joe at strout.net Thu Oct 30 20:35:54 2008 From: joe at strout.net (Joe Strout) Date: Thu, 30 Oct 2008 13:35:54 -0600 Subject: [Pythonmac-SIG] MySQLdb on OS X? Message-ID: I'm trying to get a project that uses MySQL going on OS X. Apparently Apple's default installation of Python doesn't include MySQLdb, so I downloaded it from , checked that mysql_config is in my path, and then did a "python setup.py build". This did a number of copies, and then failed while trying to build the '_mysql' extension: building '_mysql' extension creating build/temp.macosx-10.5-i386-2.5 gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused- madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes - DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -pipe - Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/usr/local/mysql/ include -I/System/Library/Frameworks/Python.framework/Versions/2.5/ include/python2.5 -c _mysql.c -o build/temp.macosx-10.5-i386-2.5/ _mysql.o -Os -arch i386 -fno-common In file included from /usr/local/mysql/include/mysql.h:47, from _mysql.c:40: /usr/include/sys/types.h:92: error: duplicate ?unsigned? /usr/include/sys/types.h:92: error: two or more data types in declaration specifiers error: command 'gcc' failed with exit status 1 So, my questions are: 1. Is this the best way to be accessing MySQL databases from Python on the Mac, or is there an easier approach I've overlooked? 2. If this is it, then does anyone have a clue how to fix the error above? 3. Or, does anyone already have a prebuilt MySQLdb package for OS X? Thanks, - Joe From hubert.hickman at gmail.com Thu Oct 30 21:12:06 2008 From: hubert.hickman at gmail.com (Hubert Hickman) Date: Thu, 30 Oct 2008 15:12:06 -0500 Subject: [Pythonmac-SIG] Making thin app with py2app Message-ID: Is there a flag for py2app that allows one to make a thin binary (Intel only)? I am building an app with the Oracle Instant Client, which is Intel only. Thanks! Hubert Hickman hubert.hickman at gmail.com From dwf at cs.toronto.edu Thu Oct 30 21:39:25 2008 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Thu, 30 Oct 2008 16:39:25 -0400 Subject: [Pythonmac-SIG] MySQLdb on OS X? In-Reply-To: References: Message-ID: <4CFD4E1D-28FC-42AA-93DD-9C52646A5045@cs.toronto.edu> On 30-Oct-08, at 3:35 PM, Joe Strout wrote: > building '_mysql' extension > creating build/temp.macosx-10.5-i386-2.5 > gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused- > madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes - > DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -pipe - > Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/usr/local/ > mysql/include -I/System/Library/Frameworks/Python.framework/Versions/ > 2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.5-i386-2.5/ > _mysql.o -Os -arch i386 -fno-common > In file included from /usr/local/mysql/include/mysql.h:47, > from _mysql.c:40: > /usr/include/sys/types.h:92: error: duplicate ?unsigned? > /usr/include/sys/types.h:92: error: two or more data types in > declaration specifiers > error: command 'gcc' failed with exit status 1 Whatever this is, it's specific to the system python. MySQLdb builds fine for me with the python.org release, but fails in exactly the same manner using Apple's python (which in my experience is chronically broken in one way or another, but there are now those among us who feel more positively about it. I'm guessing the system python's headers are doing something that conflicts with mysql's headers. If installing/using python.org python is an option, I'd recommend doing that. David From gary.bernhardt at gmail.com Fri Oct 31 18:26:23 2008 From: gary.bernhardt at gmail.com (Gary Bernhardt) Date: Fri, 31 Oct 2008 13:26:23 -0400 Subject: [Pythonmac-SIG] py2app doesn't work with virtualenv on Leopard Message-ID: <9c34c72e0810311026g5cf067d3y73afccb4fb8ee0b5@mail.gmail.com> I can't seem to get py2app to build an app in a virtualenv on Leopard. The "python setup.py py2app" command always fails in the same way with the exception show below. You can reproduce the problem by: 1. Create and activate a new virtualenv using the system Python (I used virtualenv 1.3 and my system Python is 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)) 2. Try to build the TinyTinyEdit example (I used the version in svn trunk) I did this on multiple Leopard machines, and on a fresh account, to verify that I hadn't broken my global Python install somehow. I find it hard to believe that py2app doesn't work with virtualenv, but I've run out of ideas as to what I could be doing wrong. Is anyone using these two together? Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/build_app.py", line 570, in _run self.run_normal() File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/build_app.py", line 641, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/build_app.py", line 749, in create_binaries mm.mm.run_file(runtime) File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/macholib/MachOGraph.py", line 65, in run_file raise ValueError('%r does not exist' % (pathname,)) ValueError: '/Users/grb/py2app-test/env/bin/../lib/libpython2.5.dylib' does not exist -- Gary http://blog.extracheese.org From Chris.Barker at noaa.gov Fri Oct 31 19:15:44 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 31 Oct 2008 11:15:44 -0700 Subject: [Pythonmac-SIG] py2app doesn't work with virtualenv on Leopard In-Reply-To: <9c34c72e0810311026g5cf067d3y73afccb4fb8ee0b5@mail.gmail.com> References: <9c34c72e0810311026g5cf067d3y73afccb4fb8ee0b5@mail.gmail.com> Message-ID: <490B4B50.2010702@noaa.gov> Gary Bernhardt wrote: > I can't seem to get py2app to build an app in a virtualenv on Leopard. > I find > it hard to believe that py2app doesn't work with virtualenv, Why? it was written before virtualenv existed, and I don't know that anyone has tested it with before -- I"d like to be able to do it, though, so thanks for trying! > raise ValueError('%r does not exist' % (pathname,)) > ValueError: '/Users/grb/py2app-test/env/bin/../lib/libpython2.5.dylib' > does not exist It looks like py2app is looking for the main python lib inside your virtualenv location, when it should be looking in the main python location. I don't know how py2app decides where to look, but it looks like it's expecting it to be somewhere relative to the bin directory. You may be able to fake it out by putting a bunch of extra symlinks in your virtual env, but clearly, py2app should figure out where to look in a different place. Sorry I can't be more helpful. -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 Oct 31 19:17:01 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 31 Oct 2008 11:17:01 -0700 Subject: [Pythonmac-SIG] Making thin app with py2app In-Reply-To: References: Message-ID: <490B4B9D.707@noaa.gov> Hubert Hickman wrote: > Is there a flag for py2app that allows one to make a thin binary (Intel > only)? py2app works by copying what it needs form teh Python install, so I think it would work if you used an Intel-ony build of Python. Otherwise, it would have to be hacked to remove the extra PPC stuff, and I have no idea how one would do that! -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 joe at strout.net Fri Oct 31 20:29:51 2008 From: joe at strout.net (Joe Strout) Date: Fri, 31 Oct 2008 13:29:51 -0600 Subject: [Pythonmac-SIG] py2app and plist entries Message-ID: I tried py2app on my wxPython for the first time today, expecting it to be a long and painful chore -- and was pleasantly surprised that it worked right off the bat. Now I'm wondering a bit about options, mainly for things that end up in the Info.plist file. I do see that I could build my own Info.plist and specify it with the --plist option, but I really don't believe that I know better than it does what should be in that file; I just want to tweak a couple of things, like the bundle identifier. I see how to set the icon file, but no way to set the bundle identifier, version strings, etc. Is there any way to do so? Also, the py2app help says that I can give --plist a dict. Anybody have an example of that? And do the options I give it that way become the entire Info.plist, or do they just override the corresponding entries of the autogenerated one? Finally, it also says --plist can be a "plistlib.Plist". What's that? Thanks, - Joe From hengist.podd at virgin.net Fri Oct 31 20:36:15 2008 From: hengist.podd at virgin.net (has) Date: Fri, 31 Oct 2008 19:36:15 +0000 Subject: [Pythonmac-SIG] py3-appscript Message-ID: <33BF0F31-0044-4679-B897-24EC1979024A@virgin.net> Hi all, For you interest, as part of prepping appscript 0.19.0 for release this week I've been porting it to Python 3.0 and have just done an initial check-in of the libraries, tests and some samples, which you're welcome to take a look at: svn co http://appscript.svn.sourceforge.net/svnroot/appscript/py3-appscript/trunk py3-appscript Documentation will be largely unchanged from the Python 2.x version, and I'll get it done shortly, along with the remaining sample scripts. Only major difference is that raw AE codes are bytes objects instead of str (only an issue if you're dipping into the lower-level aem APIs). Enjoy, has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From codyprecord at gmail.com Fri Oct 31 20:40:44 2008 From: codyprecord at gmail.com (Cody Precord) Date: Fri, 31 Oct 2008 14:40:44 -0500 Subject: [Pythonmac-SIG] py2app and plist entries In-Reply-To: References: Message-ID: Hello, On Fri, Oct 31, 2008 at 2:29 PM, Joe Strout wrote: > I tried py2app on my wxPython for the first time today, expecting it to be > a long and painful chore -- and was pleasantly surprised that it worked > right off the bat. > > Now I'm wondering a bit about options, mainly for things that end up in the > Info.plist file. I do see that I could build my own Info.plist and specify > it with the --plist option, but I really don't believe that I know better > than it does what should be in that file; I just want to tweak a couple of > things, like the bundle identifier. I see how to set the icon file, but no > way to set the bundle identifier, version strings, etc. Is there any way to > do so? > > Also, the py2app help says that I can give --plist a dict. Anybody have an > example of that? And do the options I give it that way become the entire > Info.plist, or do they just override the corresponding entries of the > autogenerated one? Here is an example: PLIST = dict(CFBundleName = info.PROG_NAME, CFBundleIconFile = 'Editra.icns', CFBundleShortVersionString = info.VERSION, CFBundleGetInfoString = info.PROG_NAME + " " + info.VERSION, CFBundleExecutable = info.PROG_NAME, CFBundleIdentifier = "org.editra.%s" % info.PROG_NAME.title(), CFBundleDocumentTypes = [dict(CFBundleTypeExtensions=synextreg.GetFileExtensions(), CFBundleTypeIconFile='editra_doc', CFBundleTypeRole="Editor" ), ], CFBundleTypeMIMETypes = ['text/plain',], CFBundleDevelopmentRegion = 'English', NSHumanReadableCopyright = u"Copyright %s 2005-%d" % (AUTHOR, YEAR) ) Then just pass this dictionary in the py2app options py2app_options = dict(plist=PLIST) setup(options=dict(py2app=py2app_opts), ...) Regards, Cody Precord -------------- next part -------------- An HTML attachment was scrubbed... URL: From robin at alldunn.com Fri Oct 31 20:41:47 2008 From: robin at alldunn.com (Robin Dunn) Date: Fri, 31 Oct 2008 12:41:47 -0700 Subject: [Pythonmac-SIG] py2app and plist entries In-Reply-To: References: Message-ID: <490B5F7B.7050504@alldunn.com> Joe Strout wrote: > I tried py2app on my wxPython for the first time today, expecting it to > be a long and painful chore -- and was pleasantly surprised that it > worked right off the bat. > > Now I'm wondering a bit about options, mainly for things that end up in > the Info.plist file. I do see that I could build my own Info.plist and > specify it with the --plist option, but I really don't believe that I > know better than it does what should be in that file; I just want to > tweak a couple of things, like the bundle identifier. I see how to set > the icon file, but no way to set the bundle identifier, version strings, > etc. Is there any way to do so? > > Also, the py2app help says that I can give --plist a dict. Anybody have > an example of that? And do the options I give it that way become the > entire Info.plist, or do they just override the corresponding entries of > the autogenerated one? > > Finally, it also says --plist can be a "plistlib.Plist". What's that? You've been working on Editra so you can look in its setup.py for an example. Basically you create a dictionary and pass it to setup() as one component of the options dictionary parameter. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! From gary.bernhardt at gmail.com Fri Oct 31 21:22:18 2008 From: gary.bernhardt at gmail.com (Gary Bernhardt) Date: Fri, 31 Oct 2008 16:22:18 -0400 Subject: [Pythonmac-SIG] py2app doesn't work with virtualenv on Leopard In-Reply-To: <490B4B50.2010702@noaa.gov> References: <9c34c72e0810311026g5cf067d3y73afccb4fb8ee0b5@mail.gmail.com> <490B4B50.2010702@noaa.gov> Message-ID: <9c34c72e0810311322g335e6eafm57bde9efc86c8a46@mail.gmail.com> On Fri, Oct 31, 2008 at 2:15 PM, Christopher Barker wrote: > Gary Bernhardt wrote: >> >> I can't seem to get py2app to build an app in a virtualenv on Leopard. >> I find >> it hard to believe that py2app doesn't work with virtualenv, > > Why? it was written before virtualenv existed, and I don't know that anyone > has tested it with before -- I"d like to be able to do it, though, so thanks > for trying! It just seems like people *must* be doing this. The idea of writing a non-trivial Python app in 2008 without virtualenv is unthinkable for me! I know Ronald has contributed to virtualenv, so clearly at least one person used it on the Mac at one point. >> raise ValueError('%r does not exist' % (pathname,)) >> ValueError: '/Users/grb/py2app-test/env/bin/../lib/libpython2.5.dylib' >> does not exist > > It looks like py2app is looking for the main python lib inside your > virtualenv location, when it should be looking in the main python location. > > I don't know how py2app decides where to look, but it looks like it's > expecting it to be somewhere relative to the bin directory. You may be able > to fake it out by putting a bunch of extra symlinks in your virtual env, but > clearly, py2app should figure out where to look in a different place. There's no .dylib in the system Python install, but if I copy libpython2.5.a to where py2app wants the .dylib to be, it will build an app. The resulting app fails at startup, though, with "ImportError: No module named dist". That error seems to come from within distutils itself (and yields no Google results). I've coaxed py2app into failing in many different ways with various combinations of virtualenv, workingenv and custom PYTHONPATH-managing scripts, but I didn't want to subject the list to the full details. :) I'd really like to know if anyone has made py2app work in *any* capacity with virtualenv, workingenv, etc. on Leopard. At this point I'd even be happy with some way to stick my libs in a directory and munge PYTHONPATH to load them, but even that doesn't seem to work! > Sorry I can't be more helpful. Every little bit helps. :) -- Gary http://blog.extracheese.org From p at ulmcnett.com Fri Oct 31 22:08:03 2008 From: p at ulmcnett.com (Paul McNett) Date: Fri, 31 Oct 2008 14:08:03 -0700 Subject: [Pythonmac-SIG] py2app doesn't work with virtualenv on Leopard In-Reply-To: <9c34c72e0810311322g335e6eafm57bde9efc86c8a46@mail.gmail.com> References: <9c34c72e0810311026g5cf067d3y73afccb4fb8ee0b5@mail.gmail.com> <490B4B50.2010702@noaa.gov> <9c34c72e0810311322g335e6eafm57bde9efc86c8a46@mail.gmail.com> Message-ID: <490B73B3.2050600@ulmcnett.com> Gary Bernhardt wrote: > On Fri, Oct 31, 2008 at 2:15 PM, Christopher Barker > wrote: >> Gary Bernhardt wrote: >>> I can't seem to get py2app to build an app in a virtualenv on Leopard. >>> I find >>> it hard to believe that py2app doesn't work with virtualenv, >> Why? it was written before virtualenv existed, and I don't know that anyone >> has tested it with before -- I"d like to be able to do it, though, so thanks >> for trying! > > It just seems like people *must* be doing this. The idea of writing a > non-trivial Python app in 2008 without virtualenv is unthinkable for > me! I know Ronald has contributed to virtualenv, so clearly at least > one person used it on the Mac at one point. I'm appreciating this thread because I'm building non-trivial desktop apps in Python/wxPython here in 2008 without virtualenv. However, I've read up on it and was planning on trying it out soon. Now that I know it won't work with py2app I'll probably hold off until I hear news to the contrary! Paul From Chris.Barker at noaa.gov Fri Oct 31 22:59:22 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 31 Oct 2008 14:59:22 -0700 Subject: [Pythonmac-SIG] py2app doesn't work with virtualenv on Leopard In-Reply-To: <9c34c72e0810311322g335e6eafm57bde9efc86c8a46@mail.gmail.com> References: <9c34c72e0810311026g5cf067d3y73afccb4fb8ee0b5@mail.gmail.com> <490B4B50.2010702@noaa.gov> <9c34c72e0810311322g335e6eafm57bde9efc86c8a46@mail.gmail.com> Message-ID: <490B7FBA.6080604@noaa.gov> Gary Bernhardt wrote: > It just seems like people *must* be doing this. You'd think! However, while lots of folks are using Python on OS-X, I think a huge percentage are doing home-grown stuff, and/or using it in a "unixy" way, and thus unlikely to need virtualenv, and even less likely need py2app. In general, py2app is not being actively updated, which is getting to be more an more of a problem. The developer of bb-freeze is showing interest in the Mac, so I have some hope of a bb-freeze--py2app merger, but it's not coming tomorrow. > The idea of writing a > non-trivial Python app in 2008 without virtualenv is unthinkable for > me! I've still gotten away without it, but yes, it is a pretty important tool. I think the question is whether you are building multiple apps that aren't equally actively maintained -- so far, I just use the same versions of all packages with all my apps, which requires them all being maintained when I upgrade a package. -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