From bfancher@mac.com Sun Sep 1 08:17:55 2002 From: bfancher@mac.com (bill fancher) Date: Sun, 1 Sep 2002 00:17:55 -0700 Subject: [Pythonmac-SIG] Need help debugging Python documentation install In-Reply-To: Message-ID: On Wednesday, August 28, 2002, at 02:41 PM, Jack Jansen wrote: > If someone could do the following: > - cvs update > - make frameworkinstall > - python setupDocs.py build > - python setupDocs.py install > - Run a script with Python.app, something that stays open for a while > so you can see the menu bar. Something like > import EasyDialogs > EasyDialogs.Message("Hello World") > should do the trick. > - Check whether there's a help menu, and whether the "Python Help" > entry will open the Python docs in help viewer. Got this far. It activates Help Viewer, but no docs turn up. (This with an clean checkout from CVS about an hour ago. Installing on clean 10.2.) > - Open Help Viewer manually and check whether the Python documentation > is mentioned in the index page. Not yet... > - Report your findings back here. I think applets are the wrong place for the docs. The end user typically cares nothing about Python and wants help with the current application. The Python docs should be where developers will have easy access: the IDE. There might be some call in the app framework that would add a "Python Documentation" item to the Help menu. It could be used by PythonIDE and any applets that feel it's helpful to provide access to the Python documentation. PythonIDE should probably be the only app to register the help book. The Help menu item might just send an AppleEvent to open the Python docs so as not to interfere with app specific help. MHO, -- bill From bfancher@mac.com Sun Sep 1 20:04:28 2002 From: bfancher@mac.com (bill fancher) Date: Sun, 1 Sep 2002 12:04:28 -0700 Subject: [Pythonmac-SIG] Need help debugging Python documentation install In-Reply-To: Message-ID: On Sunday, September 1, 2002, at 12:17 AM, bill fancher wrote: > > On Wednesday, August 28, 2002, at 02:41 PM, Jack Jansen wrote: > >> If someone could do the following: >> - cvs update >> - make frameworkinstall >> - python setupDocs.py build >> - python setupDocs.py install >> - Run a script with Python.app, something that stays open for a while=20= >> so you can see the menu bar. Something like >> import EasyDialogs >> EasyDialogs.Message("Hello World") >> should do the trick. >> - Check whether there's a help menu, and whether the "Python Help"=20 >> entry will open the Python docs in help viewer. > > Got this far. It activates Help Viewer, but no docs turn up. (This=20 > with an clean checkout from CVS about an hour ago. Installing on clean=20= > 10.2.) You skipped steps 3 and 4, dumbo. >> - Open Help Viewer manually and check whether the Python=20 >> documentation is mentioned in the index page. > > Not yet... > >> - Report your findings back here. > > I think applets are the wrong place for the docs. The end user=20 > typically cares nothing about Python and wants help with the current=20= > application. The Python docs should be where developers will have easy=20= > access: the IDE. > > There might be some call in the app framework that would add a "Python=20= > Documentation" item to the Help menu. It could be used by PythonIDE=20 > and any applets that feel it's helpful to provide access to the Python=20= > documentation. PythonIDE should probably be the only app to register=20= > the help book. The Help menu item might just send an AppleEvent to=20 > open the Python docs so as not to interfere with app specific help. Well, this is all very nice, but Jack's already done that (and more),=20 as you can plainly see now that you've followed the directions. Pay=20 attention! Apologies to the list for the noise. And thanks to Brian Lenihan for=20 off-list hand-holding and this fix: 'edit line 300 of PythonIDEMain.py=20= in /Library/Frameworks/Python.framework/Versions/Current/Mac/Tools/IDE=20= and change the last arg of the call to AHGotoPage from "" to None'. -- bill "They laughed at Columbus, they laughed at Fulton, they laughed at the=20= Wright brothers. But they also laughed at Bozo the Clown."=A0 Carl Sagan= From Jack.Jansen@oratrix.com Sun Sep 1 22:29:12 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sun, 1 Sep 2002 23:29:12 +0200 Subject: [Pythonmac-SIG] Need help debugging Python documentation install In-Reply-To: Message-ID: On zondag, september 1, 2002, at 09:04 , bill fancher wrote: > You skipped steps 3 and 4, dumbo. HEY! DON'T YOU GO CALLING NAMES AT ESTEEMED LIST MEMBERS LIKE BILL FANCHER HERE!!! :-) > And thanks to Brian Lenihan for off-list hand-holding and this > fix: 'edit line 300 of PythonIDEMain.py in > /Library/Frameworks/Python.framework/Versions/Current/Mac/Tools/IDE > and change the last arg of the call to AHGotoPage from "" to > None'. Ah, does that work? I didn't know (even though I wrote both the mod to the IDE and the underlying CFString converter:-), I'll change it in CVS (and also replace the "index.html" with a None). -- - 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 Jack.Jansen@oratrix.com Sun Sep 1 23:02:51 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Mon, 2 Sep 2002 00:02:51 +0200 Subject: [Pythonmac-SIG] Python documentation install - second try In-Reply-To: Message-ID: <8F4666CC-BDF6-11D6-AE84-003065517236@oratrix.com> Folks, I think I've added all the band-aid needed to make Python build again on Jaguar. Moreover, I've added stuff to the IDE to (a) tell help viewer about the Python documentation and (b) allow access to it from the IDE. The following should do the trick: - cvs update - make frameworkinstall - python setupDocs.py build - python setupDocs.py install - run PythonIDE The help menu should give you access to the Python docs and the Carbon docs, and a couple of online sources. Moreover, if you select something in an edit window (only edit windows, not output windows, unfortunately) you can use the "Lookup in Python docs" or "Lookup in Carbon docs" to open the specified documentation and use the selection as a query. I still want a couple of things, feedback is solicited: - Introductory documentation to MacPython-OSX. There should be basic documentation of the IDE, and some notes on python/pythonw/PythonLauncher. - Integration of help(). It would be nice if you could point at objects (in the debugger or the browser, for instance) and you could get the help info for that object. - Integration of help() with the documentation. It would be nice if help() had some way to get to the relevant section of the documentation. This is probably more a general problem than a Mac or IDE problem. -- - 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 wtbridgman@radix.net Sun Sep 1 22:50:06 2002 From: wtbridgman@radix.net (W.T. Bridgman) Date: Sun, 1 Sep 2002 17:50:06 -0400 Subject: [Pythonmac-SIG] Problem building PyXML v0.8 in Python v2.2 In-Reply-To: References: Message-ID: I've done a search and found that others have had this problem in the past two months, but it's not clear what or if a solution was found. When building PyXML from the terminal, [localhost:~/PyXML-0.8] bridgman% python setup.py build running build running build_py creating build creating build/lib.darwin-5.5-Power Macintosh-2.2 creating build/lib.darwin-5.5-Power Macintosh-2.2/_xmlplus copying xml/__init__.py -> build/lib.darwin-5.5-Power Macintosh-2.2/_xmlplus [ tons of stuff deleted] cc -g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp -DHAVE_EXPAT_H -DXML_BYTE_ORDER=21 -Iextensions/expat/lib -I/usr/local/include/python2.2 -c extensions/expat/lib/xmlrole.c -o build/temp.darwin-5.5-Power Macintosh-2.2/xmlrole.o cc -g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp -DHAVE_EXPAT_H -DXML_BYTE_ORDER=21 -Iextensions/expat/lib -I/usr/local/include/python2.2 -c extensions/expat/lib/xmltok.c -o build/temp.darwin-5.5-Power Macintosh-2.2/xmltok.o cc -bundle -flat_namespace -undefined suppress build/temp.darwin-5.5-Power Macintosh-2.2/pyexpat.o build/temp.darwin-5.5-Power Macintosh-2.2/xmlparse.o build/temp.darwin-5.5-Power Macintosh-2.2/xmlrole.o build/temp.darwin-5.5-Power Macintosh-2.2/xmltok.o -o build/lib.darwin-5.5-Power Macintosh-2.2/_xmlplus/parsers/pyexpat.so -flat_namespace /usr/bin/ld: -undefined: unknown argument: -lbundle1.o error: command 'cc' failed with exit status 1 Has anyone found a fix for this?? Not sure if it's relevant, but I recently had the embarassing experience of having makefiles for the CMake utility (used by VTK) die with weird compiler errors, like conflicting argument specifications. I was bugging anyone with an email address about this until I discovered it was due to ***spaces in the file paths***. Could the directory name 'temp.darwin-5.5-Power Macintosh-2.2' be causing problems for this build? If so, how do I fix that? Thanks, Tom From petrucha@isnet.sk Mon Sep 2 13:17:52 2002 From: petrucha@isnet.sk (Stefan Petrucha) Date: Mon, 02 Sep 2002 14:17:52 +0200 Subject: [Pythonmac-SIG] Patch proposition (Was: Problem when embedding classic) Message-ID: <3D7356F0.FAC082F9@isnet.sk> This is a multi-part message in MIME format. --------------5CAE4C09284F357404B0F7E1 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Several weeks ago I had a problem with embedding Python into a third party classic application. According to responses it had to work on 99%. Unfortunately my case fell into the rest. As I discovered later the problem relates to the initialization of MacPython - how it initializes the toolbox under classic. I was forced to change the sources. Summary: There is a new initialization function PyMac_InitEmbedded(int). Its argument propagates into init_mac_world() and serves to decide whether to initialize the graphics toolbox or not. I'm not sure whether not to initialize graphics could cause some problems somewhere later (with tkinter?), but this does not bother me currently as this is the only way how to make it (partially?) working. The proposed change is compatible with the whole existing codebase, just adds an additional possibility in the (dead?) classic branch. The attached file contains result of comparison of original and patched files, compared from within MPW on the 2.1.1 sources. (Unfortunately I just downloaded the 2.2.1 source so this comparison is not available yet.) Could it be possible to incorporate this change into mainstream? Stefan Petrucha -- http://www.isnet.sk/petrucha --------------5CAE4C09284F357404B0F7E1 Content-Type: text/plain; charset=iso-8859-15; name="differences.txt" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="differences.txt" compare :MacPython211src:Mac:Python:macmain.c :MacPython:Mac:Python:macmain.c File #1: :MacPython211src:Mac:Python:macmain.c File #2: :MacPython:Mac:Python:macmain.c Nonmatching lines (File ":MacPython211src:Mac:Python:macmain.c"; Line 105; File ":MacPython:Mac:Python:macmain.c"; Line 105) 105 init_mac_world() 105 init_mac_world(int embedded) Nonmatching lines (File ":MacPython211src:Mac:Python:macmain.c"; Line 110; File ":MacPython:Mac:Python:macmain.c"; Line 110:111) 110 InitGraf(&qd.thePort); 110 if(embedded < 2) 111 InitGraf(&qd.thePort); Nonmatching lines (File ":MacPython211src:Mac:Python:macmain.c"; Line 256; File ":MacPython:Mac:Python:macmain.c"; Line 257) 256 init_mac_world(); 257 init_mac_world(embedded); Extra lines in 2nd before 454 in 1st (File ":MacPython211src:Mac:Python:macmain.c"; Line Æ454; File ":MacPython:Mac:Python:macmain.c"; Line 455:463) 455 PyMac_InitEmbedded(1); 456 } 457 458 /* 459 ** Hook for embedding python (new). 460 */ 461 void 462 PyMac_InitEmbedded(int embedded) 463 { Nonmatching lines (File ":MacPython211src:Mac:Python:macmain.c"; Line 457; File ":MacPython:Mac:Python:macmain.c"; Line 467) 457 init_common(&argc, &argv, 1); 467 init_common(&argc, &argv, embedded); *** EOF on both files at the same time *** compare :MacPython211src:Mac:Include:macglue.h :MacPython:Mac:Include:macglue.h File #1: :MacPython211src:Mac:Include:macglue.h File #2: :MacPython:Mac:Include:macglue.h Extra lines in 2nd before 124 in 1st (File ":MacPython211src:Mac:Include:macglue.h"; Line Æ124; File ":MacPython:Mac:Include:macglue.h"; Line 124) 124 void PyMac_InitEmbedded(int); /* Initialize function for embedding Python */ *** EOF on both files at the same time *** compare :MacPython211src:Mac:Build:PythonCore.exp :MacPython:Mac:Build:PythonCore.exp File #1: :MacPython211src:Mac:Build:PythonCore.exp File #2: :MacPython:Mac:Build:PythonCore.exp Extra lines in 2nd before 729 in 1st (File ":MacPython211src:Mac:Build:PythonCore.exp"; Line Æ729; File ":MacPython:Mac:Build:PythonCore.exp"; Line 729) 729 PyMac_InitEmbedded *** EOF on both files at the same time *** --------------5CAE4C09284F357404B0F7E1-- From gherman@darwin.in-berlin.de Mon Sep 2 13:33:08 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Mon, 2 Sep 2002 14:33:08 +0200 Subject: [Pythonmac-SIG] 10.2 linking headaches Message-ID: <22CAC1E3-BE70-11D6-9609-00039345C610@darwin.in-berlin.de> Hi, I recently upgraded to OS X 10.2 plus the new dev tools update, but still get strange linking errors saying something about missing symbols, e.g. when compiling GNU Readline 4.3 (see below). Is this something related to Apple's switch to the new gcc 3.1, maybe? Regards, Dinu # ftp://ftp.gnu.org/pub/gnu/readline/readline-4.3.tar.gz dinu% ./configure ld: Undefined symbols: restFP saveFP _tgoto _tputs _tgetent _tgetflag _tgetnum _tgetstr /usr/bin/libtool: internal link edit command failed From petrucha@isnet.sk Mon Sep 2 13:38:24 2002 From: petrucha@isnet.sk (Stefan Petrucha) Date: Mon, 02 Sep 2002 14:38:24 +0200 Subject: [Pythonmac-SIG] Embedding & C utility routine question Message-ID: <3D735BC0.F401833E@isnet.sk> Sung Kim wrote: > I have a C app which puts up a GUI, and calls Python scripts. The > Python scripts write to stdout. After all is done, I see both the GUI > and the console window. But I'm having trouble making the console > active. I had a similar problem. Maybe my patch to MacPython (posted today) could help you at Adobe too. Regards, Stefan Petrucha -- http://www.isnet.sk/petrucha From Jack.Jansen@cwi.nl Mon Sep 2 16:14:09 2002 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Mon, 2 Sep 2002 17:14:09 +0200 Subject: [Pythonmac-SIG] Problem building PyXML v0.8 in Python v2.2 In-Reply-To: Message-ID: On Sunday, September 1, 2002, at 11:50 , W.T. Bridgman wrote: > cc -bundle -flat_namespace -undefined suppress > build/temp.darwin-5.5-Power Macintosh-2.2/pyexpat.o > build/temp.darwin-5.5-Power Macintosh-2.2/xmlparse.o > build/temp.darwin-5.5-Power Macintosh-2.2/xmlrole.o > build/temp.darwin-5.5-Power Macintosh-2.2/xmltok.o -o > build/lib.darwin-5.5-Power Macintosh-2.2/_xmlplus/parsers/pyexpat.so > -flat_namespace > /usr/bin/ld: -undefined: unknown argument: -lbundle1.o > error: command 'cc' failed with exit status 1 Very strange... There's no "-lbundle1.o" anywhere on your command line... You don't have anything set in your LDFLAGS environment variable, or in another environment variable that could be picked up by ld or cc? Alternatively, it is complaining about the value to the -undefined option, but why it would be reading "suppress" as "-lbundle1.o" is beyond me... -- - 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 Jack.Jansen@cwi.nl Mon Sep 2 16:17:56 2002 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Mon, 2 Sep 2002 17:17:56 +0200 Subject: [Pythonmac-SIG] 10.2 linking headaches In-Reply-To: <22CAC1E3-BE70-11D6-9609-00039345C610@darwin.in-berlin.de> Message-ID: <28545C06-BE87-11D6-ADDA-0030655234CE@cwi.nl> On Monday, September 2, 2002, at 02:33 , Dinu Gherman wrote: > # ftp://ftp.gnu.org/pub/gnu/readline/readline-4.3.tar.gz > > dinu% ./configure > ld: Undefined symbols: > restFP > saveFP > _tgoto > _tputs > _tgetent > _tgetflag > _tgetnum > _tgetstr > /usr/bin/libtool: internal link edit command failed I was just going through the release notes and noticed Apple have replaced the extremely old curses that they shipped under 10.1 and earlier with ncurses. My guess is that this may have removed these termcap routines from libc and you now have to link with the ncurses library or some such. The question remains why configure doesn't detect this... -- - 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 wtbridgman@radix.net Mon Sep 2 19:53:29 2002 From: wtbridgman@radix.net (W.T. Bridgman) Date: Mon, 2 Sep 2002 14:53:29 -0400 Subject: [Pythonmac-SIG] Problem building PyXML v0.8 in Python v2.2 In-Reply-To: References: Message-ID: Jack, There is the 'cc -bundle' part as though it thinks it's a library. About the only environment variables I've changed are CVSROOT. I'm running a straight default build. This is what has me wondering about the spaces in the file paths. The line parser for cc could be interpreting the entire line in very strange ways. I know it drove me up a wall for several weeks trying to solve an earlier problem before I hit on that. Just where does this system get the 'darwin-5.5-Power Macintosh-2.2' string in the path? I've looked in the setup.py file with no luck. I have found >>> os.uname() ('Darwin', 'localhost', '5.5', 'Darwin Kernel Version 5.5: Thu May 30 14:51:26 PDT 2002; root:xnu/xnu-201.42.3.obj~1/RELEASE_PPC ', 'Power Macintosh') which might be from whence this string hails. However, I see it's a tuple so changing it might be tricky. Any other thoughts? Tom >On Sunday, September 1, 2002, at 11:50 , W.T. Bridgman wrote: > >>cc -bundle -flat_namespace -undefined suppress >>build/temp.darwin-5.5-Power Macintosh-2.2/pyexpat.o >>build/temp.darwin-5.5-Power Macintosh-2.2/xmlparse.o >>build/temp.darwin-5.5-Power Macintosh-2.2/xmlrole.o >>build/temp.darwin-5.5-Power Macintosh-2.2/xmltok.o -o >>build/lib.darwin-5.5-Power >>Macintosh-2.2/_xmlplus/parsers/pyexpat.so -flat_namespace >>/usr/bin/ld: -undefined: unknown argument: -lbundle1.o >>error: command 'cc' failed with exit status 1 > >Very strange... There's no "-lbundle1.o" anywhere on your command >line... You don't have anything set in your LDFLAGS environment >variable, or in another environment variable that could be picked up >by ld or cc? Alternatively, it is complaining about the value to the >-undefined option, but why it would be reading "suppress" as >"-lbundle1.o" is beyond me... >-- >- 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 wtbridgman@radix.net Mon Sep 2 20:45:04 2002 From: wtbridgman@radix.net (W.T. Bridgman) Date: Mon, 2 Sep 2002 15:45:04 -0400 Subject: [Pythonmac-SIG] Problem building PyXML v0.8 in Python v2.2 In-Reply-To: References: Message-ID: Jack, Okay, it's not the filepath spaces. I found the paths built in /usr/local/lib/python2.2/distutils/util.py and found the variable machine, forcing it to 'Power_Macintosh'. The last command fails with the same error: cc -bundle -flat_namespace -undefined suppress build/temp.darwin-5.5-Power_Macintosh-2.2/pyexpat.o build/temp.darwin-5.5-Power_Macintosh-2.2/xmlparse.o build/temp.darwin-5.5-Power_Macintosh-2.2/xmlrole.o build/temp.darwin-5.5-Power_Macintosh-2.2/xmltok.o -o build/lib.darwin-5.5-Power_Macintosh-2.2/_xmlplus/parsers/pyexpat.so -flat_namespace /usr/bin/ld: -undefined: unknown argument: -lbundle1.o error: command 'cc' failed with exit status 1 So much for that idea. Now let me get out of 'root' before I hurt myself... ;^) Tom >Jack, > >There is the 'cc -bundle' part as though it thinks it's a library. >About the only environment variables I've changed are CVSROOT. I'm >running a straight default build. > >This is what has me wondering about the spaces in the file paths. >The line parser for cc could be interpreting the entire line in very >strange ways. I know it drove me up a wall for several weeks trying >to solve an earlier problem before I hit on that. > >Just where does this system get the 'darwin-5.5-Power Macintosh-2.2' >string in the path? I've looked in the setup.py file with no luck. >I have found > >>>> os.uname() >('Darwin', 'localhost', '5.5', 'Darwin Kernel Version 5.5: Thu May >30 14:51:26 PDT 2002; root:xnu/xnu-201.42.3.obj~1/RELEASE_PPC ', >'Power Macintosh') > > which might be from whence this string hails. However, I see it's >a tuple so changing it might be tricky. > >Any other thoughts? > >Tom > >>On Sunday, September 1, 2002, at 11:50 , W.T. Bridgman wrote: >> >>>cc -bundle -flat_namespace -undefined suppress >>>build/temp.darwin-5.5-Power Macintosh-2.2/pyexpat.o >>>build/temp.darwin-5.5-Power Macintosh-2.2/xmlparse.o >>>build/temp.darwin-5.5-Power Macintosh-2.2/xmlrole.o >>>build/temp.darwin-5.5-Power Macintosh-2.2/xmltok.o -o >>>build/lib.darwin-5.5-Power >>>Macintosh-2.2/_xmlplus/parsers/pyexpat.so -flat_namespace >>>/usr/bin/ld: -undefined: unknown argument: -lbundle1.o >>>error: command 'cc' failed with exit status 1 >> >>Very strange... There's no "-lbundle1.o" anywhere on your command >>line... You don't have anything set in your LDFLAGS environment >>variable, or in another environment variable that could be picked >>up by ld or cc? Alternatively, it is complaining about the value to >>the -undefined option, but why it would be reading "suppress" as >>"-lbundle1.o" is beyond me... >>-- >>- Jack Jansen >>http://www.cwi.nl/~jack - >>- If I can't dance I don't want to be part of your revolution -- >>Emma Goldman - > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig From Jack.Jansen@cwi.nl Tue Sep 3 10:23:16 2002 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Tue, 3 Sep 2002 11:23:16 +0200 Subject: [Pythonmac-SIG] Problem building PyXML v0.8 in Python v2.2 In-Reply-To: Message-ID: On Monday, September 2, 2002, at 08:53 , W.T. Bridgman wrote: > Jack, > > There is the 'cc -bundle' part as though it thinks it's a library. > About the only environment variables I've changed are CVSROOT. I'm > running a straight default build. > > This is what has me wondering about the spaces in the file paths. The > line parser for cc could be interpreting the entire line in very > strange ways. I know it drove me up a wall for several weeks trying to > solve an earlier problem before I hit on that. > > Just where does this system get the 'darwin-5.5-Power Macintosh-2.2' > string in the path? I've looked in the setup.py file with no luck. The spaces aren't a problem. At least, they aren't for anyone else:-) Distutils creates everything under the "build" directory, and the lib and temp directory names are created using the architecture, OS and OS Version strings, so you can build for multiple architectures in one source directory. Did you build your Python from source, yourself? Because the strange thing is that this exact identical command line has been used to link all of the dynamic extension modules... If you're sure you don't have any funny environment variables set (I would double check, if I were you, by creating a new user and trying the install as that user (without copying your login settings and such, of course:-), and I would also check setup.py and/or distutils for putenv() calls) then maybe could there be a funny cc somewhere on your path? Hmm, another thing you could try: run the given command line manually (don't forget to quote the filenames because of the spaces) and see what happens? Maybe setup isn't executing the same command line as it's printing? (Although I wouldn't know why...) -- - 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 wtbridgman@radix.net Wed Sep 4 02:51:58 2002 From: wtbridgman@radix.net (W.T. Bridgman) Date: Tue, 3 Sep 2002 21:51:58 -0400 Subject: [Pythonmac-SIG] Problem building PyXML v0.8 in Python v2.2 In-Reply-To: References: Message-ID: Jack, Got it!! :^) The alternate user didn't work, nor did the single command line, but the single command line commenting out the last -flat_namespace does! In the setup.py in PyXML, there's a line: if sys.platform[:6] == "darwin": # Mac OS X LDFLAGS.append('-flat_namespace') I commented out the LDFLAGS line and that seemed to clear the problem. I suspect this was added at one time for PyXML but then was later incorporated into the rest of the distutils package? Looks like the rest of the build process worked as well. Thanks for the pointer. How does one report this so it is fixed in the next release? Tom >On Monday, September 2, 2002, at 08:53 , W.T. Bridgman wrote: > >>Jack, >> >>There is the 'cc -bundle' part as though it thinks it's a library. >>About the only environment variables I've changed are CVSROOT. I'm >>running a straight default build. >> >>This is what has me wondering about the spaces in the file paths. >>The line parser for cc could be interpreting the entire line in >>very strange ways. I know it drove me up a wall for several weeks >>trying to solve an earlier problem before I hit on that. >> >>Just where does this system get the 'darwin-5.5-Power >>Macintosh-2.2' string in the path? I've looked in the setup.py >>file with no luck. > >The spaces aren't a problem. At least, they aren't for anyone >else:-) Distutils creates everything under the "build" directory, >and the lib and temp directory names are created using the >architecture, OS and OS Version strings, so you can build for >multiple architectures in one source directory. > >Did you build your Python from source, yourself? Because the strange >thing is that this exact identical command line has been used to >link all of the dynamic extension modules... > >If you're sure you don't have any funny environment variables set (I >would double check, if I were you, by creating a new user and trying >the install as that user (without copying your login settings and >such, of course:-), and I would also check setup.py and/or distutils >for putenv() calls) then maybe could there be a funny cc somewhere >on your path? > >Hmm, another thing you could try: run the given command line >manually (don't forget to quote the filenames because of the spaces) >and see what happens? Maybe setup isn't executing the same command >line as it's printing? (Although I wouldn't know why...) >-- >- Jack Jansen >http://www.cwi.nl/~jack - >- If I can't dance I don't want to be part of your revolution -- >Emma Goldman - > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig From calvin@xmission.com Wed Sep 4 05:36:55 2002 From: calvin@xmission.com (Calvin) Date: Tue, 3 Sep 2002 22:36:55 -0600 (MDT) Subject: [Pythonmac-SIG] mac and readline Message-ID: Any idea how to get readline working on mac os x 10.2? I rebuilt from sources. I didn't get _socket so I copied it over from the default install, but I still couldn't get readline working. It is so very useful. Is there anything special I need to do? I just did a vanilla build. thanks -calvin From dkwolfe@pacbell.net Wed Sep 4 08:43:13 2002 From: dkwolfe@pacbell.net (Dan Wolfe) Date: Wed, 04 Sep 2002 00:43:13 -0700 Subject: [Pythonmac-SIG] mac and readline In-Reply-To: Message-ID: On 10.2, there's a later ncurses lib added which mucks up the readline 4.3 build. I haven't had time to figure it out yet. Not all is lost, however, as v4.2 still works like a charm. Here's the recipe to get you going: Installed readline-4.2.tar.gz - ftp://ftp.gnu.org/pub/gnu/readline/readline-4.2.tar.gz - gnutar -xvzf readline-4.2.tar.gz - cd readline-4.2 - ./configure - make clean - make - sudo make install - sudo mv /usr/local/man/man3/* /usr/share/man/man3/ Note: you'll need to build and install readline before building python 2.2.1. The pre-installed 2.2 version does not have readline support. - Dan On Tuesday, September 3, 2002, at 09:36 PM, Calvin wrote: > Any idea how to get readline working on mac os x 10.2? I rebuilt from > sources. I didn't get _socket so I copied it over from the default > install, but I still couldn't get readline working. > > It is so very useful. Is there anything special I need to do? I just > did > a vanilla build. From stephenm@humongous.com Wed Sep 4 18:41:27 2002 From: stephenm@humongous.com (Magladry, Stephen) Date: Wed, 4 Sep 2002 10:41:27 -0700 Subject: [Pythonmac-SIG] problem importing python packages Message-ID: <151590CD351823429A7EBA135BEEAD5801ADE819@sea-horse.humongous.com> I'm having problems with importing Python packages and the PythonInterpreter. Here is a minimal project that duplicates the problem. First I have a Python Package "bitt". file "__init__.py" in folder "bitt" in folder "Python 2.2.1" in folder "Applications" __init__.py has the following content: ~~~ startFile __init__.py ~~~~~~~~~~~~~~~~~~~` import sys print "initing bitt" if( __name__ == "__main__" ): print "WARNING: don't do this" sys.exit() ~~~ endFile __init__.py ~~~~~~~~~~~~~~~~~~~~ There is a second file, a Python source file, "btest.py". file "btest.py" in folder "Python 2.2.1" in folder "Applications" btest.py has the following content: ~~~ startFile btest.py ~~~~~~~~~~~~~~~~~~~` def bitt(): import bitt print "I'm back" if ( __name__=="__main__" ): bitt() ~~~ endFile btest.py ~~~~~~~~~~~~~~~~~~~~ if I drop btest.py on the PythonInterpreter, I get the following output: initing bitt I'm back if I open the PythonInterpreter and then do the following commands, >>> import btest >>> btest.bitt() I get these results: Traceback (most recent call last): File "", line 1, in ? File "btest2.py", line 3, in bitt import bitt ImportError: No module named bitt So the PythonInterpreter can not find the Python Package "bitt" from the imported module. The importing method works with the Python IDE, but I need this to work with the PythonInterpreter. Also, this same code works on Windows either using "btest.py" as a parameter to Python or importing it into the Python shell. Anyone know what is going wrong and how to fix it? Can anyone give me some hints where to look to fix this problem? Thanks, Stephen Magladry From stephenm@humongous.com Wed Sep 4 19:15:09 2002 From: stephenm@humongous.com (Magladry, Stephen) Date: Wed, 4 Sep 2002 11:15:09 -0700 Subject: [Pythonmac-SIG] RE: problem importing python packages Message-ID: <151590CD351823429A7EBA135BEEAD5801ADE81A@sea-horse.humongous.com> Problem solved I have a weird path problem. By dropping btest.py on PythonInterpreter the paths where setup correctly. Using the PythonInterpreter and doing the import and the paths were incorrect. Now I get to figure out why my paths are incorrect. Thanks for reading, Stephen -----Original Message----- From: Magladry, Stephen Sent: Wednesday, September 04, 2002 10:41 AM To: 'pythonmac-sig@python.org' Subject: problem importing python packages I'm having problems with importing Python packages and the PythonInterpreter. Here is a minimal project that duplicates the problem. First I have a Python Package "bitt". file "__init__.py" in folder "bitt" in folder "Python 2.2.1" in folder "Applications" __init__.py has the following content: ~~~ startFile __init__.py ~~~~~~~~~~~~~~~~~~~` import sys print "initing bitt" if( __name__ == "__main__" ): print "WARNING: don't do this" sys.exit() ~~~ endFile __init__.py ~~~~~~~~~~~~~~~~~~~~ There is a second file, a Python source file, "btest.py". file "btest.py" in folder "Python 2.2.1" in folder "Applications" btest.py has the following content: ~~~ startFile btest.py ~~~~~~~~~~~~~~~~~~~` def bitt(): import bitt print "I'm back" if ( __name__=="__main__" ): bitt() ~~~ endFile btest.py ~~~~~~~~~~~~~~~~~~~~ if I drop btest.py on the PythonInterpreter, I get the following output: initing bitt I'm back if I open the PythonInterpreter and then do the following commands, >>> import btest >>> btest.bitt() I get these results: Traceback (most recent call last): File "", line 1, in ? File "btest2.py", line 3, in bitt import bitt ImportError: No module named bitt So the PythonInterpreter can not find the Python Package "bitt" from the imported module. The importing method works with the Python IDE, but I need this to work with the PythonInterpreter. Also, this same code works on Windows either using "btest.py" as a parameter to Python or importing it into the Python shell. Anyone know what is going wrong and how to fix it? Can anyone give me some hints where to look to fix this problem? Thanks, Stephen Magladry From Jack.Jansen@oratrix.com Wed Sep 4 21:35:08 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Wed, 4 Sep 2002 13:35:08 -0700 Subject: [Pythonmac-SIG] RE: problem importing python packages In-Reply-To: <151590CD351823429A7EBA135BEEAD5801ADE81A@sea-horse.humongous.com> Message-ID: On woensdag, sep 4, 2002, at 11:15 US/Pacific, Magladry, Stephen wrote: > Problem solved I have a weird path problem. > > By dropping btest.py on PythonInterpreter the paths where setup > correctly. > Using the PythonInterpreter and doing the import and the paths were > incorrect. Now I get to figure out why my paths are incorrect. > Actually, the paths were correct in both cases, but maybe not what you expected:-). If you run a script then the scripts' directory is in sys.path. If you don't run a script but an interactive interpreter then Python's home directory is in sys.path. From stephenm@humongous.com Wed Sep 4 22:37:52 2002 From: stephenm@humongous.com (Magladry, Stephen) Date: Wed, 4 Sep 2002 14:37:52 -0700 Subject: [Pythonmac-SIG] RE: problem importing python packages Message-ID: <151590CD351823429A7EBA135BEEAD5801ADE81B@sea-horse.humongous.com> Yea, that's what I figured out. I had two version of Python on my machine. The import method was broken because the alias in the preference folder pointed to the "wrong" Python folder. Once I updated the Python Alias in the preference folder, everything worked as expected. Thanks for the reply, Stephen -----Original Message----- From: Jack Jansen [mailto:Jack.Jansen@oratrix.com] Sent: Wednesday, September 04, 2002 1:35 PM To: Magladry, Stephen Cc: 'pythonmac-sig@python.org' Subject: Re: [Pythonmac-SIG] RE: problem importing python packages On woensdag, sep 4, 2002, at 11:15 US/Pacific, Magladry, Stephen wrote: > Problem solved I have a weird path problem. > > By dropping btest.py on PythonInterpreter the paths where setup > correctly. > Using the PythonInterpreter and doing the import and the paths were > incorrect. Now I get to figure out why my paths are incorrect. > Actually, the paths were correct in both cases, but maybe not what you expected:-). If you run a script then the scripts' directory is in sys.path. If you don't run a script but an interactive interpreter then Python's home directory is in sys.path. From bfancher@mac.com Thu Sep 5 00:38:23 2002 From: bfancher@mac.com (bill fancher) Date: Wed, 4 Sep 2002 16:38:23 -0700 Subject: [Pythonmac-SIG] mac and readline In-Reply-To: Message-ID: <66AC5226-C05F-11D6-B8CA-0005029E8B13@mac.com> On Tuesday, September 3, 2002, at 09:36 PM, Calvin wrote: > Any idea how to get readline working on mac os x 10.2? I rebuilt from > sources. I didn't get _socket so I copied it over from the default > install, but I still couldn't get readline working. It should be pretty automagic. I had to fudge a bit to get readline 4.3 to compile (change line 76 of shlib/Makefile to "SHLIB_LIBS = -lSystem -lCurses -lcc_dynamic".) Once it's installed, run configure before running make. That should detect readline and set up your Makefile accordingly. It's always worked for me. > It is so very useful. It makes Python usable in Terminal. (Readline is actually part of the OS distribution, but it lives in a private framework. We could probably engineer things to link to what's already there, so that the Macho binary distribution could use it, but I suspect that some might frown on that idea, perhaps rightly so...) > Is there anything special I need to do? I just did > a vanilla build. Can't think of anything else. Running configure after installing readline is the crucial step. -- bill From kmarek@mac.com Thu Sep 5 21:08:10 2002 From: kmarek@mac.com (Kurt Marek) Date: Thu, 5 Sep 2002 13:08:10 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? Message-ID: <333278C2-C10B-11D6-9054-0050E479277C@mac.com> I'm pretty much a newbie to Python on the Mac. I notice that there are no less than three different distributions. Which one is going to turn into the 'default' version for OSX allowing both cli use and an Aqua TK IDLE? I've read through some of the posts in the archives which try to explain this issue, but it just seems to be getting more complicated. Is one of these distros taking the lead for offering mainstream Python on OSX? thanks, Kurt From rafferty29@mchsi.com Thu Sep 5 21:15:58 2002 From: rafferty29@mchsi.com (Rob Bedford) Date: Thu, 5 Sep 2002 15:15:58 -0500 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <333278C2-C10B-11D6-9054-0050E479277C@mac.com> Message-ID: <4A6CB0DD-C10C-11D6-90FB-00039374C97A@mchsi.com> Along this path I want to upgrade to Jaguar and use the installed Python is there a compatible AquaTk? Thanks On Thursday, September 5, 2002, at 03:08 PM, Kurt Marek wrote: > I'm pretty much a newbie to Python on the Mac. I notice that there are > no less than three different distributions. Which one is going to turn > into the 'default' version for OSX allowing both cli use and an Aqua TK > IDLE? I've read through some of the posts in the archives which try to > explain this issue, but it just seems to be getting more complicated. > Is one of these distros taking the lead for offering mainstream Python > on OSX? > > thanks, > Kurt > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From tony@lownds.com Thu Sep 5 23:05:35 2002 From: tony@lownds.com (Tony Lownds) Date: Thu, 5 Sep 2002 15:05:35 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <4A6CB0DD-C10C-11D6-90FB-00039374C97A@mchsi.com> References: <4A6CB0DD-C10C-11D6-90FB-00039374C97A@mchsi.com> Message-ID: What would you like? I'm still very interested in working on Tkinter. I'm intending on making an "install_IDLE" command for posting on sf.net (about 50% done with it). I share the impression of complication in Python MacOSX land, there are so many things in the air. AquaTk's last snapshot is really old and fixes bugs that are destined to be FAQs if it's the one people use. I have been assuming that Jack's 2.3 distro will be the leading distribution. He's been adding lots of build changes to CVS lately - probably just waiting for an Alpha. Jack, if I write an install_IDLE command, how likely would it be that IDLE could be included? How long is it before some alpha or pre-alpha releases? If IDLE isn't included in Jack's distro, I will be producing a Tkinter add-on package which includes IDLE and the Tkinter demos. I don't find the current built-from CVS very easy to use yet (too many other apps take over my .py mapping I think) as a package writer - maybe if ~/Library/Python is added to a path so people could install by dragging and dropping. -Tony At 3:15 PM -0500 9/5/02, Rob Bedford wrote: >Along this path I want to upgrade to Jaguar and use the installed >Python is there a compatible AquaTk? > >Thanks > >On Thursday, September 5, 2002, at 03:08 PM, Kurt Marek wrote: > >>I'm pretty much a newbie to Python on the Mac. I notice that there >>are no less than three different distributions. Which one is going >>to turn into the 'default' version for OSX allowing both cli use >>and an Aqua TK IDLE? I've read through some of the posts in the >>archives which try to explain this issue, but it just seems to be >>getting more complicated. Is one of these distros taking the lead >>for offering mainstream Python on OSX? >> >>thanks, >>Kurt >> >> >>_______________________________________________ >>Pythonmac-SIG maillist - Pythonmac-SIG@python.org >>http://mail.python.org/mailman/listinfo/pythonmac-sig >> > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig From rafferty29@mchsi.com Thu Sep 5 23:17:18 2002 From: rafferty29@mchsi.com (Rob Bedford) Date: Thu, 5 Sep 2002 17:17:18 -0500 Subject: Fwd: [Pythonmac-SIG] What is the future of Python on OSX? Message-ID: <3D76880D-C11D-11D6-90FB-00039374C97A@mchsi.com> My motivation is that I am probably going to DC for an extended work assignment and while the targets will mostly be UNIX and Windows I want the option of working on my Mac at night trying things out. Currently I can use the Python that runs on XWindows with the Fink installer however the site says Fink is broke in Jaguar. While I would like to upgrade to Jaguar my internet connection and resources could be spotty and I want to leave with the best option available. So I figured I would ask for feedback via the experts ;-) > > On Thursday, September 5, 2002, at 05:05 PM, Tony Lownds wrote: > >> What would you like? I'm still very interested in working on Tkinter. >> I'm intending on making an "install_IDLE" command for posting on >> sf.net (about 50% done with it). I share the impression of >> complication in Python MacOSX land, there are so many things in the >> air. AquaTk's last snapshot is really old and fixes bugs that are >> destined to be FAQs if it's the one people use. I have been assuming >> that Jack's 2.3 distro will be the leading distribution. He's been >> adding lots of build changes to CVS lately - probably just waiting for >> an Alpha. Jack, if I write an install_IDLE command, how likely would >> it be that IDLE could be included? How long is it before some alpha or >> pre-alpha releases? >> >> If IDLE isn't included in Jack's distro, I will be producing a Tkinter >> add-on package which includes IDLE and the Tkinter demos. I don't find >> the current built-from CVS very easy to use yet (too many other apps >> take over my .py mapping I think) as a package writer - maybe if >> ~/Library/Python is added to a path so people could install by >> dragging and dropping. >> >> -Tony >> >> >> >> At 3:15 PM -0500 9/5/02, Rob Bedford wrote: >>> Along this path I want to upgrade to Jaguar and use the installed >>> Python is there a compatible AquaTk? >>> >>> Thanks >>> >>> On Thursday, September 5, 2002, at 03:08 PM, Kurt Marek wrote: >>> >>>> I'm pretty much a newbie to Python on the Mac. I notice that there >>>> are no less than three different distributions. Which one is going >>>> to turn into the 'default' version for OSX allowing both cli use and >>>> an Aqua TK IDLE? I've read through some of the posts in the archives >>>> which try to explain this issue, but it just seems to be getting >>>> more complicated. Is one of these distros taking the lead for >>>> offering mainstream Python on OSX? >>>> >>>> thanks, >>>> Kurt >>>> >>>> >>>> _______________________________________________ >>>> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >>>> http://mail.python.org/mailman/listinfo/pythonmac-sig >>>> >>> >>> >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >> > From bob@redivi.com Thu Sep 5 23:20:43 2002 From: bob@redivi.com (Bob Ippolito) Date: Thu, 5 Sep 2002 18:20:43 -0400 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <4A6CB0DD-C10C-11D6-90FB-00039374C97A@mchsi.com> Message-ID: The installed python will not run any GUI application (I suppose it could possibly talk to X11, if you've got that installed) without use of undocumented ninja magic that's quite likely to break things... I've done something similar before with 10.1, but I really don't recommend it... Likely, it might not even work because the jaguar python isn't a framework build. -bob On Thursday, Sep 5, 2002, at 16:15 US/Eastern, Rob Bedford wrote: > Along this path I want to upgrade to Jaguar and use the installed > Python is there a compatible AquaTk? > > Thanks > > On Thursday, September 5, 2002, at 03:08 PM, Kurt Marek wrote: > >> I'm pretty much a newbie to Python on the Mac. I notice that there >> are no less than three different distributions. Which one is going to >> turn into the 'default' version for OSX allowing both cli use and an >> Aqua TK IDLE? I've read through some of the posts in the archives >> which try to explain this issue, but it just seems to be getting more >> complicated. Is one of these distros taking the lead for offering >> mainstream Python on OSX? >> >> thanks, >> Kurt From tony@lownds.com Thu Sep 5 23:32:44 2002 From: tony@lownds.com (Tony Lownds) Date: Thu, 5 Sep 2002 15:32:44 -0700 Subject: Fwd: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <3D76880D-C11D-11D6-90FB-00039374C97A@mchsi.com> References: <3D76880D-C11D-11D6-90FB-00039374C97A@mchsi.com> Message-ID: With some CVS knowledge I can guide you through getting an IDLE that works. What I can't do is make a snapshot - I'm not set up to make a good featureful snapshot on a regular basis. Tk is the harder part - Python is easy to get/use from CVS. See http://www.geocrawler.com/lists/3/SourceForge/7933/0/7986005/for Tk, and http://sourceforge.net/cvs/?group_id=5470 for Python. In a pinch my website has a version of the Tcl/Tk stuff, which I haven't tried since 10.1. -Tony At 5:17 PM -0500 9/5/02, Rob Bedford wrote: >My motivation is that I am probably going to DC for an extended work >assignment and while the targets will mostly be UNIX and Windows I >want the option of working on my Mac at night trying things out. > >Currently I can use the Python that runs on XWindows with the Fink >installer however the site says Fink is broke in Jaguar. While I >would like to upgrade to Jaguar my internet connection and resources >could be spotty and I want to leave with the best option available. >So I figured I would ask for feedback via the experts ;-) >> >>On Thursday, September 5, 2002, at 05:05 PM, Tony Lownds wrote: >> >>>What would you like? I'm still very interested in working on >>>Tkinter. I'm intending on making an "install_IDLE" command for >>>posting on sf.net (about 50% done with it). I share the impression >>>of complication in Python MacOSX land, there are so many things in >>>the air. AquaTk's last snapshot is really old and fixes bugs that >>>are destined to be FAQs if it's the one people use. I have been >>>assuming that Jack's 2.3 distro will be the leading distribution. >>>He's been adding lots of build changes to CVS lately - probably >>>just waiting for an Alpha. Jack, if I write an install_IDLE >>>command, how likely would it be that IDLE could be included? How >>>long is it before some alpha or pre-alpha releases? >>> >>>If IDLE isn't included in Jack's distro, I will be producing a >>>Tkinter add-on package which includes IDLE and the Tkinter demos. >>>I don't find the current built-from CVS very easy to use yet (too >>>many other apps take over my .py mapping I think) as a package >>>writer - maybe if ~/Library/Python is added to a path so people >>>could install by dragging and dropping. >>> >>>-Tony >>> >>> >>> >>>At 3:15 PM -0500 9/5/02, Rob Bedford wrote: >>>>Along this path I want to upgrade to Jaguar and use the installed >>>>Python is there a compatible AquaTk? >>>> >>>>Thanks >>>> >>>>On Thursday, September 5, 2002, at 03:08 PM, Kurt Marek wrote: >>>> >>>>>I'm pretty much a newbie to Python on the Mac. I notice that >>>>>there are no less than three different distributions. Which one >>>>>is going to turn into the 'default' version for OSX allowing >>>>>both cli use and an Aqua TK IDLE? I've read through some of the >>>>>posts in the archives which try to explain this issue, but it >>>>>just seems to be getting more complicated. Is one of these >>>>>distros taking the lead for offering mainstream Python on OSX? >>>>> >>>>>thanks, >>>>>Kurt >>>>> >>>>> >>>>>_______________________________________________ >>>>>Pythonmac-SIG maillist - Pythonmac-SIG@python.org >>>>>http://mail.python.org/mailman/listinfo/pythonmac-sig >>>>> >>>> >>>> >>>>_______________________________________________ >>>>Pythonmac-SIG maillist - Pythonmac-SIG@python.org >>>>http://mail.python.org/mailman/listinfo/pythonmac-sig >>> >> > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig From rafferty29@mchsi.com Thu Sep 5 23:42:38 2002 From: rafferty29@mchsi.com (Rob Bedford) Date: Thu, 5 Sep 2002 17:42:38 -0500 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: Message-ID: Thanks for the quick and helpful replies. It sounds like the lowest risk is postpone the Jag update until I get back and use the UNIX/Fink I have installed. Although I was hoping for some of the Windows connectivity stuff in Jag a Python I believe to be working is critical. Again thank you for the help. On Thursday, September 5, 2002, at 05:32 PM, Tony Lownds wrote: > With some CVS knowledge I can guide you through getting an IDLE that > works. What I can't do is make a snapshot - I'm not set up to make a > good featureful snapshot on a regular basis. Tk is the harder part - > Python is easy to get/use from CVS. See > http://www.geocrawler.com/lists/3/SourceForge/7933/0/7986005/for Tk, > and http://sourceforge.net/cvs/?group_id=5470 for Python. In a pinch my > website has a version of the Tcl/Tk stuff, which I haven't tried since > 10.1. > > -Tony > > At 5:17 PM -0500 9/5/02, Rob Bedford wrote: >> My motivation is that I am probably going to DC for an extended work >> assignment and while the targets will mostly be UNIX and Windows I >> want the option of working on my Mac at night trying things out. >> >> Currently I can use the Python that runs on XWindows with the Fink >> installer however the site says Fink is broke in Jaguar. While I >> would like to upgrade to Jaguar my internet connection and resources >> could be spotty and I want to leave with the best option available. So >> I figured I would ask for feedback via the experts ;-) >>> >>> On Thursday, September 5, 2002, at 05:05 PM, Tony Lownds wrote: >>> >>>> What would you like? I'm still very interested in working on >>>> Tkinter. I'm intending on making an "install_IDLE" command for >>>> posting on sf.net (about 50% done with it). I share the impression >>>> of complication in Python MacOSX land, there are so many things in >>>> the air. AquaTk's last snapshot is really old and fixes bugs that >>>> are destined to be FAQs if it's the one people use. I have been >>>> assuming that Jack's 2.3 distro will be the leading distribution. >>>> He's been adding lots of build changes to CVS lately - probably just >>>> waiting for an Alpha. Jack, if I write an install_IDLE command, how >>>> likely would it be that IDLE could be included? How long is it >>>> before some alpha or pre-alpha releases? >>>> >>>> If IDLE isn't included in Jack's distro, I will be producing a >>>> Tkinter add-on package which includes IDLE and the Tkinter demos. I >>>> don't find the current built-from CVS very easy to use yet (too many >>>> other apps take over my .py mapping I think) as a package writer - >>>> maybe if ~/Library/Python is added to a path so people could install >>>> by dragging and dropping. >>>> >>>> -Tony >>>> >>>> >>>> >>>> At 3:15 PM -0500 9/5/02, Rob Bedford wrote: >>>>> Along this path I want to upgrade to Jaguar and use the installed >>>>> Python is there a compatible AquaTk? >>>>> >>>>> Thanks >>>>> >>>>> On Thursday, September 5, 2002, at 03:08 PM, Kurt Marek wrote: >>>>> >>>>>> I'm pretty much a newbie to Python on the Mac. I notice that there >>>>>> are no less than three different distributions. Which one is going >>>>>> to turn into the 'default' version for OSX allowing both cli use >>>>>> and an Aqua TK IDLE? I've read through some of the posts in the >>>>>> archives which try to explain this issue, but it just seems to be >>>>>> getting more complicated. Is one of these distros taking the lead >>>>>> for offering mainstream Python on OSX? >>>>>> >>>>>> thanks, >>>>>> Kurt >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >>>>>> http://mail.python.org/mailman/listinfo/pythonmac-sig >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >>>>> http://mail.python.org/mailman/listinfo/pythonmac-sig >>>> >>> >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From landauer@got.net Fri Sep 6 00:55:59 2002 From: landauer@got.net (landauer@got.net) Date: Thu, 5 Sep 2002 16:55:59 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: References: <4A6CB0DD-C10C-11D6-90FB-00039374C97A@mchsi.com> Message-ID: <1031270159.3d77ef0f82470@webmail.got.net> Quoting Tony Lownds : > What would you like? I'm still very interested in working on Tkinter. Well, as long as you asked: I'd like to see a Python cross-platform GUI solution that does not depend on installing fragments of X-windows on my Mac OS X system. Can Aquatk do that, yet? Will it ever? Just wondering; haven't been paying close attention. -- Doug L. -=-=-=- food. shelter. clothing. net. Got.net - The Internet Connection, Inc From tony@lownds.com Fri Sep 6 01:14:53 2002 From: tony@lownds.com (Tony Lownds) Date: Thu, 5 Sep 2002 17:14:53 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <1031270159.3d77ef0f82470@webmail.got.net> References: <4A6CB0DD-C10C-11D6-90FB-00039374C97A@mchsi.com> <1031270159.3d77ef0f82470@webmail.got.net> Message-ID: >I'd like to see a Python cross-platform GUI solution that does not depend on >installing fragments of X-windows on my Mac OS X system. > >Can Aquatk do that, yet? Will it ever? AquaTk + Python that is in CVS does a pretty good job. AquaTk on its own does provide a "cross-platform GUI toolkit that does not depend on installing fragments of X-windows on my Mac OS X system". It's just in Tcl/Tk not Python. Python in CVS can link up with with AquaTk very easily and pretty effectively; setup.py makes a working Tkinter. The main issues are: 1. IDLE isn't built on its own 2. Threads crash it 3. AquaTk doesn't have a good release to point people to. I can fix only #1. That patch is forthcoming. -Tony From kevino@tulane.edu Fri Sep 6 04:50:39 2002 From: kevino@tulane.edu (Kevin Ollivier) Date: Thu, 5 Sep 2002 23:50:39 -0400 Subject: [Pythonmac-SIG] What is the future of Python on OSX? References: <4A6CB0DD-C10C-11D6-90FB-00039374C97A@mchsi.com> <1031270159.3d77ef0f82470@webmail.got.net> Message-ID: <008501c25558$94337b00$6501a8c0@dellPC> ----- Original Message ----- From: To: "Tony Lownds" Cc: Sent: Thursday, September 05, 2002 7:55 PM Subject: Re: [Pythonmac-SIG] What is the future of Python on OSX? > Quoting Tony Lownds : > > > What would you like? I'm still very interested in working on Tkinter. > > Well, as long as you asked: > > I'd like to see a Python cross-platform GUI solution that does not depend on > installing fragments of X-windows on my Mac OS X system. > > Can Aquatk do that, yet? Will it ever? Not sure about AquaTK, but wxPython already does a pretty decent job of it! =) You can even d/l and install it (along with the latest binary of MachoPython) from here: http://sourceforge.net/project/showfiles.php?group_id=10718&release_id=83146 I've been using wxPython for an app I've been working on, and despite one Mac-specific bug, the app works the same on all three major platforms (Windows/Mac/Linux) plus it uses the native look and feel of the platform its running on (i.e. Aqua on OS X). I've been quite happy with it. Kevin From jwblist@olympus.net Fri Sep 6 06:12:27 2002 From: jwblist@olympus.net (John W Baxter) Date: Thu, 5 Sep 2002 22:12:27 -0700 Subject: [Pythonmac-SIG] Testing MachoPython In-Reply-To: <7B52BC16-BB5F-11D6-A4F9-00039315F436@slc.edu> References: <7B52BC16-BB5F-11D6-A4F9-00039315F436@slc.edu> Message-ID: At 10:56 -0400 8/29/2002, Michael Esveldt wrote: >This is a fairly basic question, but its answer might be of some >small use to MacPython: How safe is it to perform test builds? I would feel more comfortable putting a second drive into the machine (really, you want a second machine, but later you said 'student'). Put a full Mac OS X on that, and a copy of your fink-based Python, and do your test builds there. If sufficiently paranoid, you will unmount your work drive before doing anything with this sandbox system. Now, even if something does go wrong, you have a disk you can wipe out and build again. John (still maintaining his machine as a fink-free zone, but that's just me) -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From larry.bugbee@boeing.com Fri Sep 6 21:23:25 2002 From: larry.bugbee@boeing.com (Bugbee, Larry) Date: Fri, 6 Sep 2002 13:23:25 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? Message-ID: <58B6DA1B98AA9149B13B029976A48BCC0879939D@xch-nw-31.nw.nos.boeing.com> My 2 cents... As developers for developers we can do pretty much what we want for the installation, but if we expect mere mortals to run the stuff we develop, we need to have an installation that is simple to understand, easy to use, and complete. The typical user will not be in a position to understand all the dependencies, or go through any screwy procedures to get something to work. I therefore submit the OSX Python installation of GUIs should: - have no dependencies. A single installation should install all that is required beyond that provided by the vendor. (I know this will be point of contention, but the end user really doesn't care about our problems.) - install the same GUI interfaces included in the standard installations of another platforms. GUI apps should run on OSX just as they would on Linux or Windows. For now this includes Tkinter. When wxPython becomes part of the standard install on any platform, it should become standard on all. - properly support the native look and feel. ...as is the case on all other platforms. In this case, Aqua. The dependencies issue is a tough one. If the installer cannot or does not install all that is required, the installer should at least alert the user as to what is missing and give a clue as to what to do. ...and the answer should be simple enough for them to understand and do correctly. Not to flame anybody, but in the long run I'm not keen on using X on OSX unless it is supported by Apple. Likewise, I'm not too keen on installing Tcl to enjoy Tkinter. Those may be a luxuries we cannot support today, but perhaps we should recognize them as goals? ...and whatever the answer, it should be the same for all platforms. At the end of the day, if our end users cannot do a simple install and get all that is needed to run our Python apps, they won't be running our apps on OSX. It is that simple. ...ahhhh, mebbie 3? Larry > > > What would you like? I'm still very interested in working on Tkinter. > > Well, as long as you asked: > > > > I'd like to see a Python cross-platform GUI solution that does not > > depend on installing fragments of X-windows on my Mac OS X system. > > > > Can Aquatk do that, yet? Will it ever? > Not sure about AquaTK, but wxPython already does a pretty decent job of it! From Jack.Jansen@oratrix.com Fri Sep 6 23:30:57 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sat, 7 Sep 2002 00:30:57 +0200 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <58B6DA1B98AA9149B13B029976A48BCC0879939D@xch-nw-31.nw.nos.boeing.com> Message-ID: <5088C421-C1E8-11D6-8D51-003065517236@oratrix.com> On vrijdag, september 6, 2002, at 10:23 , Bugbee, Larry wrote: > My 2 cents... > > As developers for developers we can do pretty much what we want for the > installation, but if we expect mere mortals to run the stuff we > develop, we > need to have an installation that is simple to understand, easy > to use, and > complete. The typical user will not be in a position to > understand all the > dependencies, or go through any screwy procedures to get > something to work. Fully agreed. I've just finished handling the core part of creating a framework installer for Python. People interested in trying this at home should update their cvs trees and check out Mac/OSX/README, it now has instructions on creating a binary installer for a MacOSX framework-based Python. Thanks go to Dinu Gherman for his buildpkg script (which is now included in Mac/scripts). > I therefore submit the OSX Python installation of GUIs should: > > - have no dependencies. A single installation should > install all that is required beyond that provided by > the vendor. (I know this will be point of contention, > but the end user really doesn't care about our problems.) I think that we can't do this, practically. For OSX Python GUI development there are currently four options: Carbon, Cocoa, Tkinter and wxWindows. Of these only the first one (which is also arguably the worst choice) is included with the core distribution (as created with the script above) because the IDE needs it. But: I think we can do something that is almost as good, if we create a simple way by which an end user can install add-on packages for Python. I've dropped this idea here before, but noone reacted, so here goes again. We create a bit of software called the Python Install Manager. This should probably be a part of the IDE (or at least be accessible easily through the IDE, with a GUI and such). It goes to a specific location on the net where it retrieves a current database of installable Python extension packages. It then presents the user with this list, and for each package also shows whether it's currently installed, not installed or installed but outdated (i.e. the database has a newer version than the user has). The user can then easily install or remove packages at the click of a button. The packages in the database consist of a Python script to determine whether you have it installed at the moment (and determine the version number) and a script to do the installation of a current version and a list of dependencies. For a simple pure-python package the scripts would be simple: the test script would be an import of the package to determine existence and a version check. The install script would be a download plus a distutils-based install. For Python packages with extension modules the install script should grab a binary distribution (also distutils based). For external packages (i.e. the AquaTk package needed by a Tkinter package) the install script can fire up standard MacOS tools to install the package. For really complicated things the install script should open an instructions page in the users' webbrowser. The amount of code needed for all this isn't all that much. The real work is in two things: - deciding on a database format that is rich enough, but also small enough to actually be implementable in the 2.3 timeframe (a few months, I guess) - finding someone who will take responsibility of keeping the database plus the underlying installers up to date. > > - install the same GUI interfaces included in the > standard installations of another platforms. GUI > apps should run on OSX just as they would on Linux > or Windows. For now this includes Tkinter. But unfortunately AquaTk installation, on which Tkinter depends, is non-trivial at the moment:-( -- - 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 Robin.Siebler@palmsource.com Fri Sep 6 23:38:44 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Fri, 6 Sep 2002 15:38:44 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF8F1@ussunm001.palmsource.com> >>We create a bit of software called the Python Install Manager.=20 >>This should probably be a part of the IDE (or at least be=20 >>accessible easily through the IDE, with a GUI and such). It goes=20 >>to a specific location on the net where it retrieves a current=20 >>database of installable Python extension packages. It then=20 >>presents the user with this list, and for each package also=20 >>shows whether it's currently installed, not installed or=20 >>installed but outdated (i.e. the database has a newer version=20 >>than the user has). The user can then easily install or remove=20 >>packages at the click of a button. On the Windows side, the ActivePython distro has a similar feature, = although it is a command-line utility. From kevino@tulane.edu Fri Sep 6 23:44:29 2002 From: kevino@tulane.edu (Kevin Ollivier) Date: Fri, 6 Sep 2002 18:44:29 -0400 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <58B6DA1B98AA9149B13B029976A48BCC0879939D@xch-nw-31.nw.nos.boeing.com> Message-ID: <343ED1A0-C1EA-11D6-A0D4-003065F40094@tulane.edu> On Friday, September 6, 2002, at 04:23 PM, Bugbee, Larry wrote: > My 2 cents... > > As developers for developers we can do pretty much what we want for the > installation, but if we expect mere mortals to run the stuff we > develop, we > need to have an installation that is simple to understand, easy to use, > and > complete. The typical user will not be in a position to understand all > the > dependencies, or go through any screwy procedures to get something to > work. > I therefore submit the OSX Python installation of GUIs should: > > - have no dependencies. A single installation should > install all that is required beyond that provided by > the vendor. (I know this will be point of contention, > but the end user really doesn't care about our problems.) When I'm creating a GUI app for end users, for Windows I use a tool like McMillan's Installer program to build all the dependencies into one directory and create a binary version of the script, which I then package as an installer. (Installer works on Linux as well, and the Mac OS X equivalent, called "BuildApplication", I believe is in development.) The end user doesn't even know that Python was used to develop the application, unless they care to read the license or check the "About" box. In fact, IMHO, end users should not have to separately install Python at all. It should be somehow bundled or incorporated, along with any dependencies, into an application's installer. However, I don't think it should be the responsibility of the Python developers, or the third-party developers, to ensure that everything a vendor's application needs is included within Python. It should instead be the responsibility of the vendor themselves. > - install the same GUI interfaces included in the > standard installations of another platforms. GUI > apps should run on OSX just as they would on Linux > or Windows. For now this includes Tkinter. When > wxPython becomes part of the standard install on > any platform, it should become standard on all. I would really, really like to see wxPython become a standard GUI for Python. I think it is quite usable and powerful, provides a native look and feel, gives good performance, and now it does run on all major platforms. My guess is, however, that it hasn't been included for size reasons. Anyone else have more info on this? > - properly support the native look and feel. ...as is > the case on all other platforms. In this case, Aqua. > The dependencies issue is a tough one. If the installer cannot or does > not > install all that is required, the installer should at least alert the > user > as to what is missing and give a clue as to what to do. ...and the > answer > should be simple enough for them to understand and do correctly. > > Not to flame anybody, but in the long run I'm not keen on using X on OSX > unless it is supported by Apple. Likewise, I'm not too keen on > installing > Tcl to enjoy Tkinter. Those may be a luxuries we cannot support today, > but > perhaps we should recognize them as goals? ...and whatever the answer, > it > should be the same for all platforms. > > At the end of the day, if our end users cannot do a simple install and > get > all that is needed to run our Python apps, they won't be running our > apps on > OSX. I think we're already mostly there, except it is up to the vendor to ensure that the users get an easy installation experience. (And that is, IMO, how it should be.) I actually do have a single-file, point-and-click, installer for my OS X wxPython app. It's a bit large right now (32 MB Gzipped) because it installs Python, wxPython and PyXML, but it's easy and painless. No X hassles, uses Aqua, and works just like the Windows/Linux counterparts. Very nice. =) I used to use Visual Basic, and believe it or not, I have a lot less troubles building an easy, complete installer with Python than with VB. Thanks, Kevin > It is that simple. > > ...ahhhh, mebbie 3? > > Larry > >>>> What would you like? I'm still very interested in working on Tkinter. >>> Well, as long as you asked: >>> >>> I'd like to see a Python cross-platform GUI solution that does not >>> depend on installing fragments of X-windows on my Mac OS X system. >>> >>> Can Aquatk do that, yet? Will it ever? >> Not sure about AquaTK, but wxPython already does a pretty decent job of > it! > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From smithsm@samuelsmith.org Fri Sep 6 23:57:26 2002 From: smithsm@samuelsmith.org (Samuel Smith) Date: Fri, 6 Sep 2002 16:57:26 -0600 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <5088C421-C1E8-11D6-8D51-003065517236@oratrix.com> Message-ID: <0325D252-C1EC-11D6-B87D-00039346A274@samuelsmith.org> > > But: I think we can do something that is almost as good, if we create a > simple way by which an end user can install add-on packages for Python. > I've dropped this idea here before, but noone reacted, so here goes again. > > We create a bit of software called the Python Install Manager. This > should probably be a part of the IDE (or at least be accessible easily > through the IDE, with a GUI and such). It goes to a specific location on > the net where it retrieves a current database of installable Python > extension packages. It then presents the user with this list, and for > each package also shows whether it's currently installed, not installed > or installed but outdated (i.e. the database has a newer version than the > user has). The user can then easily install or remove packages at the > click of a button. > > The packages in the database consist of a Python script to determine > whether you have it installed at the moment (and determine the version > number) and a script to do the installation of a current version and a > list of dependencies. > > For a simple pure-python package the scripts would be simple: the test > script would be an import of the package to determine existence and a > version check. The install script would be a download plus a > distutils-based install. > > For Python packages with extension modules the install script should grab > a binary distribution (also distutils based). > > For external packages (i.e. the AquaTk package needed by a Tkinter > package) the install script can fire up standard MacOS tools to install > the package. > > For really complicated things the install script should open an > instructions page in the users' webbrowser. > > The amount of code needed for all this isn't all that much. The real work > is in two things: > - deciding on a database format that is rich enough, but also small > enough to actually be implementable in the 2.3 timeframe (a few months, I > guess) > - finding someone who will take responsibility of keeping the database > plus the underlying installers up to date. >> This reminds me very much of Fink Commander http://finkcommander.sourceforge.net/ which I like a lot. It went a long ways towards removing my fear and trepidation when I started using fink. A useful feature that would help a common beginner problem is to update the python path to make sure all the "installed" modules are reachable and to report any obscured modules due to a duplicate in a higher priority path. From kevino@tulane.edu Sat Sep 7 00:26:48 2002 From: kevino@tulane.edu (Kevin Ollivier) Date: Fri, 6 Sep 2002 19:26:48 -0400 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <5088C421-C1E8-11D6-8D51-003065517236@oratrix.com> Message-ID: <1D8A440E-C1F0-11D6-A0D4-003065F40094@tulane.edu> On Friday, September 6, 2002, at 06:30 PM, Jack Jansen wrote: > > On vrijdag, september 6, 2002, at 10:23 , Bugbee, Larry wrote: > >> My 2 cents... >> >> As developers for developers we can do pretty much what we want for the >> installation, but if we expect mere mortals to run the stuff we >> develop, we >> need to have an installation that is simple to understand, easy to >> use, and >> complete. The typical user will not be in a position to understand >> all the >> dependencies, or go through any screwy procedures to get something to >> work. > > Fully agreed. > > I've just finished handling the core part of creating a framework > installer for Python. > People interested in trying this at home should update their cvs trees > and check out > Mac/OSX/README, it now has instructions on creating a binary installer > for a MacOSX framework-based Python. Thanks go to Dinu Gherman for his > buildpkg script (which is now included in Mac/scripts). > >> I therefore submit the OSX Python installation of GUIs should: >> >> - have no dependencies. A single installation should >> install all that is required beyond that provided by >> the vendor. (I know this will be point of contention, >> but the end user really doesn't care about our problems.) > > I think that we can't do this, practically. For OSX Python GUI > development there are currently four options: Carbon, Cocoa, Tkinter > and wxWindows. Of these only the first one (which is also arguably the > worst choice) is included with the core distribution (as created with > the script above) because the IDE needs it. > > But: I think we can do something that is almost as good, if we create a > simple way by which an end user can install add-on packages for Python. > I've dropped this idea here before, but noone reacted, so here goes > again. > > We create a bit of software called the Python Install Manager. This > should probably be a part of the IDE (or at least be accessible easily > through the IDE, with a GUI and such). It goes to a specific location > on the net where it retrieves a current database of installable Python > extension packages. It then presents the user with this list, and for > each package also shows whether it's currently installed, not installed > or installed but outdated (i.e. the database has a newer version than > the user has). The user can then easily install or remove packages at > the click of a button. > > The packages in the database consist of a Python script to determine > whether you have it installed at the moment (and determine the version > number) and a script to do the installation of a current version and a > list of dependencies. > > For a simple pure-python package the scripts would be simple: the test > script would be an import of the package to determine existence and a > version check. The install script would be a download plus a > distutils-based install. > > For Python packages with extension modules the install script should > grab a binary distribution (also distutils based). > > For external packages (i.e. the AquaTk package needed by a Tkinter > package) the install script can fire up standard MacOS tools to install > the package. > > For really complicated things the install script should open an > instructions page in the users' webbrowser. > > The amount of code needed for all this isn't all that much. The real > work is in two things: > - deciding on a database format that is rich enough, but also small > enough to actually be implementable in the 2.3 timeframe (a few months, > I guess) > - finding someone who will take responsibility of keeping the database > plus the underlying installers up to date. I've been thinking about that myself. The database could actually be run off the web and output an XML file which the Python Install Manager client software would read. Making it web-based would enable the developers themselves to go online and add their package information to the repository. For the more complicated stuff, we could let the developer specify "pre" and "post" install scripts for dependencies without bloating the database format. We could also work on getting it hosted by the PSF on python.org, that way ensuring that it will be maintained. And the GUI for it could be written in wxPython, forcing it to be included in the base distribution... hehehe... =) I even thought about a name for the web-based database... Get ready... the "Searchable Python Archive of Modules". Yup. SPAM. ;-) What do you think? Thanks, Kevin >> >> - install the same GUI interfaces included in the >> standard installations of another platforms. GUI >> apps should run on OSX just as they would on Linux >> or Windows. For now this includes Tkinter. > > But unfortunately AquaTk installation, on which Tkinter depends, is > non-trivial > at the moment:-( > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- Emma > Goldman - > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From alexp@strata.com Sat Sep 7 01:05:03 2002 From: alexp@strata.com (Alexandre Parenteau) Date: Fri, 06 Sep 2002 17:05:03 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <5088C421-C1E8-11D6-8D51-003065517236@oratrix.com> Message-ID: > The amount of code needed for all this isn't all that much. The > real work is in two things: > - deciding on a database format that is rich enough, but also > small enough to actually be implementable in the 2.3 timeframe > (a few months, I guess) > - finding someone who will take responsibility of keeping the > database plus the underlying installers up to date. I suggest also looking at cygwin. It has a very complete update packager, including mirrors handling and little dependencies, although it is still lightweight and work on top of bzip/tar. http://sources.redhat.com/cygwin Alex. >> >> - install the same GUI interfaces included in the >> standard installations of another platforms. GUI >> apps should run on OSX just as they would on Linux >> or Windows. For now this includes Tkinter. > > But unfortunately AquaTk installation, on which Tkinter depends, > is non-trivial > at the moment:-( > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- > Emma Goldman - > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From skim@adobe.com Sat Sep 7 02:17:00 2002 From: skim@adobe.com (Sung Kim) Date: Fri, 6 Sep 2002 18:17:00 -0700 Subject: [Pythonmac-SIG] Metrowerks Q. vis-a-vis embedding Message-ID: <8263E7ED-C1FF-11D6-B0A6-003065B90A20@adobe.com> My C app, which embeds the Python interpreter, runs okay if run within Metrowerks debugger. But it does not run when launched from the Finder. Can someone advise? Thank you! Actually, it runs but after loading the Python Interpreter, it doesn't seem to continue (to put up my main window, etc.). Thanks again. --Sung H. Kim skim@adobe.com From Jack.Jansen@oratrix.com Sat Sep 7 22:14:38 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sat, 7 Sep 2002 23:14:38 +0200 Subject: [Pythonmac-SIG] Metrowerks Q. vis-a-vis embedding In-Reply-To: <8263E7ED-C1FF-11D6-B0A6-003065B90A20@adobe.com> Message-ID: On zaterdag, september 7, 2002, at 03:17 , Sung Kim wrote: > My C app, which embeds the Python interpreter, runs okay if run > within Metrowerks debugger. But it does not run when launched > from the Finder. Can someone advise? Thank you! > > Actually, it runs but after loading the Python Interpreter, it > doesn't seem to continue (to put up my main window, etc.). > Thanks again. You can attach the Metrowerks debugger to a running process (open it's process window). Maybe you could try that to see if it helps you find out where the code is stuck? -- - 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 Jack.Jansen@oratrix.com Sat Sep 7 22:58:52 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sat, 7 Sep 2002 23:58:52 +0200 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <0325D252-C1EC-11D6-B87D-00039346A274@samuelsmith.org> Message-ID: I'll reply at once to various messages here. On zaterdag, september 7, 2002, at 12:57 , Samuel Smith wrote: > A useful feature that would help a common beginner problem is > to update the python path to make sure all the "installed" > modules are reachable and to report any obscured modules due to > a duplicate in a higher priority path. I think that it the "test whether the module is installed" should handle this. I.e. if something is found on sys.path it exists, otherwise it doesn't. And if we require (or, I should say, if the archive maintainer requires) that all Python packages are distutils-based then everything will end up in site-python anyway. For the long run we may want something like systemwide installation/per-user installation/network installation, but for a first stab I'd like to apply the KISS principle. Kevin Ollivier wrote: > I've been thinking about that myself. The database could > actually be run off the web and output an XML file which the > Python Install Manager client software would read. That would definitely be the most sensible approach. We have all the tools to download and parse XML, after all. And we get a versioning scheme whereby we can keep things simple initially and extend our DTD later when we understand the problems better. > Making it web-based would enable the developers themselves to > go online and add their package information to the repository. I think that initially I would like to go with a centralized scheme, i.e. appoint one (or a few) people responsible for the database. I also think that we should initially aim for something that supports the major packages (pyobjc, tkinter, wxpython, numeric, opengl, pil, piddle and maybe a few more), and that the Database Czar is morally responsible for testing the installers before putting them in the database. > For the more complicated stuff, we could let the developer > specify "pre" and "post" install scripts for dependencies > without bloating the database format. We could also work on > getting it hosted by the PSF on python.org, that way ensuring > that it will be maintained. Again, I think we should slow down a little here. If at first we aim for MacOSX only we can learn some lessons that we can then apply to a generalized Searchable Python Archive of Modules. Yes, that name is brilliant, it makes you wonder why the perlies put up with CPAN:-) Mirroring and such (as Alexandre mentioned) I think we should also put off to a later date. It's very easy to add on. Same for things like digital signatures and version verification (which you definitely want when you do mirroring). And for a SPAM we'll also need to address multiplatform issues, source/binary, searchability on keywords (otherwise SPAM won't work:-0) and more like that. And if we allow any developer to enter stuff into the database we need a feedback scheme on what has been known to work on what platform, etc. And I have this pet feature I want to add (but at a much later date): a list of modules/packages that the package will provide when installed. That way, if you get an obscure script from someone that does "import foobar" the IDE could catch the import error and point you in the direction of the package you might want to install. Let me take a shot at an initial database format. I'm making this up as I go, so there's probably holes in it. The XML file has a head section with the DTD and version and other mumbo-jumbo, and the body is a list of packages. A package consists of a name, a version, a one-line description, a URL at which the user can find out more information, a list of dependencies, an existence test script and an install script. Of these I think only the latter three pose some interesting questions. Maybe the list of dependencies shouldn't be a list, but also a script, so you can test for specific versions of packages on which you depend? That way you could also use gestalt to test for specific OS versions or other things outside the control of the Python Install Manager, but on the other hand declarative is usually better than procedural. But for a first stab it would allow, say, the Tkinter dependency script to test whether AquaTk is installed and, if not, tell the user to read the "more information" document where you can post detailed instructions on how to install AquaTk yourself. And for all three scripts there's the question of whether they're included inline or referenced by URL. I lean towards including the existence test script inline (so the PIM can quickly show installed/not installed status) and having the other two referred by URL (because there's no need to load them if the end user couldn't care less about a certain package). Oh yes, the version information in the head section should not only include the database version but also the version of the PIM: if the inline scripts are to be of acceptable size then the PIM should setup an environment in which the scripts are run (and for instance pre-import such goodies as sys, os, string, gestalt, etc). Hmm, and now that I read that AquaTk sentence again I think there are actually 4 states in which a package can be (according to the existence test script): 1. It's not there 2. It's there, it's up to date, everything's fine 3. It's there, but you have an old version 4. It's there but it doesn't work, you've probably messed up some of the dependencies or something else is going on that the PIM can't help you with. -- - 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 tony@lownds.com Sat Sep 7 22:52:12 2002 From: tony@lownds.com (Tony Lownds) Date: Sat, 7 Sep 2002 14:52:12 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: <5088C421-C1E8-11D6-8D51-003065517236@oratrix.com> References: <5088C421-C1E8-11D6-8D51-003065517236@oratrix.com> Message-ID: >But: I think we can do something that is almost as good, if we >create a simple way by which an end user can install add-on packages >for Python. Currently there isn't even a good spot for add-on packages to go! I would like to see /Library/Python, ~/Library/Python, etc. added to the path. Patch 606134 does this, and also has support for making an IDLE applet. >I've dropped this idea here before, but noone reacted, so here goes again. > >We create a bit of software called the Python Install Manager. That's a huge idea... thinking big, Jack :) -Tony From guess-who@kevin-masako.com Sun Sep 8 01:56:52 2002 From: guess-who@kevin-masako.com (Kevin Ollivier) Date: Sat, 7 Sep 2002 20:56:52 -0400 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: Message-ID: On Saturday, September 7, 2002, at 05:58 PM, Jack Jansen wrote: > > Kevin Ollivier wrote: >> I've been thinking about that myself. The database could actually be >> run off the web and output an XML file which the Python Install >> Manager client software would read. > > That would definitely be the most sensible approach. We have all the > tools to download and parse XML, after all. And we get a versioning > scheme whereby we can keep things simple initially and extend our DTD > later when we understand the problems better. > >> Making it web-based would enable the developers themselves to go >> online and add their package information to the repository. > > I think that initially I would like to go with a centralized scheme, > i.e. appoint one (or a few) people responsible for the database. I > also think that we should initially aim for something that supports > the major packages (pyobjc, tkinter, wxpython, numeric, opengl, pil, > piddle and maybe a few more), and that the Database Czar is morally > responsible for testing the installers before putting them in the > database. > >> For the more complicated stuff, we could let the developer specify >> "pre" and "post" install scripts for dependencies without bloating >> the database format. We could also work on getting it hosted by the >> PSF on python.org, that way ensuring that it will be maintained. > > Again, I think we should slow down a little here. If at first we aim > for MacOSX only we can learn some lessons that we can then apply to a > generalized Searchable Python Archive of Modules. Yes, that name is > brilliant, it makes you wonder why the perlies put up with CPAN:-) > > Mirroring and such (as Alexandre mentioned) I think we should also put > off to a later date. It's very easy to add on. Same for things like > digital signatures and version verification (which you definitely want > when you do mirroring). And for a SPAM we'll also need to address > multiplatform issues, source/binary, searchability on keywords > (otherwise SPAM won't work:-0) and more like that. And if we allow any > developer to enter stuff into the database we need a feedback scheme > on what has been known to work on what platform, etc. Didn't mean to get ahead of things here, just throwing out some ideas. =) I think you're right that the best way is to first add it into the Mac distro and get some good testing in first. As for feedback, I think a simple way to add this is to give each package a "comments" section, kinda like what the PHP online manual does. I've actually found the comments there quite helpful in diagnosing and working around some Windows/IIS specific bugs. > And I have this pet feature I want to add (but at a much later date): > a list of modules/packages that the package will provide when > installed. That way, if you get an obscure script from someone that > does "import foobar" the IDE could catch the import error and point > you in the direction of the package you might want to install. > > Let me take a shot at an initial database format. I'm making this up > as I go, so there's probably holes in it. The XML file has a head > section with the DTD and version and other mumbo-jumbo, and the body > is a list of packages. A package consists of a name, a version, a > one-line description, a URL at which the user can find out more > information, a list of dependencies, an existence test script and an > install script. > Don't know if I'm getting too detailed at this early phase, but I'd suggest that there be a list of categories as well. > Of these I think only the latter three pose some interesting > questions. Maybe the list of dependencies shouldn't be a list, but > also a script, so you can test for specific versions of packages on > which you depend? That way you could also use gestalt to test for > specific OS versions or other things outside the control of the Python > Install Manager, but on the other hand declarative is usually better > than procedural. But for a first stab it would allow, say, the Tkinter > dependency script to test whether AquaTk is installed and, if not, > tell the user to read the "more information" document where you can > post detailed instructions on how to install AquaTk yourself. I think the list approach is better because it lets you reuse the package information you've already entered into the system. My application, for example, would have PyXML and wxPython as dependencies. Since those packages would be in the database and have their own existence test scripts, I would only have to write a script for my own package and specify that the wxPython and PyXML packages must pass their existence tests before my package can be installed. For situations like AquaTK, there could be an "install instructions" field in the package information. Just a thought that popped into my head: what about an uninstall script? Should that be added into the package information? > And for all three scripts there's the question of whether they're > included inline or referenced by URL. I lean towards including the > existence test script inline (so the PIM can quickly show > installed/not installed status) and having the other two referred by > URL (because there's no need to load them if the end user couldn't > care less about a certain package). This sounds like a good approach to me. When the package database gets large, having less to load would make a difference as well. =) > Oh yes, the version information in the head section should not only > include the database version but also the version of the PIM: if the > inline scripts are to be of acceptable size then the PIM should setup > an environment in which the scripts are run (and for instance > pre-import such goodies as sys, os, string, gestalt, etc). > I think a "last updated" date should also be included. Eventually, this would enable the PIM to warn users that they need to go online and update their package database when it gets old. Thanks, Kevin > Hmm, and now that I read that AquaTk sentence again I think there are > actually 4 states in which a package can be (according to the > existence test script): > 1. It's not there > 2. It's there, it's up to date, everything's fine > 3. It's there, but you have an old version > 4. It's there but it doesn't work, you've probably messed up some of > the dependencies or something else is going on that the PIM can't help > you with. > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- Emma > Goldman - > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From Philip.Kalmus@nera.com Sun Sep 8 12:38:16 2002 From: Philip.Kalmus@nera.com (Kalmus, Philip) Date: Sun, 8 Sep 2002 12:38:16 +0100 Subject: [Pythonmac-SIG] problems after installing NumPy on Jaguar Message-ID: <0B0ED9B62DF24F4597E5390627B2C622546AB1@exchangeln1.nera.com> Hi - I installed NumPy from source on Jaguar with the commands: >sudo python setup.py install; the installation seems to have gone ok, but now Apple Help crashes when it is opened...does anyone know what this is about? thanks Philip _____________________________ Philip A. Kalmus, PhD National Economic Research Associates From kp87@lycos.com Sun Sep 8 13:19:21 2002 From: kp87@lycos.com (kevin parks) Date: Sun, 08 Sep 2002 08:19:21 -0400 Subject: [Pythonmac-SIG] installer Message-ID: >>Likewise, I'm not too keen on installing Tcl to enjoy Tkinter. I am curious why anyone would object to this. Tcl is absolutely miniscule and for some, handy to have around anyway. I love Jack's database idea as i would love to get my basic python install and then get Numpy, and other standard "can't live without" things all at the same time. I love the path update idea as well. I think that that is a big problem for many who are getting started for the first time in OS X. -kp-- ___________________________________________________ Communicate with others using Lycos Mail for FREE! http://mail.lycos.com From lee@lee-phillips.org Sun Sep 8 19:14:54 2002 From: lee@lee-phillips.org (Lee Phillips) Date: Sun, 8 Sep 2002 12:14:54 -0600 Subject: [Pythonmac-SIG] problems after installing NumPy on Jaguar In-Reply-To: <0B0ED9B62DF24F4597E5390627B2C622546AB1@exchangeln1.nera.com>; from Philip.Kalmus@nera.com on Sun, Sep 08, 2002 at 12:38:16PM +0100 References: <0B0ED9B62DF24F4597E5390627B2C622546AB1@exchangeln1.nera.com> Message-ID: <20020908121454.B8171@bgd.vosn.net> On Sun, Sep 08, 2002 at 12:38:16PM +0100, Kalmus, Philip wrote: > Hi - I installed NumPy from source on Jaguar with the > commands: >sudo python setup.py install; the installation > seems to have gone ok, but now Apple Help crashes when > it is opened...does anyone know what this is about? I did the same install but I was lucky - my Apple Help still seems to be working. Sometimes Help crashes if there is a no-good help file that it tries to use. You might look at /Library/Preferences/com.apple.help.plist and see if there is anything related to NumPy in there; it will say where it thinks the help file is and you can delete the entry and the file. From Jack.Jansen@oratrix.com Sun Sep 8 21:43:23 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sun, 8 Sep 2002 22:43:23 +0200 Subject: [Pythonmac-SIG] problems after installing NumPy on Jaguar In-Reply-To: <0B0ED9B62DF24F4597E5390627B2C622546AB1@exchangeln1.nera.com> Message-ID: <9E1ED2B6-C36B-11D6-9BF8-003065517236@oratrix.com> On zondag, september 8, 2002, at 01:38 , Kalmus, Philip wrote: > Hi - I installed NumPy from source on Jaguar with the > commands: >sudo python setup.py install; the installation > seems to have gone ok, but now Apple Help crashes when > it is opened...does anyone know what this is about? Try deleting your help preferences (in ~/Library/Preferences). There's both a file (help.apple.com or some such) and a folder. They'll be recreated when you restart Help Viewer. -- - 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 pdetagyos@cox.net Sun Sep 8 22:26:09 2002 From: pdetagyos@cox.net (Peter de Tagyos) Date: Sun, 8 Sep 2002 14:26:09 -0700 Subject: [Pythonmac-SIG] SPAM Message-ID: <978126E2-C371-11D6-BAC1-0003939D32AA@cox.net> I think that SPAM is a great name for a Python module archive. I think that such an application would serve as a great example of how python can be used to build web services. That term is totally overused and often mis-applied these days, but in this case it aptly describes the application. I'm just throwing out ideas here, but I think that the client should post an XML request to the server, which will respond to the request appropriately (either by returning information in an XML doc, or initiating a download, etc). The interaction should be completely stateless. Then I got to thinking about the server, and realized that Zope would be an excellent choice for the server-side app. You've got a scalable web server built in, so all you need to do is interpret the request XML and decide how to best fulfill it. As an added bonus, you could build a website that offers the same functionality to web browsers as it does to command-line clients. Just some thoughts - take 'em for what they are worth. I would be interested in working on such a project, because I think that if python can offer a CPAN-like service, it will only draw more users to the language. Peter From Jack.Jansen@oratrix.com Sun Sep 8 22:15:19 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sun, 8 Sep 2002 23:15:19 +0200 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: Message-ID: <14A84593-C370-11D6-9BF8-003065517236@oratrix.com> On zondag, september 8, 2002, at 02:56 , Kevin Ollivier wrote: >> Let me take a shot at an initial database format. I'm making >> this up as I go, so there's probably holes in it. The XML file >> has a head section with the DTD and version and other >> mumbo-jumbo, and the body is a list of packages. A package >> consists of a name, a version, a one-line description, a URL >> at which the user can find out more information, a list of >> dependencies, an existence test script and an install script. >> > > Don't know if I'm getting too detailed at this early phase, but > I'd suggest that there be a list of categories as well. I'd like to postpone this to phase 2. There's lots more meta-information you may want to include (and that we will need to include before SPAM can live up to it's name). Name, short-description and long-description-url are the only ones I think are essential for version one. Actually, let's call this thing not version 1 but version 0.9. >> Of these I think only the latter three pose some interesting >> questions. Maybe the list of dependencies shouldn't be a list, >> but also a script, so you can test for specific versions of >> packages on which you depend? That way you could also use >> gestalt to test for specific OS versions or other things >> outside the control of the Python Install Manager, but on the >> other hand declarative is usually better than procedural. But >> for a first stab it would allow, say, the Tkinter dependency >> script to test whether AquaTk is installed and, if not, tell >> the user to read the "more information" document where you can >> post detailed instructions on how to install AquaTk yourself. > > I think the list approach is better because it lets you reuse > the package information you've already entered into the system. > My application, for example, would have PyXML and wxPython as > dependencies. Since those packages would be in the database and > have their own existence test scripts, I would only have to > write a script for my own package and specify that the wxPython > and PyXML packages must pass their existence tests before my > package can be installed. I would assume that dependencies cascade, i.e. your dependencies would only be PyXML and wxPython, and not include their dependencies again. [thinking] Yes, we definitely want to do direct dependencies only, not indirect one. Let's assume that OSX 10.3 includes AquaTk. Then we want to update only the Tkinter dependecy script to cater for this, not everything that uses Tkinter. But, all that said, there is a point in here. One of the problems with CPAN, when I tried it years ago to get a program to sync my Palm to my unix machine, was that it gave you one level of dependencies only. So after loading a couple of packages I had another set of missing packages. When I loaded those I had yet another set. And so on until I abandoned the whole idea:-). So, there's two lessons in here: - The dependencies script should report *all* missing prerequisites, not just the first one. - It should, if possible, do so in a way that can be interpreted by the PIM, so the PIM can run the dependency scripts of the missing prerequisites too. I say "if possible" here, because for external dependencies this won't work (they might even be of the form "you need a machine with a faster CPU"). > Just a thought that popped into my head: what about an > uninstall script? Should that be added into the package > information? I think this is the responsibility of the distutils folks. Hmm, but this does mean that the PIM should keep package source around too. Or, at least, have a preferred location where the downloaded package (as opposed to the installed package) is kept. > I think a "last updated" date should also be included. > Eventually, this would enable the PIM to warn users that they > need to go online and update their package database when it > gets old. I think the database will initially be small enough that it can be loaded whenever you start the PIM. And by the time it's too big for that to be comfortable we can use http caching info to forestall downloading. And by the time it changes too often even for that we're at SPAM v3.0 or higher at least:-) But what might be nice (and not too difficult) is if the PIM has two incarnations: the one included with the distribution (lets call this "pimbase") and a user-installed one, which may be more recent (let's call this "pim"). The PIM GUI would first try to import pim, and if that fails it would import pimbase. If the pim or pimbase, after loading the database, would see from the version numbers that it is too old it would offer to update itself. The update would proceed by the normal means, the new pim would be installed in site-packages and the user could try again. This way we can update the PIM database structure without waiting for a new Python release: we would just replace the old database with a tiny one only offering the newer pim package. And we don't have to maintain databases for a plethora of pim versions: the older ones would only offer the pim upgrade. The URL at which to load the database would be embedded in the pim package, so we could also switch to a distributed scheme later, or a different webhost, or whatever. It does mean that the pim API can never change in an incompatible way (as then the PIM GUI wouldn't be able to communicate with it) but that's a small price to pay. -- - 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 Jack.Jansen@oratrix.com Sun Sep 8 23:12:00 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Mon, 9 Sep 2002 00:12:00 +0200 Subject: [Pythonmac-SIG] First stab at an API for the pim module Message-ID: Folks, here's a rough sketch of an API and a GUI for the Python Install Manager engine. Please shoot holes in it. pim has two types of objects: pimdatabase and pimpackage. It has one module-level method: open(), which returns a pimdatabase. pimdatabase objects have initially one method: list(), which returns a list of all pimpackage objects in the database. Later this will be extended for search routines and the like. pimpackage objects have a couple of methods: - name() returns the name (string) - version() returns the version (string?) - description() returns the one-line description (string) - longdesc() returns the URL of the long description webpage (string) isinstalled() returns a tuple. The first item is a yes/no/outdated/problem indicator. The second is a user-readable description of the first (example: "Installed", "Not installed", "Version 2.0 is installed but 2.5 is available", "Some prerequisites are missing"). - prerequisites() returns a list of prerequisites() for this package that are not currently satisfied. Each list item is a tuple (pimpackage, string). string is again a human-readable explanation, pimpackage is either a pimpackage object or None, in which case the description should tell the user what to do. - install() installs the package. It returns a user-readable string (examples: "Tkinter installed correctly", "Numeric installed correctly, please restart IDE to start using it"). Install needs a couple of arguments, such as download folder for the package, possibly install location, maybe more. This needs thought. The PIM GUI would consist of a browser of packages with an icon showing the isinstalled() state. Select a package and in another section of the window you get the name, version, description and isinstalled() user-readable status, plus buttons more info, check prerequisites and install. Check prerequisites brings up a separate window listing all unsatisfied prerequisites plus the accompanying message. This list is created recursively, so it lists everything needed. Selecting a package here will also select it in the package browser in the main PIM GUI window. (That's why there's a separate window: the user can quickly click through the missing prerequisites and press "install" for each of them). -- - 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 Benjamin.Schollnick@usa.xerox.com Mon Sep 9 15:06:48 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Mon, 09 Sep 2002 10:06:48 -0400 Subject: [Pythonmac-SIG] What is the future of Python on OSX? Message-ID: > Let me take a shot at an initial database format. I'm making this up > as I go, so there's probably holes in it. The XML file has a head > section with the DTD and version and other mumbo-jumbo, and the body > is a list of packages. A package consists of a name, a version, a > one-line description, a URL at which the user can find out more > information, a list of dependencies, an existence test script and an > install script. One large, major comment.... But first, a disclaimer.... I haven't been following this tooo closely... XML is not a database system.... Please don't try to force XML to do a job it has not been designed to fill... Yes it can be used as a "flat" database, but that is probably not going to be suitable (long term).... Instead use Mysql, or some other true database program.... Allow XML to be used for submissions, or for "description files", or whatever... But allow a database program to handle the actual database searches... If we do use a flat database design, based off of XML, then create some form of external indexes to reduce the amount of time we have to parse the XML.... Or possible shelve the XML data.... After every modification, just shelve it to a file, and when it's accessed just load it back in from the shelve.... (I've seen flat database systems that have completely outgrown there capacity....) - Benjamin From Jack.Jansen@oratrix.com Mon Sep 9 15:45:36 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Mon, 9 Sep 2002 16:45:36 +0200 Subject: [Pythonmac-SIG] What is the future of Python on OSX? In-Reply-To: Message-ID: On Monday, September 9, 2002, at 04:06 , Schollnick, Benjamin wrote: > XML is not a database system.... Please don't try to force XML to do a > job > it has not been designed to fill... > > Yes it can be used as a "flat" database, but that is probably not going > to > be suitable (long term).... Instead use Mysql, or some other true > database > program.... > > Allow XML to be used for submissions, or for "description files", or > whatever... But allow a database program to handle the actual database > searches... And Peter de Tagyos wrote something in a similar vein yesterday ("build a web application using zope"). (I'm getting good at pushing all the interesting features into the future:-) You're right, for a full version of SPAM. The initial python install manager will download the whole database, always, and do so in XML form. A future version, that supports actually searching and such, will probably have a server-based database of some form, process the query, and return the results as an XML form. For version 0.9 I want to aim at something that will handle, say, up to 20 packages, binary installs only, MacOSX only. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Chris.Barker@noaa.gov Mon Sep 9 18:11:41 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Mon, 09 Sep 2002 10:11:41 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? References: <343ED1A0-C1EA-11D6-A0D4-003065F40094@tulane.edu> Message-ID: <3D7CD64D.BFC26AE4@noaa.gov> Kevin Ollivier wrote: > I would really, really like to see wxPython become a standard GUI for > Python. So would I, but only to the extent that I want a "standard" GUI at all! > I think it is quite usable and powerful, provides a native look > and feel, gives good performance, and now it does run on all major > platforms. My guess is, however, that it hasn't been included for size > reasons. Anyone else have more info on this? It hasn't been included in the standard disto for a number of reasons, but I don't hink size is a big one. The main one is maturity and stability of versions. Untill fairly recently, wxPython was a pretty fast-moving target. wxWindows is under a whole lot more fast development than TK. It may be that wxPython is now mature enough to be included, but I doubt that it will any time soon. The Core developers are very reluctant to add new packages to the "official" distribution, and rightly so. Personally, I don't hink it's such a big deal. Frankly I depend on a number of extra packages for my work, Python would be a whole lot less usefull without them (Numeric, PIL, mxDateTime, ... ). The Offical Distribution of Python will never have al these packages included. That doesn't mean that we can't have a more complete MacPython. In fact, Jack established this precident by including PIL and Numeric in MacPython for years. What we need is an easy way to add packages, and a repository to put them all in. Jack has some good ideas about that... > I actually do have a single-file, > point-and-click, installer for my OS X wxPython app. Cool! How did you do this? Do you think McMillian's installer could be ported to OS-X ? would that be a better or worse option than the BuildApplication approach?-CHris Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From Chris.Barker@noaa.gov Mon Sep 9 18:37:06 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Mon, 09 Sep 2002 10:37:06 -0700 Subject: [Pythonmac-SIG] What is the future of Python on OSX? References: <5088C421-C1E8-11D6-8D51-003065517236@oratrix.com> Message-ID: <3D7CDC42.9D478E74@noaa.gov> Jack Jansen wrote: > But: I think we can do something that is almost as good, if we > create a simple way by which an end user can install add-on > packages for Python. Some one should take a look at Ciphon: http://sourceforge.net/projects/pythonsiphon And check out the Catalog SIG: http://www.python.org/sigs/catalog-sig/ It hasn't seem much activity lately but there have been some good discussions in the past While it is reasonable to make a Mac only version 0.9, it seems a bit silly to ignore other platforms and other efforts all together when designing the system. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From Benjamin.Schollnick@usa.xerox.com Mon Sep 9 20:10:45 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Mon, 09 Sep 2002 15:10:45 -0400 Subject: [Pythonmac-SIG] What is the future of Python on OSX? Message-ID: > Cool! How did you do this? Do you think McMillian's installer could be > ported to OS-X ? would that be a better or worse option than the > BuildApplication approach?-CHris It (Installer) already supports *nix OSes... So it probably wouldn't be that difficult, at least for MachO support.... But Build Application is roughly comparable... I'm not sure what would be gained.... (I use Installer on the PC, and BuildApplication on the Mac) Can anyone explain where the defects are in BuildApplication, that we need to investigate a different route? - Benjamin From brownr@ucalgary.ca Mon Sep 9 21:48:55 2002 From: brownr@ucalgary.ca (Robb Brown) Date: Mon, 9 Sep 2002 14:48:55 -0600 Subject: [Pythonmac-SIG] Fast way to get a list of unique values? Message-ID: I have a large array (Numeric) of integers. I'd like to get a list of all the unique values in that array. Naturally I'd like to avoid a for loop. Is there an easy way to do this in Python? Thanks, Robb -- ______________________________ Robb Brown Seaman Family MR Research Centre Calgary, Alberta, Canada From bob@redivi.com Mon Sep 9 22:03:07 2002 From: bob@redivi.com (Bob Ippolito) Date: Mon, 9 Sep 2002 17:03:07 -0400 Subject: [Pythonmac-SIG] Fast way to get a list of unique values? In-Reply-To: Message-ID: <89F2CEFA-C437-11D6-AEA2-0003938210D6@redivi.com> The only ways I know of doing this in python are to use a for loop.. either creating a dictionary with keys set to those values, or sorting the list and making the new list from the first time you see a particular element. Unless I'm mistaken, trying to hack it out any other way (without breaking out a C compiler) would be much slower. -bob On Monday, Sep 9, 2002, at 16:48 US/Eastern, Robb Brown wrote: > > I have a large array (Numeric) of integers. I'd like to get a list of > all the unique values in that array. Naturally I'd like to avoid a > for loop. Is there an easy way to do this in Python? > > Thanks, > > Robb From lmeyn@mail.arc.nasa.gov Mon Sep 9 22:14:01 2002 From: lmeyn@mail.arc.nasa.gov (Larry Meyn) Date: Mon, 9 Sep 2002 14:14:01 -0700 Subject: [Pythonmac-SIG] Fast way to get a list of unique values? In-Reply-To: Message-ID: <0FF8839C-C439-11D6-A9A2-00306546DFB6@mail.arc.nasa.gov> --Apple-Mail-2--388249761 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Here's a function from the Python Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 def unique(s): """Return a list of the elements in s, but without duplicates. For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3], unique("abcabc") some permutation of ["a", "b", "c"], and unique(([1, 2], [2, 3], [1, 2])) some permutation of [[2, 3], [1, 2]]. For best speed, all sequence elements should be hashable. Then unique() will usually work in linear time. If not possible, the sequence elements should enjoy a total ordering, and if list(s).sort() doesn't raise TypeError it's assumed that they do enjoy a total ordering. Then unique() will usually work in O(N*log2(N)) time. If that's not possible either, the sequence elements must support equality-testing. Then unique() will usually work in quadratic time. """ n = len(s) if n == 0: return [] # Try using a dict first, as that's the fastest and will usually # work. If it doesn't work, it will usually fail quickly, so it # usually doesn't cost much to *try* it. It requires that all the # sequence elements be hashable, and support equality comparison. u = {} try: for x in s: u[x] = 1 except TypeError: del u # move on to the next method else: return u.keys() # We can't hash all the elements. Second fastest is to sort, # which brings the equal elements together; then duplicates are # easy to weed out in a single pass. # NOTE: Python's list.sort() was designed to be efficient in the # presence of many duplicate elements. This isn't true of all # sort functions in all languages or libraries, so this approach # is more effective in Python than it may be elsewhere. try: t = list(s) t.sort() except TypeError: del t # move on to the next method else: assert n > 0 last = t[0] lasti = i = 1 while i < n: if t[i] != last: t[lasti] = last = t[i] lasti += 1 i += 1 return t[:lasti] # Brute force is all that's left. u = [] for x in s: if x not in u: u.append(x) return u On Monday, September 9, 2002, at 01:48 PM, Robb Brown wrote: > > I have a large array (Numeric) of integers. I'd like to get a list of > all the unique values in that array. Naturally I'd like to avoid a > for loop. Is there an easy way to do this in Python? > > Thanks, > > Robb > -- > ______________________________ > Robb Brown > Seaman Family MR Research Centre > Calgary, Alberta, Canada > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > Larry Meyn Aerospace Operations Modeling Office M/S 210-10 Phone: (650) 604-5038 NASA Ames Research Center Fax: (650) 604-0222 Moffett Field, CA 94035-1000 E-mail: lmeyn@mail.arc.nasa.gov E-Fax: (425) 944-5526 sent via e-mail --Apple-Mail-2--388249761 Content-Transfer-Encoding: 7bit Content-Type: text/enriched; charset=US-ASCII Here's a function from the Python Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 def unique(s): """Return a list of the elements in s, but without duplicates. For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3], unique("abcabc") some permutation of ["a", "b", "c"], and unique(([1, 2], [2, 3], [1, 2])) some permutation of [[2, 3], [1, 2]]. For best speed, all sequence elements should be hashable. Then unique() will usually work in linear time. If not possible, the sequence elements should enjoy a total ordering, and if list(s).sort() doesn't raise TypeError it's assumed that they do enjoy a total ordering. Then unique() will usually work in O(N*log2(N)) time. If that's not possible either, the sequence elements must support equality-testing. Then unique() will usually work in quadratic time. """ n = len(s) if n == 0: return [] # Try using a dict first, as that's the fastest and will usually # work. If it doesn't work, it will usually fail quickly, so it # usually doesn't cost much to *try* it. It requires that all the # sequence elements be hashable, and support equality comparison. u = {} try: for x in s: u[x] = 1 except TypeError: del u # move on to the next method else: return u.keys() # We can't hash all the elements. Second fastest is to sort, # which brings the equal elements together; then duplicates are # easy to weed out in a single pass. # NOTE: Python's list.sort() was designed to be efficient in the # presence of many duplicate elements. This isn't true of all # sort functions in all languages or libraries, so this approach # is more effective in Python than it may be elsewhere. try: t = list(s) t.sort() except TypeError: del t # move on to the next method else: assert n > 0 last = t[0] lasti = i = 1 while i << n: if t[i] != last: t[lasti] = last = t[i] lasti += 1 i += 1 return t[:lasti] # Brute force is all that's left. u = [] for x in s: if x not in u: u.append(x) return u On Monday, September 9, 2002, at 01:48 PM, Robb Brown wrote: I have a large array (Numeric) of integers. I'd like to get a list of all the unique values in that array. Naturally I'd like to avoid a for loop. Is there an easy way to do this in Python? Thanks, Robb -- ______________________________ Robb Brown Seaman Family MR Research Centre Calgary, Alberta, Canada _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig CourierLarry Meyn Aerospace Operations Modeling Office M/S 210-10 Phone: (650) 604-5038 NASA Ames Research Center Fax: (650) 604-0222 Moffett Field, CA 94035-1000 E-mail: lmeyn@mail.arc.nasa.gov E-Fax: (425) 944-5526 sent via e-mail --Apple-Mail-2--388249761-- From Chris.Barker@noaa.gov Tue Sep 10 04:48:08 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Mon, 09 Sep 2002 20:48:08 -0700 Subject: [Pythonmac-SIG] Fast way to get a list of unique values? References: Message-ID: <3D7D6B78.48767D46@noaa.gov> Robb Brown wrote: > I have a large array (Numeric) of integers. I'd like to get a list > of all the unique values in that array. Naturally I'd like to avoid > a for loop. Is there an easy way to do this in Python? I can't think of one off the top of my head, but this would be a good question for the Numeric Mailing list: https://lists.sourceforge.net/lists/listinfo/numpy-discussion I'm sure someone on that list will have a trick up their sleeve. Also, this would be a good chance to check out Pyrex, rather than C code, of you really need the speed: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ -Chris From landauer@got.net Tue Sep 10 01:30:57 2002 From: landauer@got.net (landauer@got.net) Date: Mon, 9 Sep 2002 17:30:57 -0700 Subject: [Pythonmac-SIG] Fast way to get a list of unique values? In-Reply-To: References: Message-ID: <1031617857.3d7d3d410fb6b@webmail.got.net> Quoting Robb Brown : > > I have a large array (Numeric) of integers. I'd like to get a list > of all the unique values in that array. Naturally I'd like to avoid > a for loop. Here's one way. It does avoid using a for loop. I'm guessing that it isn't quite exactly what you wanted. Fun exercise, though. See below for a more serious suggestion. (This is *Python*, after all...) #!/usr/bin/env python # # Robb has a "large array (Numeric) of integers. I'd like to get # a list of all the unique values in that array. Naturally I'd like # to avoid a for loop. Is there an easy way to do this in Python? # # No mention of speed ... # from operator import __mul__ # --- from the cookbook, w/ slight mods -- # Sieve of Eratosthenes # David Eppstein, UC Irvine, 28 Feb 2002 # From the ASPN Python cookbook ... # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117119 # from __future__ import generators def eratosthenes (): '''Yields the sequence of prime numbers via the Sieve of Eratosthenes.''' D = {} # map composite integers to primes witnessing their compositeness q = 2 # first integer to test for primality while 1: if q not in D: yield q # not marked composite, must be prime D[q*q] = [q] # first multiple of q not already marked else: map( lambda p: D.setdefault(p+q,[]).append(p), D[q] ) del D[q] # no longer need D[q], free memory q += 1 primes_iter = eratosthenes() primes_list = [ ] prim_d = { } def primes ( n ): while len(primes_list) <= n: nx = primes_iter.next() primes_list.append( nx ) prim_d[ nx ] = len(primes_list)-1 return primes_list[n] def uniq ( arr ): # map the array into a goedel number of sorts gm = min( arr ) gx = max( arr ) # offset the list to n in [ 0 .. max-min+1 ] # and then find the nth prime bias = map( lambda x: primes(x-gm), arr ) # blast all those primes together goedel = reduce( __mul__, bias ) # find the ones that factor into goedel fax = filter( lambda n: goedel%n == 0, primes_list ) # print len(arr), arr # print bias # print goedel # print len(fax), fax return map( lambda z: prim_d[z] + gm, fax ) if __name__ == "__main__": def test_e (): iter = eratosthenes() lst = [] while 1: ff = iter.next() lst.append( ff ) print ff if ff > 1000: break print lst[ -12: ] def test_p (): print primes( 12 ) def test (): arr = [ -9, -2, -4, 0, 19, 2, 42, -9, -2, -4, 0, 19, 2, 421, 32, 42 ] print uniq( arr ) test_e() test_p() test() > Is there an easy way to do this in Python? You do not tell us where you acquired that "large array". My suggestion, given the lack of any other detail, would be to see if it's possible to create that array as a dict instead (with the numbers as keys, as Bob mentioned). I.e., do the unique-ifying while building the array, instead of treating it as a separate problem. -=-=-=- food. shelter. clothing. net. Got.net - The Internet Connection, Inc From footrot@mac.com Tue Sep 10 12:54:55 2002 From: footrot@mac.com (Matthew Smith) Date: Tue, 10 Sep 2002 21:54:55 +1000 Subject: [Pythonmac-SIG] Framework install Message-ID: Hello, I'm having a bit of trouble with the 2.2.1 python framework install, I downloaded the latest source, then typed: ./configure --enable-framework sudo make install The problem is that the framework that is installed at /Library/Frameworks does not have the header alias at all, and the framework that was created in the download directory does has a blank alias (cannot be found) as the one that shopuld point to the header files... Any idea what could cause this, and how I could fix it??? Thanks for the help, Matt Smith From Jack.Jansen@cwi.nl Tue Sep 10 13:29:04 2002 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Tue, 10 Sep 2002 14:29:04 +0200 Subject: [Pythonmac-SIG] Framework install In-Reply-To: Message-ID: On Tuesday, September 10, 2002, at 01:54 , Matthew Smith wrote: > Hello, > > I'm having a bit of trouble with the 2.2.1 python framework install, > > I downloaded the latest source, then typed: > ./configure --enable-framework > sudo make install In a framework build you must do "make frameworkinstall" in stead of "make install". 2.3 will test for this explicitly (you don't want to know how often I got bit by this myself:-) -- - 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 brownr@ucalgary.ca Tue Sep 10 18:29:49 2002 From: brownr@ucalgary.ca (Robb Brown) Date: Tue, 10 Sep 2002 11:29:49 -0600 Subject: [Pythonmac-SIG] Fast way to get a list of unique values? In-Reply-To: <1031617857.3d7d3d410fb6b@webmail.got.net> References: <1031617857.3d7d3d410fb6b@webmail.got.net> Message-ID: Thanks for all the replies! Much as I'm tempted to use your first method.... :) The array is a volume mask for medical data. The problem is that there may be several masks in the same file (several different segmented tissues). If I have a list of the unique values, I know how many tissues are present and can divide them into separate objects. Because of the size of these volumes I suspect it's time to break out the C compiler. >Quoting Robb Brown : >> >> I have a large array (Numeric) of integers. I'd like to get a list >> of all the unique values in that array. Naturally I'd like to avoid >> a for loop. > >Here's one way. It does avoid using a for loop. >I'm guessing that it isn't quite exactly what you wanted. >Fun exercise, though. See below for a more serious suggestion. >(This is *Python*, after all...) > >#!/usr/bin/env python ># ># Robb has a "large array (Numeric) of integers. I'd like to get ># a list of all the unique values in that array. Naturally I'd like ># to avoid a for loop. Is there an easy way to do this in Python? ># ># No mention of speed ... ># > >from operator import __mul__ > ># --- from the cookbook, w/ slight mods -- ># Sieve of Eratosthenes ># David Eppstein, UC Irvine, 28 Feb 2002 ># From the ASPN Python cookbook ... ># http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117119 ># >from __future__ import generators > >def eratosthenes (): > '''Yields the sequence of prime numbers via the Sieve of Eratosthenes.''' > D = {} # map composite integers to primes witnessing their compositeness > q = 2 # first integer to test for primality > while 1: > if q not in D: > yield q # not marked composite, must be prime > D[q*q] = [q] # first multiple of q not already marked > else: > map( lambda p: D.setdefault(p+q,[]).append(p), D[q] ) > del D[q] # no longer need D[q], free memory > q += 1 > >primes_iter = eratosthenes() >primes_list = [ ] >prim_d = { } > >def primes ( n ): > while len(primes_list) <= n: > nx = primes_iter.next() > primes_list.append( nx ) > prim_d[ nx ] = len(primes_list)-1 > return primes_list[n] > >def uniq ( arr ): > # map the array into a goedel number of sorts > gm = min( arr ) > gx = max( arr ) > > # offset the list to n in [ 0 .. max-min+1 ] > # and then find the nth prime > bias = map( lambda x: primes(x-gm), arr ) > > # blast all those primes together > goedel = reduce( __mul__, bias ) > > # find the ones that factor into goedel > fax = filter( lambda n: goedel%n == 0, primes_list ) > > # print len(arr), arr > # print bias > # print goedel > # print len(fax), fax > return map( lambda z: prim_d[z] + gm, fax ) > >if __name__ == "__main__": > def test_e (): > iter = eratosthenes() > lst = [] > while 1: > ff = iter.next() > lst.append( ff ) > print ff > if ff > 1000: > break > print lst[ -12: ] > > def test_p (): > print primes( 12 ) > > def test (): > arr = [ -9, -2, -4, 0, 19, 2, 42, -9, -2, -4, 0, 19, 2, 421, 32, 42 ] > print uniq( arr ) > > test_e() > test_p() > > test() > > >> Is there an easy way to do this in Python? > >You do not tell us where you acquired that "large array". >My suggestion, given the lack of any other detail, would be to see if >it's possible to create that array as a dict instead (with the numbers >as keys, as Bob mentioned). I.e., do the unique-ifying while building >the array, instead of treating it as a separate problem. > > > > >-=-=-=- > >food. shelter. clothing. net. Got.net - The Internet Connection, Inc -- ______________________________ Robb Brown Seaman Family MR Research Centre Calgary, Alberta, Canada From Robin.Siebler@palmsource.com Tue Sep 10 19:54:27 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Tue, 10 Sep 2002 11:54:27 -0700 Subject: [Pythonmac-SIG] Requesting a port? Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF90A@ussunm001.palmsource.com> How do you request to get something ported to the Mac (assuming that the = author of the program doesn't have a Mac)? I just stumbled across a = Midnight Command clone that is written in Python. When I try to run it = on the Mac, I get the following error: 'Bus Error'. I don't know what = this means, but I assume this is some Mac specific problem. The program = is called lfm and can be found here: = http://www.terra.es/personal7/inigoserna/lfm Robin L. Siebler Software Test Engineer Palm --------------------------------------- Moe Szyslak: They think they're so high and mighty, just because they = never got caught driving without pants. From bfancher@mac.com Tue Sep 10 20:39:29 2002 From: bfancher@mac.com (bill fancher) Date: Tue, 10 Sep 2002 12:39:29 -0700 Subject: [Pythonmac-SIG] Crashing on test_pep263.py when installing 2.3 from CVS on 10.2 Message-ID: <05E87F89-C4F5-11D6-88CD-0005029E8B13@mac.com> Is anyone else seeing this? I noticed that test_pep263.py has changed recently (36 hours ago), but I'm crashing before hitting the change. -- bill From Jack.Jansen@oratrix.com Tue Sep 10 21:00:57 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 10 Sep 2002 22:00:57 +0200 Subject: [Pythonmac-SIG] Requesting a port? In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF90A@ussunm001.palmsource.com> Message-ID: <05B9DD91-C4F8-11D6-88B2-003065517236@oratrix.com> On dinsdag, september 10, 2002, at 08:54 , Robin Siebler wrote: > How do you request to get something ported to the Mac (assuming > that the author of the program doesn't have a Mac)? I just > stumbled across a Midnight Command clone that is written in > Python. When I try to run it on the Mac, I get the following > error: 'Bus Error'. I don't know what this means, but I assume > this is some Mac specific problem. The program is called lfm > and can be found here: > http://www.terra.es/personal7/inigoserna/lfm Having only had a quick glance at the web page my guess is that the problem is curses. lfm uses curses, and the curses supported by MacOSX isn't good enough for the Python curses module. (On MacOS9 there is no such thing as curses, and I think that on Jaguar there may be a good enough version, ncurses, but I'm not 100% sure). I still don't understand why it would crash Python with a bus error, though... -- - 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 Jack.Jansen@oratrix.com Tue Sep 10 22:06:35 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 10 Sep 2002 23:06:35 +0200 Subject: [Pythonmac-SIG] Crashing on test_pep263.py when installing 2.3 from CVS on 10.2 In-Reply-To: <05E87F89-C4F5-11D6-88CD-0005029E8B13@mac.com> Message-ID: <3068868F-C501-11D6-88B2-003065517236@oratrix.com> On dinsdag, september 10, 2002, at 09:39 , bill fancher wrote: > Is anyone else seeing this? I noticed that test_pep263.py has > changed recently (36 hours ago), but I'm crashing before > hitting the change. No problem here, neither in a framework build nor in a non-framework build. -- - 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 aparente@adobe.com Wed Sep 11 01:42:45 2002 From: aparente@adobe.com (Alexandre Parenteau) Date: Tue, 10 Sep 2002 17:42:45 -0700 Subject: [Pythonmac-SIG] Re: [wxPython-mac] Python that ships with Jaguar vs... In-Reply-To: <3D7E7364.47DAEA29@noaa.gov> Message-ID: > Kevin et al.. > > From what I have heard, Apple has shipped a straight Unix Python. I > suppose they did this because it's easy and they are mostly thinking of > supporting CGI and shell type scripting. To the credit of Apple, it is only recently, and far after the freeze of Jaguar, than it became obvious (at least to me) that MacPython was going to default to the framework layout. But that raises an interesting question of how to deal with Apple (or Apple with Python) as far as packaging is concerned. Is now python part of the Darwin project ? Did someone see a python folder popping up in the CVS folders of Darwin ? If that is the case, a simple patch that tweaks the Darwin makefile for Python might be enough, and we just have to suggest it. If not, we need to find out who is in charge at Apple. Alex. From tony@lownds.com Wed Sep 11 02:08:02 2002 From: tony@lownds.com (Tony Lownds) Date: Tue, 10 Sep 2002 18:08:02 -0700 Subject: [Pythonmac-SIG] Re: [wxPython-mac] Python that ships with Jaguar vs... In-Reply-To: References: Message-ID: Hi Alex, At 5:42 PM -0700 9/10/02, Alexandre Parenteau wrote: >Is now python part of the Darwin project ? Did someone see a python folder >popping up in the CVS folders of Darwin ? If that is the case, a simple >patch that tweaks the Darwin makefile for Python might be enough, and we >just have to suggest it. Yes, the CVS folders of Darwin do have python in them. You need to register to view it via cvsweb, so no URL, but I've seen it in there. It's worth a shot! -Tony From bbum@codefab.com Wed Sep 11 02:21:19 2002 From: bbum@codefab.com (Bill Bumgarner) Date: Tue, 10 Sep 2002 21:21:19 -0400 Subject: [Pythonmac-SIG] Re: [wxPython-mac] Python that ships with Jaguar vs... In-Reply-To: <20020911005535.1320.30534@gamer.semi-retired.com> Message-ID: Apple hadn't shipped Python with the system to this point in time because Python was too much in flux during the period of time that Apple was in the process of freezing the system. Bummer that they didn't stick with one version behind, but considering that Fink has always provided the latest stable version of python via a simple command (fink install python), it was not a big deal and, likely, caused less hell than shipping a version of python one major version behind the rest of the world. In terms of the Python-as-a-framework build, it was wwwwaaayyyy in flux in the middle of when Jaguar was frozen many months ago. Keep in mind that Jaguar and Darwin are frozen *months* before release. On the above-darwin layers, this means that changes may still happen to fix bugs, etc. On the below darwin layers, it means that whatever version of the various random utilities-- curl, perl, python, ruby, etc... -- are frozen until after the system ships. A python folder *should* be in Darwin somewhere -- I haven't looked. It is clearly a *relatively* default build, though it seems to be missing a .a, as well. However, there is no conflict with simply doing 'fink install python' to provide a library. If anything, someone should put together a Fink package that installs python as a framework. This makes it extremely accessible and also gives the Apple folks an easy way to grab and install the package or -- at the least -- see the patches necessary to make the build happen. However, for Apple to release Python as a framework requires significant effort above and beyond simply providing a buildable source tree. They have to verify that it doesn't conflict with other parts of the system -- sounds trivial, but isn't entirely so because it also requires that building the Python based framework install can be totally quantified and totally automated (i.e. what if a security hole is discovered and Apple has to release a .pkg that includes just Python?). If you have simple tweaks for the makefile, please ensure that a Fink package is created and also file a bugreport.apple.com based feature request that includes both a request for the framework build of Python AND the instructions on how to do so! I would *love* to see Python.framework as a standard part of the system -- it will take time. And while you are at it, make sure you pick up the PyObjC module. Ronald has done an ABSOLUTELY INCREDIBLY FREAKIN' AMAZING job of pushing the project forward to the point where you can build Real World Cocoa applications using Python -- including using Python to subclass ObjC classes. AWESOME! b.bum On Tuesday, Sep 10, 2002, at 20:55 US/Eastern, Kevin Altis wrote: > -----Original Message----- > From: "Alexandre Parenteau" > To: "wxPyMac" , > "Chris Barker" , > "MacPython" > Subject: Re: [wxPython-mac] Python that ships with Jaguar vs... > Date: Tue, 10 Sep 2002 17:42:45 -0700 > >> Kevin et al.. >> >> From what I have heard, Apple has shipped a straight Unix Python. I >> suppose they did this because it's easy and they are mostly thinking >> of >> supporting CGI and shell type scripting. > > To the credit of Apple, it is only recently, and far after the freeze > of > Jaguar, than it became obvious (at least to me) that MacPython was > going to > default to the framework layout. > > But that raises an interesting question of how to deal with Apple (or > Apple > with Python) as far as packaging is concerned. > > Is now python part of the Darwin project ? Did someone see a python > folder > popping up in the CVS folders of Darwin ? If that is the case, a simple > patch that tweaks the Darwin makefile for Python might be enough, and > we > just have to suggest it. > > If not, we need to find out who is in charge at Apple. > > Alex. > > > _______________________________________________ > wxPython-mac mailing list > wxPython-mac@lists.wxwindows.org > http://lists.wxwindows.org/mailman/listinfo/wxpython-mac > b.bum Wake up. Breathe.... .... keep breathing. From Jack.Jansen@cwi.nl Wed Sep 11 12:34:29 2002 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Wed, 11 Sep 2002 13:34:29 +0200 Subject: [Pythonmac-SIG] Re: [wxPython-mac] Python that ships with Jaguar vs... In-Reply-To: <3D7E7364.47DAEA29@noaa.gov> Message-ID: <6F649554-C57A-11D6-BA6F-0030655234CE@cwi.nl> Kevin Altis wrote: > After installing Jaguar, running python at the Terminal shows: > > Python 2.2 (#1, 07/14/02, 23:25:09) > [GCC Apple cpp-precomp 6.14] on darwin > Type "help", "copyright", "credits" or "license" for more information. > > In addition, there is no longer any pythonw in place, so the Jaguar > installation must have wiped it out. Check your PATH variable. I noticed that /usr/local/bin is no longer in the default path, and that's probably where you installed your framework python and pythonw. On Wednesday, September 11, 2002, at 12:34 , Chris Barker wrote: > Apparently no one at Apple thought to get in touch with Jack or this > list to find out what was going on with Python on OS-X. Too bad. Maybe > they'll learn to understand open source development eventually. Actually, they did get into touch with me (albeit at a late stage) and I suggested they stay away from the framework build for now. Not that it mattered any what I said, as things were underway too long anyway (I did try to get 2.2.1 in stead of 2.2 included, but even that wasn't possible anymore). The 2.2.1 framework build has too few advantages over the non-framework build (and the 2.2 framework build was basically non-functional). Moreover, there are potential problems with it (for instance the crash if you import a Carbon or other windowing module if you don't have access to the window server). What I think we should do is go full speed ahead with a decent framework build for Python 2.3, and make sure that such a build can coexist with Apple's non-framework 2.2 with as little confusion to the user as possible. If Apple stick to the 9 month release cycle that seems to be appearing then Python 2.3 will probably miss the window for MacOSX 10.3 anyway. But if PythonLauncher and the IDE and such tools are aware of the fact that there are probably two distinct Python installations there really isn't much of a problem. And it gives us the freedom to do development in our own time, in stead of being tied to someone else's release schedule. (Incidentally, this de-coupling of release schedules is also why I'm hammering on this Python Install Manager stuff over on pythonmac-sig: with wxPython and PyObjC and such seeing so much activity at the moment it would be a real shame if new versions would become available to the general public only when a full Python release is done. If the PIM can make it relatively painless to install and upgrade packages we can have our cake and eat it too. -- - 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 Benjamin.Schollnick@usa.xerox.com Wed Sep 11 16:27:12 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Wed, 11 Sep 2002 11:27:12 -0400 Subject: [Pythonmac-SIG] Re: [wxPython-mac] Python that ships with Jag uar vs... Message-ID: I'm sorry... I couldn't resist... > If not, we need to find out who is in charge at Apple. Alex, I would think that was obvious.... Mr. S. Jobs.... But seriously: I did a google search: Document: Building Darwin HOWTO by Rob Braun Darwin Committer Revision History Revision 2 8 October 2001 rjh - rhayden@apple.com I'd suggest asking bbraun@synack.net about the darwin committing process, or worse case, check with rhayden@apple.com. - Benjamin -----Original Message----- From: Alexandre Parenteau [mailto:aparente@adobe.com] Sent: Tuesday, September 10, 2002 8:43 PM To: wxPyMac; Chris Barker; MacPython Subject: [Pythonmac-SIG] Re: [wxPython-mac] Python that ships with Jaguar vs... > Kevin et al.. > > From what I have heard, Apple has shipped a straight Unix Python. I > suppose they did this because it's easy and they are mostly thinking of > supporting CGI and shell type scripting. To the credit of Apple, it is only recently, and far after the freeze of Jaguar, than it became obvious (at least to me) that MacPython was going to default to the framework layout. But that raises an interesting question of how to deal with Apple (or Apple with Python) as far as packaging is concerned. Is now python part of the Darwin project ? Did someone see a python folder popping up in the CVS folders of Darwin ? If that is the case, a simple patch that tweaks the Darwin makefile for Python might be enough, and we just have to suggest it. If not, we need to find out who is in charge at Apple. Alex. _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig From english@spiritone.com Wed Sep 11 16:59:56 2002 From: english@spiritone.com (Josh English) Date: 11 Sep 2002 08:59:56 -0700 Subject: [Pythonmac-SIG] Geting information about images Message-ID: <3D7F6880.6B8841F7@spiritone.com> I have a quick question which will probably lead to a long answer. I would like to find a way for python to examine a .jpeg or .gif file and return the image dimensions in pixels. I've been looking through the img* files but I can't find anything so simple. Thanks for any help, Josh English english@spiritone.com From gherman@darwin.in-berlin.de Wed Sep 11 18:02:15 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Wed, 11 Sep 2002 19:02:15 +0200 Subject: [Pythonmac-SIG] Geting information about images In-Reply-To: <3D7F6880.6B8841F7@spiritone.com> Message-ID: <38DC7CC4-C5A8-11D6-A96B-00039345C610@darwin.in-berlin.de> Josh English: > I have a quick question which will probably lead to a long answer. I > would like to find a way for python to examine a .jpeg or .gif file and > return the image dimensions in pixels. > > I've been looking through the img* files but I can't find anything so > simple. > > Thanks for any help, Let me try giving a short answer. What you need is PIL from pythonware.com. Then you can write a snippet like the one below. Dinu >>> import Image >>> im = Image.open("lena.jpg") >>> print im.format, im.size, im.mode JPEG (208, 222) RGB >>> im.save("lena.png", "PNG") From ariza@flexatone.com Wed Sep 11 19:02:19 2002 From: ariza@flexatone.com (christopher ariza) Date: Wed, 11 Sep 2002 14:02:19 -0400 (EDT) Subject: [Pythonmac-SIG] Python that ships with Jaguar vs... In-Reply-To: <20020911160003.13531.58779.Mailman@mail.python.org> Message-ID: while we are on the issue of the jaguar python, it seems that xml.dom.minidom is broken in the python that apple ships: [GCC Apple cpp-precomp 6.14] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import xml.dom.minidom >>> doc = xml.dom.minidom.parseString("my document.") Traceback (most recent call last): File "", line 1, in ? File "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/dom/ minidom.py", line 965, in parseString File "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/dom/ minidom.py", line 951, in _doparse File "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/dom/ pulldom.py", line 340, in parseString File "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/sax/ __init__.py", line 93, in make_parser xml.sax._exceptions.SAXReaderNotAvailable: No parsers found >>> can somebody with 10.2 test this for me? what is this /BinaryCache? i dont have 10.2 yet so i have this information from someone else. eitherway, i was under the impression that xml.dom.minidom was standard python: this works in win, MacPython, and macho-python. can anyone tell me why it would not work in what is supposed to be a 'standard' unix build? many thanks. ____________________ christopher ariza http://flexatone.com From dkwolfe@pacbell.net Wed Sep 11 19:07:49 2002 From: dkwolfe@pacbell.net (Dan Wolfe) Date: Wed, 11 Sep 2002 11:07:49 -0700 Subject: [Pythonmac-SIG] Python that ships with Jaguar vs... In-Reply-To: Message-ID: <61B807BB-C5B1-11D6-A930-003065ABC53C@pacbell.net> Just to hazard a guess but you don't have expat installed do you? I believe starting with Python 2.3, expat is being installed as part of the python. - Dan On Wednesday, September 11, 2002, at 11:02 AM, christopher ariza wrote: > while we are on the issue of the jaguar python, it seems that > xml.dom.minidom is broken in the python that apple ships: > > [GCC Apple cpp-precomp 6.14] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import xml.dom.minidom >>>> doc = xml.dom.minidom.parseString("my document.") > > Traceback (most recent call last): > File "", line 1, in ? > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/dom/ > minidom.py", line 965, in parseString > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/dom/ > minidom.py", line 951, in _doparse > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/dom/ > pulldom.py", line 340, in parseString > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/sax/ > __init__.py", line 93, in make_parser > xml.sax._exceptions.SAXReaderNotAvailable: No parsers found >>>> > > can somebody with 10.2 test this for me? what is this /BinaryCache? i > dont > have 10.2 yet so i have this information from someone else. eitherway, > i > was under the impression that xml.dom.minidom was standard python: this > works in win, MacPython, and macho-python. can anyone tell me why it > would > not work in what is supposed to be a 'standard' unix build? many > thanks. From bfancher@mac.com Wed Sep 11 21:55:18 2002 From: bfancher@mac.com (bill fancher) Date: Wed, 11 Sep 2002 13:55:18 -0700 Subject: [Pythonmac-SIG] Python that ships with Jaguar vs... In-Reply-To: Message-ID: On Wednesday, September 11, 2002, at 11:02 AM, christopher ariza wrote: > > while we are on the issue of the jaguar python, it seems that > xml.dom.minidom is broken in the python that apple ships: > > [GCC Apple cpp-precomp 6.14] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> import xml.dom.minidom >>>> doc = xml.dom.minidom.parseString("my document.") > > Traceback (most recent call last): > File "", line 1, in ? > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/dom/ > minidom.py", line 965, in parseString > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/dom/ > minidom.py", line 951, in _doparse > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/dom/ > pulldom.py", line 340, in parseString > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/sax/ > __init__.py", line 93, in make_parser > xml.sax._exceptions.SAXReaderNotAvailable: No parsers found >>>> > > can somebody with 10.2 test this for me? I get the same thing here. > what is this /BinaryCache? It's apparently an artifact of the build process. All the pyc and pyo files have this embedded. Recompiling the scripts in /usr/lib/python2.2 results in the paths you'd expect, but the error persists. > i dont > have 10.2 yet so i have this information from someone else. eitherway, > i > was under the impression that xml.dom.minidom was standard python: this > works in win, MacPython, and macho-python. can anyone tell me why it > would > not work in what is supposed to be a 'standard' unix build? many > thanks. I certainly can't. "import xml.sax.expatreader" works OK, and it appears that expatreader is in fact what it's looking for. Running the problem command a second time gets a different error: >>> doc = xml.dom.minidom.parseString("my document.") Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.2/xml/dom/minidom.py", line 965, in parseString return _doparse(pulldom.parseString, args, kwargs) File "/usr/lib/python2.2/xml/dom/minidom.py", line 951, in _doparse events = apply(func, args, kwargs) File "/usr/lib/python2.2/xml/dom/pulldom.py", line 340, in parseString parser = xml.sax.make_parser() File "/usr/lib/python2.2/xml/sax/__init__.py", line 81, in make_parser return _create_parser(parser_name) File "/usr/lib/python2.2/xml/sax/__init__.py", line 106, in _create_parser return drv_module.create_parser() AttributeError: 'module' object has no attribute 'create_parser' OTOH, it works OK with 2.3. Don't have time to look into this further at the moment. HTH, -- bill From tony@lownds.com Wed Sep 11 22:11:50 2002 From: tony@lownds.com (Tony Lownds) Date: Wed, 11 Sep 2002 14:11:50 -0700 Subject: [Pythonmac-SIG] Python that ships with Jaguar vs... In-Reply-To: References: Message-ID: >> i dont >>have 10.2 yet so i have this information from someone else. eitherway, i >>was under the impression that xml.dom.minidom was standard python: this >>works in win, MacPython, and macho-python. can anyone tell me why it would >>not work in what is supposed to be a 'standard' unix build? many thanks. > >I certainly can't. "import xml.sax.expatreader" works OK, and it >appears that expatreader is in fact what it's looking for. Running >the problem command a second time gets a different error: I can explain why it works the second time: import xml.sax.expatreader actually doesn't work, but if you run it twice you do not get an exception the second time. This is because there is a half-initialized module object in sys.modules['xml.sax.expatreader '] by the time the "expat not supprted" exception happens. When you import a second time the empty, half-initialized module is found in sys.modules. Python 2.2 (#1, 07/14/02, 23:25:09) [GCC Apple cpp-precomp 6.14] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import xml.sax.expatreader Traceback (most recent call last): File "", line 1, in ? File "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/xml/sax/expatreader.py", line 19, in ? xml.sax._exceptions.SAXReaderNotAvailable: expat not supported >>> import xml.sax.expatreader >>> I guess that expat was not included in darwin because there are problems with the makefile in the canonical release of expat (on the author's homepage) - it didn't make a libexpat.a. That's also why expat was copied into the Python source tree, IIRC. -Tony From Jack.Jansen@oratrix.com Wed Sep 11 23:00:05 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Thu, 12 Sep 2002 00:00:05 +0200 Subject: [Pythonmac-SIG] Need help with AppleEvent bug Message-ID: Folks, I need help from some AppleScript gurus. Robin Siebler posted bug http://www.python.org/sf/598981 which has to do with a get() call to CodeWarrior to get the data of the frontmost window returning None. Bill Fancher suggested that this might have to do with Python not supporting the cText AppleScript type, but that would have shown up differently: you would have gotten a return value, but of type aetypes.Unknown('ctxt', 'raw data'). I ran the thing under the debugger, and it turns out the reply AppleEvent from AESend() indeed doesn't have a '----' parameter, and it doesn't have an 'errn' error code either. So, returning None is the right thing to do. But the corresponding AppleScript works fine... Now I very vaguely remember something about there being a second protocol for sending replies to AppleEvents (maybe for long replies >= 32K? I don't remember... And maybe I'm completely confused with something else, like the funny CGI protocol with AppleScript) but I can't find anything after looking through the documentation. So, to sum it up, I'm out of my water and need a bit of help. The bug report has everything you need to reproduce this. -- - 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 altis@semi-retired.com Wed Sep 11 23:48:47 2002 From: altis@semi-retired.com (Kevin Altis) Date: Wed, 11 Sep 2002 15:48:47 -0700 Subject: [Pythonmac-SIG] RE: [wxPython-mac] Python that ships with Jaguar vs... In-Reply-To: <6F649554-C57A-11D6-BA6F-0030655234CE@cwi.nl> Message-ID: > From: Jack Jansen > > Kevin Altis wrote: > > After installing Jaguar, running python at the Terminal shows: > > > > Python 2.2 (#1, 07/14/02, 23:25:09) > > [GCC Apple cpp-precomp 6.14] on darwin > > Type "help", "copyright", "credits" or "license" for more information. > > > > In addition, there is no longer any pythonw in place, so the Jaguar > > installation must have wiped it out. > > Check your PATH variable. I noticed that /usr/local/bin is no longer in > the default path, and that's probably where you installed your framework > python and pythonw. Yep, /usr/local/bin is not part of the PATH and /usr/local/bin is where everything is installed. Since users won't have /usr/local/bin on their path by default should the location of pythonw... be changed to simplify installation or what is going to be the recommended change users have to make to their configuration so the framework build MachoPython gets used? Will that impact the "Python" that the Finder uses to launch an app as well? I went ahead and reinstalled MachoPython 2.2.1 just in case, but I can still only launch one Python script at a time from the Finder. I'm pretty sure I could launch multiple scripts prior to upgrading to Jaguar, but perhaps not. I can still launch multiple scripts using /usr/local/bin/pythonw from the Terminal since it uses exec, but the Finder launching is now pretty much useless as is. Suggestions for changing the Finder setup? The Get Info dialog won't let me select pythonw from /usr/local/bin as the app to use for launching. > What I think we should do is go full speed ahead with a decent framework > build for Python 2.3, and make sure that such a build can coexist with > Apple's non-framework 2.2 with as little confusion to the user as > possible. If Apple stick to the 9 month release cycle that seems to be > appearing then Python 2.3 will probably miss the window for MacOSX 10.3 > anyway. But if PythonLauncher and the IDE and such tools are aware of > the fact that there are probably two distinct Python installations there > really isn't much of a problem. And it gives us the freedom to do > development in our own time, in stead of being tied to someone else's > release schedule. Yes, but whatever solution we have until what Apple releases and why we're recommending people use syncs up, some instructions are going to be required to explain how people are actually expected to get this stuff installed and make use of it and what the issues are. > (Incidentally, this de-coupling of release schedules is also why I'm > hammering on this Python Install Manager stuff over on pythonmac-sig: > with wxPython and PyObjC and such seeing so much activity at the moment > it would be a real shame if new versions would become available to the > general public only when a full Python release is done. If the PIM can > make it relatively painless to install and upgrade packages we can have > our cake and eat it too. It seems like the big problem right now is actually uninstalling a package. It is a fairly painless process to install a package from a disk image, but right now a new package just gets installed over the old one which could lead to problems. Anyway, on OS X I'm just a dumb user, so I have to rely on you experts to figure this stuff out. I'll go back to my Windows 2K system in the meantime where using Python is much simpler ka From Robin.Siebler@palmsource.com Wed Sep 11 23:48:37 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Wed, 11 Sep 2002 15:48:37 -0700 Subject: [Pythonmac-SIG] Programming Problem: comparing files with "known" differences Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF923@ussunm001.palmsource.com> This is a multi-part message in MIME format. ------_=_NextPart_001_01C259E5.5DB6E04D Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am trying to perform the following task (in an automated fashion): 1. Launch CodeWarrior and disassemble a file 2. Compare the output from this with a "known" file. Now, the first 4-5 lines of each file are always going to be different, = but after that, they should always be the same. My current script uses = AppleScript to launch CodeWarrior, disassemble the file and grab the = output. I then pass the output to Python (as a list of strings), strip = the first couple of lines from the output and the "known" file and = compare the two. However, the output contains a backslash in places and = somehow when I pass the output to Python it gets replaced with double = backslashes, which causes the compare to fail. I have 2 questions: 1. Is there a better way to do this? =20 a) I tried to save the output file from CodeWarrior using AppleScript = (which would alleviate the problem), but giving=20 CodeWarrior a save command brought up a Save dialog = which I don't know how to deal with (I have minimal AppleScript experience). b) I looked at the man page for diff, but I couldn't see a = way to have diff compare only the lines which should be the same (I=20 have minimal *nix experience) 2. Is there a way to get rid of the double backslashes? I tried = string.replace("\\", "\") but I get a syntax error. I have attached the scripts if anyone cares to look at them. <> <>=20 Robin L. Siebler Software Test Engineer Palm --------------------------------------- Homer: Got any of that beer that has candy floating in it? You know, = Skittlebrau? Apu: Such a beer does not exist, sir. I think you must = have dreamed it. Homer: Oh. Well, then just give me a six-pack and a = couple of bags of Skittles. ------_=_NextPart_001_01C259E5.5DB6E04D Content-Type: application/octet-stream; name="cw_handler.py" Content-Transfer-Encoding: base64 Content-Description: cw_handler.py Content-Disposition: attachment; filename="cw_handler.py" IiIiDQljd19oYW5kbGVyLnB5DQkNCVRoZSBwdXJwb3NlIG9mIHRoaXMgc2NyaXB0IGlzIHRvIGxh dW5jaCBDb2RlV2FycmlvciBhbmQgdG8gc2V0IGl0IHRvIGEgYmFzZSBzdGF0ZSBieSBjbG9zaW5n IA0JYW55IG9wZW4gd2luZG93cy4gIFNpbmNlIHRoZSBBcHBsZUV2ZW50cyBzdXBwb3J0IGZvciBD b2RlV2FycmlvciBpbiBNYWNQeXRob24gbGVhdmVzICptdWNoKiANCXRvIGJlIGRlc2lyZWQsIEkg YW0gdXNpbmcgQXBwbGVTY3JpcHQgKHdoZXJlIG5lY2Vzc2FyeSkgdG8gY29udHJvbCBDb2RlV2Fy cmlvciBhbmQgUHl0aG9uIHRvIA0JdmFsaWRhdGUgdGhlIHJlc3VsdHMuDSIiIg0NX19hdXRob3Jf XyAgPSAnUm9iaW4gTC4gU2llYmxlcicNX19kYXRlX18gICAgPSAnOC8yMC8wMicNX192ZXJzaW9u X18gPSAnMS4wJw0NaW1wb3J0IE9TQW0sIGxvZ2dpbmcNDSNMb2cgTGV2ZWxzDSNMT0dfTEVWRUwg PSBsb2dnaW5nLkRFQlVHDUxPR19MRVZFTCA9IGxvZ2dpbmcuSU5GTw0jTE9HX0xFVkVMID0gbG9n Z2luZy5FUlJPUg0jTE9HX0xFVkVMID0gbG9nZ2luZy5DUklUSUNBTA0NbG9nID0gbG9nZ2luZy5n ZXRMb2dnZXIoIkNXX0hhbmRsZXIiKQ0NZGVmIGNoZWNrX2N3KCk6DQkiIiJDaGVjayB0byBzZWUg aWYgQ29kZVdhcnJpb3IgaXMgYWN0aXZlLiIiIg0JY2hlY2tfY3cgPSAiIiINCQlzZXQgYXBwbGlz dCB0byB7fSAtLSB3aWxsIGNvbnRhaW4gbGlzdCBvZiBwcm9jZXNzIG9iamVjdHMNCQl0ZWxsIGFw cGxpY2F0aW9uICJGaW5kZXIiDQkJCXNldCBhcHBsaXN0IHRvIGFwcGxpY2F0aW9uIHByb2Nlc3Nl cw0JCWVuZCB0ZWxsDQkiIiINCWxvZy5zZXRMZXZlbChMT0dfTEVWRUwpDQlsb2cuZGVidWcoIkNo ZWNraW5nIGZvciBDb2RlV2FycmlvciIpDQlyZXN1bHQgPSBPU0FtLkNvbXBpbGVBbmRFeGVjdXRl KGNoZWNrX2N3KQ0JaWYgcmVzdWx0LmZpbmQoJ0NvZGVXYXJyaW9yIElERScpICE9IC0xOiANCQly ZXN1bHQgPSAxDQkJbG9nLmRlYnVnKCJDb2RlV2FycmlvciBhY3RpdmUuIikNCWVsc2U6DQkJcmVz dWx0ID0gMA0JcmV0dXJuIHJlc3VsdA0JDWRlZiBjbG9zZV93aW4oKToNCSIiIkNoZWNrIGZvciBv cGVuIHdpbmRvd3MuICBJZiB0aGVyZSBhcmUgYW55LCBjbG9zZSB0aGVtLiIiIg0JY291bnRfd2lu ZG93cyA9ICIiInRlbGwgYXBwbGljYXRpb24gIkNvZGVXYXJyaW9yIElERSIgdG8gY291bnQgd2lu ZG93cyIiIg0JbG9nLnNldExldmVsKExPR19MRVZFTCkNCWxvZy5kZWJ1ZygiQ2hlY2tpbmcgZm9y IG9wZW4gd2luZG93cy4iKQ0JcmVzdWx0ID0gT1NBbS5Db21waWxlQW5kRXhlY3V0ZShjb3VudF93 aW5kb3dzKQ0JaWYgaW50KHJlc3VsdCkgIT0gMDoNCQljbG9zZV93aW5kb3dzID0gIiIidGVsbCBh cHBsaWNhdGlvbiAiQ29kZVdhcnJpb3IgSURFIiB0byBjbG9zZSB3aW5kb3dzIiIiDQkJbG9nLmRl YnVnKHN0cihyZXN1bHQpICsgIiB3aW5kb3cocykgb3Blbi4gIENsb3Npbmcgb3BlbiB3aW5kb3co cykuIikNCQlPU0FtLkNvbXBpbGVBbmRFeGVjdXRlKGNsb3NlX3dpbmRvd3MpDQkNZGVmIGRpc2Fz c2VtYmxlX2ZpbGUocHJval9maWxlLCBzb3VyY2VfZmlsZSk6DQkiIiJEaXNhc3NlbWJsZSBnaXZl biBmaWxlIGFuZCBjYXB0dXJlIHRoZSBvdXRwdXQuIiIiDQlkaXNhc3NlbWJsZV9maWxlID0gIiIi DQlzZXQgZlNwZWMgdG8gInByb2pfZmlsZSINCXNldCBmU3BlYzIgdG8gImZpbGVfdG9fZGlzYXNz ZW1ibGUiDQl0ZWxsIGFwcGxpY2F0aW9uICJDb2RlV2FycmlvciBJREUiDQkJb3BlbiBmaWxlIGZT cGVjDQkJZGlzYXNzZW1ibGUgZmlsZSBmU3BlYzINCQlzZXQgeFRleHQgdG8gKGdldCB0ZXh0IG9m IGRvY3VtZW50IDEpDQllbmQgdGVsbA0JIiIiDQlkX2ZpbGUgPSBkaXNhc3NlbWJsZV9maWxlLnJl cGxhY2UoJ3Byb2pfZmlsZScsIHByb2pfZmlsZSkNCWRfZmlsZSA9IGRfZmlsZS5yZXBsYWNlKCdm aWxlX3RvX2Rpc2Fzc2VtYmxlJywgc291cmNlX2ZpbGUpDQlyZXN1bHQgPSBPU0FtLkNvbXBpbGVB bmRFeGVjdXRlKGRfZmlsZSkNCXRleHQgPSByZXN1bHRbMTotMV0uc3BsaXQoIlxyIikNCXJldHVy biB0ZXh0DQ1kZWYgbGF1bmNoX2N3KCk6DQlsYXVuY2hfY3cgPSAiIiJ0ZWxsIGFwcGxpY2F0aW9u ICJDb2RlV2FycmlvciBJREUiIHRvIGFjdGl2YXRlIiIiDQlPU0FtLkNvbXBpbGVBbmRFeGVjdXRl KGxhdW5jaF9jdykNCQ1kZWYgc2V0X2Jhc2Vfc3RhdGUoKToNCSIiIkxhdW5jaCBDb2RlV2Fycmlv ciBhbmQgY2xvc2UgYW55IG9wZW4gd2luZG93cy4iIiINCWxvZy5zZXRMZXZlbChMT0dfTEVWRUwp DQlyZXN1bHQgPSBjaGVja19jdygpDQlpZiByZXN1bHQ6DQkJY2xvc2Vfd2luKCkNCWVsc2U6DQkJ bG9nLmRlYnVnKCJMYXVuY2hpbmcgQ29kZVdhcnJpb3IiKQ0JCWxhdW5jaF9jdygpDQkJcmVzdWx0 ID0gY2hlY2tfY3coKQ0JCWlmIHJlc3VsdDoNCQkJY2xvc2Vfd2luKCkNCQllbHNlOg0JCQlsb2cu Y3JpdGljYWwoIkNvZGVXYXJyaW9yIHdhcyBub3QgbGF1bmNoZWQuICBUZXN0aW5nIGFib3J0ZWQh IikNCQkJcmV0dXJuIDENDWRlZiBxdWl0KCk6DQlsb2cuc2V0TGV2ZWwoTE9HX0xFVkVMKQ0JcmVz dWx0ID0gY2hlY2tfY3coKQ0JaWYgcmVzdWx0Og0JCWxvZy5kZWJ1ZygiQ2xvc2luZyBDb2RlV2Fy cmlvciIpDQkJcXVpdCA9ICIiInRlbGwgYXBwbGljYXRpb24gIkNvZGVXYXJyaW9yIElERSIgdG8g cXVpdCIiIg0JCXJlc3VsdCA9IE9TQW0uQ29tcGlsZUFuZEV4ZWN1dGUocXVpdCkN ------_=_NextPart_001_01C259E5.5DB6E04D Content-Type: application/octet-stream; name="disassemble_files.py" Content-Transfer-Encoding: base64 Content-Description: disassemble_files.py Content-Disposition: attachment; filename="disassemble_files.py" IiIiDQlkaXNhc3NlbWJsZV9maWxlcy5weQ0NCVRoZSBwdXJwb3NlIG9mIHRoaXMgc2NyaXB0IGlz IHRvIGxhdW5jaCBDb2RlV2FycmlvciBhbmQgYnVpbGQgb3IgZGlzYXNzZW1ibGUgdmFyaW91cyBm aWxlcyBvciANCXByb2plY3RzLiAgU2luY2UgdGhlIEFwcGxlRXZlbnRzIHN1cHBvcnQgZm9yIENv ZGVXYXJyaW9yIGluIE1hY1B5dGhvbiBsZWF2ZXMgKm11Y2gqIHRvIGJlIA0JZGVzaXJlZCwgSSBh bSB1c2luZyBBcHBsZVNjcmlwdCAod2hlcmUgbmVjZXNzYXJ5KSB0byBjb250cm9sIENvZGVXYXJy aW9yIGFuZCBQeXRob24gdG8gDQl2YWxpZGF0ZSB0aGUgcmVzdWx0cy4NDQ0JVGhlIGZpbGVzIHRv IGJlIHRlc3RlZCBhcmUgY29udGFpbmVkIGluIGFuIElOSSBzdHlsZSBmaWxlIHdoaWNoIGNvbnRh aW5zIHRoZSBmb2xsb3dpbmcgaW5mbzoNDQkJW2ZpbGUjXQ0JCXByb2plY3QgICAgICAgICAgID0g VGhlIHByb2plY3QgdG8gb3Blbg0JCXNvdXJjZV9maWxlICAgICAgID0gVGhlIGZpbGUgdG8gZGlz YXNzZW1ibGUNCQl2ZXJpZmljYXRpb25fZmlsZSA9IFRoZSBjb21wYXJpc29uIGZpbGUNDQlFeGFt cGxlOg0NCQlbZmlsZTFdDQkJcHJvamVjdCAgICAgICAgICAgPSBTaW1wbGVNYWNDb2RlV2Fycmlv ci5tY3ANCQlzb3VyY2VfZmlsZSAgICAgICA9IHNpbXBsZS5jDQkJdmVyaWZpY2F0aW9uX2ZpbGUg PSBTaW1wbGVDRHVtcC5zDQkJW2ZpbGUyXQ0JCS4uLg0iIiINDV9fYXV0aG9yX18gID0gJ1JvYmlu IEwuIFNpZWJsZXInDV9fZGF0ZV9fICAgID0gJzgvMjAvMDInDV9fdmVyc2lvbl9fID0gJzEuMCcN DSMgVE9ETzogIENvbnZlcnQgKGlmIG5lY2Vzc2FyeSkgdG8gd29yayB3aXRoIE15cm9uJ3Mgc3Bl YyBoYW5kbGVyPw0jIFRPRE86ICBDaGFuZ2UgdG8gbG9vayBmb3IgIix0ZXh0IiBhbmQgIkRBVEEi Pw0jIFRPRE86ICBGaW5kIG91dCBpZiB0aHJlIGlzIGV2ZXIgbW9yZSB0aGFuIDEgZmlsZSBpbiBh IHByb2plY3QgdG8gYmUgZGlzYXNzZW1ibGVkLg0NaW1wb3J0IENvbmZpZ1BhcnNlciwgY3dfaGFu ZGxlciwgbG9nZ2luZywgT1NBbSwgc3RyaW5nLCBzeXMNDWNvbmZpZ19maWxlID0gInRlc3RfZmls ZXMiCQkJI25hbWUgb2YgZmlsZSBjb250YWluaW5nIHRlc3QgZGF0YQ1sb2duYW1lID0gImRpc2Fz c2VtYmxlX2ZpbGVzLmxvZyIJI25hbWUgb2YgZmlsZSB0byBsb2cgdG8NDSNMb2cgTGV2ZWxzDSNM T0dfTEVWRUwgPSBsb2dnaW5nLkRFQlVHDUxPR19MRVZFTCA9IGxvZ2dpbmcuSU5GTw0jTE9HX0xF VkVMID0gbG9nZ2luZy5FUlJPUg0jTE9HX0xFVkVMID0gbG9nZ2luZy5DUklUSUNBTA0NI2N3X2hh bmRsZXIuTE9HX0xFVkVMID0gbG9nZ2luZy5ERUJVRwkjc2V0IGxvZyBsZXZlbCBmb3IgQ29kZVdh cnJpb3IgaGFuZGxlciAoZGVmYXVsdCBpcyBJTkZPKQ0NZGVmIGNsZWFuX3VwKCk6DQkiIiJDbG9z ZSBDb2RlV2FycmlvciBhbmQgbG9nIGZpbGUgYmVmb3JlIGV4aXRpbmcuIiIiDQlsb2cuaW5mbygi Q2xvc2luZyBDb2RlV2Fycmlvci4iKQ0JY3dfaGFuZGxlci5xdWl0KCkNCWxvZy5pbmZvKCItIiAq IDUgKyAiVGVzdCBwYXNzIGNvbXBsZXRlZCIgKyAiLSIgKiA1KQ0JaGRsci5jbG9zZSgpDQlsb2cu cmVtb3ZlSGFuZGxlcihoZGxyKQ0NCQ1kZWYgbG9hZF9jb25maWdfZmlsZShjb25maWdfZmlsZSk6 DQkiIiJMb2FkIGEgY29uZmlnIGZpbGUgY29udGFpbmluZyB0aGUgbmFtZShzKSBvZiB0aGUgZmls ZXMgdG8gYmUgdGVzdGVkLg0JDQlGaXJzdCBlYWNoIHNlY3Rpb24gb2YgdGhlIGNvbmZpZyBmaWxl IGlzIGluc2VydGVkIGludG8gYSBkaWN0aW9uYXJ5IChpbiB0aGUgZm9ybSA8c2VjdGlvbj4uPG9w dGlvbj4gDQlhbmQgdGhlIGNvcnJlc3BvbmRpbmcgdmFsdWVzLiAgVGhlIGRpY3Rpb25hcnkgZm9y IGVhY2ggc2VjdGlvbiBpcyBhcHBlbmQgdG8gYSBsaXN0LiAgVGhlIHZhbHVlcyANCW9mIGVhY2gg ZGljdGlvbmFyeSBhcmUgdGhlbiBzb3J0ZWQgYW5kIHBsYWNlZCBiYWNrIGludG8gdGhlIGxpc3Qs IHJlcGxhY2luZyB0aGUgZGljdGlvbmFyeS4iIiINCWNvbmZpZyA9IHt9DQl0ZXN0cyA9IFtdDQll cnJvciA9ICIiDQljcCA9IENvbmZpZ1BhcnNlci5Db25maWdQYXJzZXIoKQ0JY3AucmVhZChjb25m aWdfZmlsZSkNCWZvciBzZWMgaW4gY3Auc2VjdGlvbnMoKToNCQluYW1lID0gc2VjDQkJZm9yIG9w dCBpbiBjcC5vcHRpb25zKHNlYyk6DQkJCWlmIGNwLmhhc19vcHRpb24oc2VjLCAic291cmNlX2Zp bGUiKSBhbmQgY3AuaGFzX29wdGlvbihzZWMsICJ2ZXJpZmljYXRpb25fZmlsZSIpIFwNCQkJYW5k IGNwLmhhc19vcHRpb24oc2VjLCAicHJvamVjdCIpOg0JCQkJY29uZmlnW25hbWUgKyAiLiIgKyBv cHRdID0gc3RyaW5nLnN0cmlwKGNwLmdldChzZWMsIG9wdCkpICANCQkJZWxzZToNCQkJCWlmIG5v dCBlcnJvciA9PSBzZWM6DQkJCQkJbG9nLndhcm4oIkFuIGVycm9yIHdhcyBmb3VuZCBpbiBzZWN0 aW9uIFsiICsgc2VjICsgIl0gb2YgdGhlIGNvbmZpZyBmaWxlLiIpDQkJCQkJbG9nLndhcm4oIlRo aXMgc2VjdGlvbiB3aWxsIGJlIGlnbm9yZWQuIikNCQkJCQllcnJvciA9IHNlYw0JCQkJY3AucmVt b3ZlX3NlY3Rpb24oc2VjKQ0JCQkJY29udGludWUNCQlpZiBjb25maWcgIT0ge306DQkJCXRlc3Rz LmFwcGVuZChjb25maWcpCSNQbGFjZSBzZWN0aW9uIGludG8gbGlzdA0JCWNvbmZpZyA9IHt9DQlm b3IgdGVzdCBpbiByYW5nZShsZW4odGVzdHMpKToNCQlpZiBsZW4odGVzdHNbdGVzdF0pICE9IDM6 DQkJCWlmIGxlbih0ZXN0c1t0ZXN0XSkgPCAzOg0JCQkJbG9nLmNyaXRpY2FsKCJTdHJhbmdlLiAg WW91IHNob3VsZG4ndCBiZSBoZXJlLiAgVGVzdCBhYm9ydGluZy4iKQ0JCQkJY2xlYW5fdXAoKQ0J CQkJc3lzLmV4aXQoLTEpIA0JCQllbGlmIGxlbih0ZXN0c1t0ZXN0XSkgPiAzOg0JCQkJbG9nLmVy cm9yKCJBIHNlY3Rpb24gb2Z0aGUgY29uZmlnIGZpbGUgY29udGFpbnMgdG9vIG1hbnkgZW50cmll cyIpDQkJCQlsb2cuZXJyb3IoIkVuc3VyZSB0aGUgY29uZmlnIGZpbGUgaXMgcHJvcGVybHkgZm9y bWVkLiAgTm93IGV4aXRpbmcuLi4iKQ0JCQkJY2xlYW5fdXAoKQ0JCQkJc3lzLmV4aXQoLTEpIA0J CWVsc2U6DQkJCWRpY3QgPSB0ZXN0c1t0ZXN0XQ0JCQlpdGVtcyA9IGRpY3QuaXRlbXMoKQ0JCQlp dGVtcy5zb3J0KCkNCQkJdGVzdHNbdGVzdF0gPSBbdmFsdWUgZm9yIGtleSwgdmFsdWUgaW4gaXRl bXNdCSNSZXBsYWNlIGRpY3Rpb25hcnkgaW4gbGlzdCB3aXRoIGp1c3QgdGhlIHNvcnRlZCB2YWx1 ZXMNCXJldHVybiB0ZXN0cw0JDWRlZiB2ZXJpZnlfZGF0YShkYXRhLCB2YWxpZF9maWxlKToNCSIi IkNvbXBhcmUgdGhlIGNvbnRlbnRzIG9mIHRoZSBkdW1wIGFnYWluc3QgYSAna25vd24nIGZpbGUu IiIiDQl2YWxpZF9kYXRhID0gb3Blbih2YWxpZF9maWxlLCAiciIpLnJlYWRsaW5lcygpDQlkYXRh ID0gZGF0YVs1Ol0NCXZhbGlkX2RhdGEgPSB2YWxpZF9kYXRhWzQ6XQ0JZm9yIGxpbmUgaW4gdmFs aWRfZGF0YToNCQlpZiBsaW5lLmZpbmQoIlxuIik6DQkJCWluZGV4ID0gdmFsaWRfZGF0YS5pbmRl eChsaW5lKQ0JCQl2YWxpZF9kYXRhW2luZGV4XSA9IGxpbmUucmVwbGFjZSgiXG4iLCAiIikNDQly ZXN1bHQgPSBjbXAoZGF0YSwgdmFsaWRfZGF0YSkNCWlmIG5vdCByZXN1bHQgPT0gMDoNCQlkYXRh X2xlbiA9IGxlbihkYXRhKQ0JCXZhbGlkX2xlbiA9IGxlbih2YWxpZF9kYXRhKQ0JCWxvZy5kZWJ1 ZygiTGVuZ3RoIG9mIGRhdGE6ICIgKyBzdHIoZGF0YV9sZW4pKQ0JCWxvZy5kZWJ1ZygiTGVuZ3Ro IG9mIHZhbGlkIGRhdGE6ICIgKyBzdHIodmFsaWRfbGVuKSkNCQlpZiByZXN1bHQgPCAwOg0JCQlp bmRleCA9IHJhbmdlKGxlbihkYXRhKSkNCQllbHNlOg0JCQlpbmRleCA9IHJhbmdlKGxlbih2YWxp ZF9kYXRhKSkNCQlmb3IgbGluZSBpbiBpbmRleDoNCQkJI2xvZy5kZWJ1ZygiRGF0YSBsaW5lOiAg IiArIGRhdGFbbGluZV0pDQkJCSNsb2cuZGVidWcoIlZhbGlkIExpbmU6ICIgKyB2YWxpZF9kYXRh W2xpbmVdKQ0JCQlyZXN1bHQgPSBjbXAoZGF0YVtsaW5lXSwgdmFsaWRfZGF0YVtsaW5lXSkNCQkJ aWYgbm90IHJlc3VsdCA9PSAwOg0JCQkJcHJpbnQgIkRhdGE6ICoiKyBkYXRhW2xpbmVdICsgIiog OmVuZCINCQkJCXByaW50IHJlcHIoZGF0YVtsaW5lXSkNCQkJCWxvZy5lcnJvcigiVGhlIGZvbGxv d2luZyBsaW5lcyBhcmUgbm90IGVxdWFsOiIpDQkJCQlsb2cuZXJyb3IoIkxpbmUgIiArIHN0cmlu Zy5yanVzdChzdHIobGluZSArIDUpLCA0KSArICI6IiAgKyBkYXRhW2xpbmVdKQ0JCQkJbG9nLmVy cm9yKCJMaW5lICIgKyBzdHJpbmcucmp1c3Qoc3RyKGxpbmUgKyA2KSwgNCkgKyAiOiIgKyB2YWxp ZF9kYXRhW2xpbmVdKQ0JCQkJYnJlYWsNCQlsb2cuZXJyb3IoIlRlc3QgRmFpbGVkISIpDQllbHNl Og0JCWxvZy5pbmZvKCJUZXN0IFBhc3NlZCEiKQ0NZGVmIG1haW4oKToNCWdsb2JhbCBsb2csIGhk bHINCWxvZyA9IGxvZ2dpbmcuZ2V0TG9nZ2VyKCkgICNyb290IGxvZw0JbG9nLnNldExldmVsKExP R19MRVZFTCkNCWhkbHIgPSBsb2dnaW5nLkZpbGVIYW5kbGVyKGxvZ25hbWUpDSMJZm10ID0gbG9n Z2luZy5Gb3JtYXR0ZXIoIiUoYXNjdGltZSlzICUobGV2ZWxuYW1lKS01cyAlKG1lc3NhZ2UpcyIs ICIleCAlWCIpDQlmbXQgPSBsb2dnaW5nLkZvcm1hdHRlcigiJShhc2N0aW1lKXMgJShsZXZlbG5h bWUpLTVzICUobWVzc2FnZSlzIiwgIiVtLSVkLSV5ICVIOiVNOiVTIikNCWhkbHIuc2V0Rm9ybWF0 dGVyKGZtdCkNCWxvZy5hZGRIYW5kbGVyKGhkbHIpDQlsb2cuaW5mbygiLSIgKiA1ICsgIlN0YXJ0 aW5nIHRlc3QgcGFzcyIgKyAiLSIgKiA1KQ0JbG9nLmluZm8oIkxvYWRpbmcgY29uZmlnIGZpbGUu Li4iKQ0JdGVzdHMgPSBsb2FkX2NvbmZpZ19maWxlKGNvbmZpZ19maWxlKQkjR2V0IGRhdGEgZm9y IHRlc3RzIHRvIGJlIHJhbg0JbG9nLmluZm8oIlN0YXJ0aW5nIENvZGVXYXJyaW9yLiIpDQlmb3Ig dGVzdCBpbiByYW5nZShsZW4odGVzdHMpKToNCQlyZXN1bHQgPSBjd19oYW5kbGVyLnNldF9iYXNl X3N0YXRlKCkNCQlpZiByZXN1bHQ6IA0JCQljbGVhbl91cCgpDQkJCXN5cy5leGl0KC0xKQ0JCWxv Zy5pbmZvKCJEaXNhc3NlbWJsaW5nIGZpbGUgJyIgKyB0ZXN0c1t0ZXN0XVsxXSArICInIikNCQlk YXRhID0gY3dfaGFuZGxlci5kaXNhc3NlbWJsZV9maWxlKHRlc3RzW3Rlc3RdWzBdLCB0ZXN0c1t0 ZXN0XVsxXSkNCQl2ZXJpZnlfZGF0YShkYXRhLCB0ZXN0c1t0ZXN0XVsyXSkNCWNsZWFuX3VwKCkN DWlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6DQltYWluKCkNDQ== ------_=_NextPart_001_01C259E5.5DB6E04D-- From bfancher@mac.com Thu Sep 12 02:34:04 2002 From: bfancher@mac.com (bill fancher) Date: Wed, 11 Sep 2002 18:34:04 -0700 Subject: [Pythonmac-SIG] Need help with AppleEvent bug In-Reply-To: Message-ID: On Wednesday, September 11, 2002, at 03:00 PM, Jack Jansen wrote: > Folks, I need help from some AppleScript gurus. Robin Siebler posted > bug http://www.python.org/sf/598981 which has to do with a get() call > to CodeWarrior to get the data of the frontmost window returning None. > Bill Fancher suggested that this might have to do with Python not > supporting the cText AppleScript type, but that would have shown up > differently: you would have gotten a return value, but of type > aetypes.Unknown('ctxt', 'raw data'). I'm afraid there's been some noise in the transmission lines. Be that as it may... CodeWarrior is like TextEdit (and other Cocoa Apps) used to be: a document has text elements. According to the CodeWarrior dictionary, you can only refer to a range of them. AppleScript hacks^H^H^H^H^H works around this somehow (I suspect the same way it did with TextEdit). It appears that you can also refer to the text elements by number. It further appears that the one of interest is the first one. So... The following works here, assuming CodeWarrior is running and has an open document (Mac OS X 10.2, Python 2.3, CW IDE 4.0.4): import CodeWarrior cw = CodeWarrior.CodeWarrior() txt = CodeWarrior.editor_document(1).text(1) print cw.get(txt) It might be worth pointing out that my CW is old enough that it runs only in Classic, so YMMV with later Carbon versions. -- bill > I ran the thing under the debugger, and it turns out the reply > AppleEvent from AESend() indeed doesn't have a '----' parameter, and > it doesn't have an 'errn' error code either. So, returning None is the > right thing to do. But the corresponding AppleScript works fine... > > Now I very vaguely remember something about there being a second > protocol for sending replies to AppleEvents (maybe for long replies >= > 32K? I don't remember... And maybe I'm completely confused with > something else, like the funny CGI protocol with AppleScript) but I > can't find anything after looking through the documentation. > > So, to sum it up, I'm out of my water and need a bit of help. The bug > report has everything you need to reproduce this. > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- Emma > Goldman - > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From Dan@Grassi.org Thu Sep 12 04:04:14 2002 From: Dan@Grassi.org (Dan Grassi) Date: Wed, 11 Sep 2002 23:04:14 -0400 Subject: [Pythonmac-SIG] buildpkg.py In-Reply-To: <5088C421-C1E8-11D6-8D51-003065517236@oratrix.com> Message-ID: <5197CDF9-C5FC-11D6-9C25-00039346A28A@grassi.org> On Friday, September 6, 2002, at 06:30 PM, Jack Jansen wrote: > Thanks go to Dinu Gherman for his buildpkg script (which is now > included in Mac/scripts). The buildpkg.py is great and I plan to start using it immediately. There are a couple of things missing from buildpkg.py. There is an option "rootVolumeOnly" that can be YES or NO. This suppresses selection of non-root volumes and is real handy, currently I am installing a driver and it must go on the root volume. It is not documented but used by Apple extensively. There is a script "InstallationCheck" that if present is run as soon as the Installer starts. This is documented somewhere. I have found that it helps to clean-up the file tree and resources directory by removing .DS_Store files nad CVS directories. I use these shell commands: find . -name ".DS_Store" -exec rm -f {} \; find . -name "CVS" -exec rm -rf {} \; Dan From gherman@darwin.in-berlin.de Thu Sep 12 07:51:48 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Thu, 12 Sep 2002 08:51:48 +0200 Subject: [Pythonmac-SIG] buildpkg.py In-Reply-To: <5197CDF9-C5FC-11D6-9C25-00039346A28A@grassi.org> Message-ID: <1BDE46C4-C61C-11D6-A96B-00039345C610@darwin.in-berlin.de> --Apple-Mail-7--180782879 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Dan Grassi: > Jack Jansen wrote: > >> Thanks go to Dinu Gherman for his buildpkg script (which is now >> included in Mac/scripts). > > The buildpkg.py is great and I plan to start using it immediately. Meanwhile I've sent Jack a patch which mainly rationalizes and simpli- fies the resource handling (I'm attaching it hear again). I also have a nice test suite for it, but I'm not sure how this can be included as you need some file tree for testing (well, it could be an option, but...). Also attached... > There are a couple of things missing from buildpkg.py. Yep, like building multi-packages (.mpkg)... Feel free to send patches including pointers to where some "undocumented" feature is mentioned. BTW, it is perfectly possible to use Python for the pre/post instal- lation/upgrade scripts run by Installer.app. They just must not have a .py extension! Apple seems to use Perl scripts sometimes, like in iCal.pkg/Contents/Resources/InstallationCheck . Regards, Dinu --Apple-Mail-7--180782879 Content-Disposition: attachment; filename=buildpkg.patch Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="buildpkg.patch" *** Mac/scripts/buildpkg.py Fri Sep 6 23:55:13 2002 --- Mac/scripts/buildpkg-0.3.py Mon Sep 9 18:28:53 2002 *************** *** 41,52 **** Dinu C. Gherman, gherman@europemail.com ! November 2001 !! USE AT YOUR OWN RISK !! """ ! __version__ = 0.2 __license__ = "FreeBSD" --- 41,52 ---- Dinu C. Gherman, gherman@europemail.com ! September 2002 !! USE AT YOUR OWN RISK !! """ ! __version__ = 0.3 __license__ = "FreeBSD" *************** *** 117,135 **** This is intended to create OS X packages (with extension .pkg) containing archives of arbitrary files that the Installer.app ! will be able to handle. As of now, PackageMaker instances need to be created with the title, version and description of the package to be built. The package is built after calling the instance method ! build(root, **options). It has the same name as the constructor's ! title argument plus a '.pkg' extension and is located in the same ! parent folder that contains the root folder. ! E.g. this will create a package folder /my/space/distutils.pkg/: ! pm = PackageMaker("distutils", "1.0.2", "Python distutils.") ! pm.build("/my/space/distutils") """ packageInfoDefaults = { --- 117,151 ---- This is intended to create OS X packages (with extension .pkg) containing archives of arbitrary files that the Installer.app ! (Apple's OS X installer) will be able to handle. As of now, PackageMaker instances need to be created with the title, version and description of the package to be built. + The package is built after calling the instance method ! build(root, resources, **options). The generated package is ! a folder hierarchy with the top-level folder name equal to the ! constructor's title argument plus a '.pkg' extension. This final ! package is stored in the current folder. ! ! The sources from the root folder will be stored in the package ! as a compressed archive, while all files and folders from the ! resources folder will be added to the package as they are. ! Example: ! ! With /my/space being the current directory, the following will ! create /my/space/distutils-1.0.2.pkg/: ! PM = PackageMaker ! pm = PM("distutils-1.0.2", "1.0.2", "Python distutils.") ! pm.build("/my/space/sources/distutils-1.0.2") ! ! After a package is built you can still add further individual ! resource files or folders to its Contents/Resources subfolder ! by using the addResource(path) method: ! ! pm.addResource("/my/space/metainfo/distutils/") """ packageInfoDefaults = { *************** *** 175,181 **** # set folder attributes self.sourceFolder = root if resources == None: ! self.resourceFolder = root else: self.resourceFolder = resources --- 191,197 ---- # set folder attributes self.sourceFolder = root if resources == None: ! self.resourceFolder = None else: self.resourceFolder = resources *************** *** 190,196 **** # Check where we should leave the output. Default is current directory outputdir = options.get("OutputDir", os.getcwd()) packageName = self.packageInfo["Title"] ! self.PackageRootFolder = os.path.join(outputdir, packageName + ".pkg") # do what needs to be done self._makeFolders() --- 206,212 ---- # Check where we should leave the output. Default is current directory outputdir = options.get("OutputDir", os.getcwd()) packageName = self.packageInfo["Title"] ! self.packageRootFolder = os.path.join(outputdir, packageName + ".pkg") # do what needs to be done self._makeFolders() *************** *** 201,206 **** --- 217,235 ---- self._addSizes() + def addResource(self, path): + "Add arbitrary file or folder to the package resource folder." + + # Folder basenames become subfolders of Contents/Resources. + # This method is made public for those who wknow what they do! + + prf = self.packageResourceFolder + if isfile(path) and not isdir(path): + shutil.copy(path, prf) + elif isdir(path): + os.system("cp -r %s %s" % (path, prf)) + + def _makeFolders(self): "Create package folder structure." *************** *** 208,219 **** # packageName = "%s-%s" % (self.packageInfo["Title"], # self.packageInfo["Version"]) # ?? ! contFolder = join(self.PackageRootFolder, "Contents") self.packageResourceFolder = join(contFolder, "Resources") ! os.mkdir(self.PackageRootFolder) os.mkdir(contFolder) os.mkdir(self.packageResourceFolder) def _addInfo(self): "Write .info file containing installing options." --- 237,249 ---- # packageName = "%s-%s" % (self.packageInfo["Title"], # self.packageInfo["Version"]) # ?? ! contFolder = join(self.packageRootFolder, "Contents") self.packageResourceFolder = join(contFolder, "Resources") ! os.mkdir(self.packageRootFolder) os.mkdir(contFolder) os.mkdir(self.packageResourceFolder) + def _addInfo(self): "Write .info file containing installing options." *************** *** 264,321 **** def _addResources(self): ! "Add Welcome/ReadMe/License files, .lproj folders and scripts." ! # Currently we just copy everything that matches the allowed ! # filenames. So, it's left to Installer.app to deal with the ! # same file available in multiple formats... if not self.resourceFolder: return ! # find candidate resource files (txt html rtf rtfd/ or lproj/) ! allFiles = [] ! for pat in string.split("*.txt *.html *.rtf *.rtfd *.lproj", " "): ! pattern = join(self.resourceFolder, pat) ! allFiles = allFiles + glob.glob(pattern) ! ! # find pre-process and post-process scripts ! # naming convention: packageName.{pre,post}-{upgrade,install} ! # Alternatively the filenames can be {pre,post}-{upgrade,install} ! # in which case we prepend the package name ! packageName = self.packageInfo["Title"] ! for pat in ("*upgrade", "*install"): ! pattern = join(self.resourceFolder, packageName + pat) ! allFiles = allFiles + glob.glob(pattern) ! ! # check name patterns ! files = [] ! for f in allFiles: ! for s in ("Welcome", "License", "ReadMe"): ! if string.find(basename(f), s) == 0: ! files.append((f, f)) ! if f[-6:] == ".lproj": ! files.append((f, f)) ! elif f in ["pre-upgrade", "pre-install", "post-upgrade", "post-install"]: ! files.append((f, self.packageInfo["Title"]+"."+f)) ! elif f[-8:] == "-upgrade": ! files.append((f,f)) ! elif f[-8:] == "-install": ! files.append((f,f)) ! ! # copy files ! for src, dst in files: ! f = join(self.resourceFolder, src) ! if isfile(f): ! shutil.copy(f, os.path.join(self.packageResourceFolder, dst)) ! elif isdir(f): ! # special case for .rtfd and .lproj folders... ! d = join(self.packageResourceFolder, dst) ! os.mkdir(d) ! files = GlobDirectoryWalker(f) ! for file in files: ! shutil.copy(file, d) ! def _addSizes(self): "Write .sizes file with info about number and size of files." --- 294,311 ---- def _addResources(self): ! "Add all files and folders inside a resources folder to the package." ! # This folder normally contains Welcome/ReadMe/License files, ! # .lproj folders and scripts. if not self.resourceFolder: return ! files = glob.glob("%s/*" % self.resourceFolder) ! for f in files: ! self.addResource(f) ! def _addSizes(self): "Write .sizes file with info about number and size of files." *************** *** 347,390 **** # Shortcut function interface def buildPackage(*args, **options): ! "A Shortcut function for building a package." o = options title, version, desc = o["Title"], o["Version"], o["Description"] pm = PackageMaker(title, version, desc) apply(pm.build, list(args), options) ! ! ###################################################################### ! # Tests ! ###################################################################### ! ! def test0(): ! "Vanilla test for the distutils distribution." ! ! pm = PackageMaker("distutils2", "1.0.2", "Python distutils package.") ! pm.build("/Users/dinu/Desktop/distutils2") ! ! ! def test1(): ! "Test for the reportlab distribution with modified options." ! ! pm = PackageMaker("reportlab", "1.10", ! "ReportLab's Open Source PDF toolkit.") ! pm.build(root="/Users/dinu/Desktop/reportlab", ! DefaultLocation="/Applications/ReportLab", ! Relocatable="YES") ! ! def test2(): ! "Shortcut test for the reportlab distribution with modified options." ! ! buildPackage( ! "/Users/dinu/Desktop/reportlab", ! Title="reportlab", ! Version="1.10", ! Description="ReportLab's Open Source PDF toolkit.", ! DefaultLocation="/Applications/ReportLab", ! Relocatable="YES") ###################################################################### --- 337,350 ---- # Shortcut function interface def buildPackage(*args, **options): ! "A shortcut function for building a package." o = options title, version, desc = o["Title"], o["Version"], o["Description"] pm = PackageMaker(title, version, desc) apply(pm.build, list(args), options) ! return pm ###################################################################### *************** *** 446,452 **** "Description" in ok): print "Missing mandatory option!" else: ! apply(buildPackage, args, optsDict) return printUsage() --- 406,412 ---- "Description" in ok): print "Missing mandatory option!" else: ! pm = apply(buildPackage, args, optsDict) return printUsage() --Apple-Mail-7--180782879 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed --Apple-Mail-7--180782879 Content-Disposition: attachment; filename=test_buildpkg.py Content-Transfer-Encoding: quoted-printable Content-Type: application/text; x-unix-mode=0755; x-mac-type=54455854; name="test_buildpkg.py" #!/usr/bin/env=20python=0D=0A=0D=0A"test_buildpkg.py"=0D=0A=0D=0A=0D=0A=0D= =0Aimport=20os,=20unittest,=20glob=0D=0Aimport=20buildpkg=0D=0A=0D=0A=0D=0A= =0D=0A=0D=0Adef=20package(self,=20resFolder=3DNone,=20resFiles=3DNone):=0D= =0A=20=20=20=20"Package=20a=20root=20directory=20with=20some=20variable=20= resources."=0D=0A=20=20=20=20=0D=0A=20=20=20=20title,=20version,=20desc=20= =3D=20"readline-4.3",=20"4.3",=20"GNU=20Readline=20Library"=0D=0A=20=20=20= =20=0D=0A=20=20=20=20#=20remove=20previously=20build=20package=0D=0A=20=20= =20=20if=20os.path.exists(title=20+=20".pkg"):=0D=0A=20=20=20=20=20=20=20= =20os.system("rm=20-r=20%s.pkg"=20%=20title)=0D=0A=20=20=20=20=20=20=20=20= =0D=0A=20=20=20=20#=20build=20package=0D=0A=20=20=20=20pm=20=3D=20= buildpkg.PackageMaker(title,=20version,=20desc)=0D=0A=20=20=20=20= pm.build(os.path.join("samples",=20title),=20resFolder)=0D=0A=20=20=20=20= for=20path=20in=20resFiles=20or=20[]:=0D=0A=20=20=20=20=20=20=20=20= pm.addResource(path)=0D=0A=20=20=20=20=20=20=20=20=0D=0A=20=20=20=20#=20= check=20the=20package=20folder=20exists=0D=0A=20=20=20=20= self.failUnless(os.path.exists(title=20+=20".pkg"))=0D=0A=0D=0A=20=20=20=20= #=20make=20a=20list=20of=20the=20copied=20resource=20files=0D=0A=20=20=20= =20destFolder=20=3D=20title=20+=20".pkg/Contents/Resources/"=0D=0A=20=20=20= =20destResFiles=20=3D=20os.listdir(destFolder)=0D=0A=20=20=20=20= destResFiles=20=3D=20map(lambda=20f:=20os.path.basename(f),=20= destResFiles)=0D=0A=0D=0A=20=20=20=20#=20check=20the=20files=20from=20= the=20resources=20folder=20were=20copied=0D=0A=20=20=20=20if=20= resFolder:=0D=0A=20=20=20=20=20=20=20=20files=20=3D=20glob.glob("%s/*"=20= %=20resFolder)=0D=0A=20=20=20=20=20=20=20=20files=20=3D=20map(lambda=20= f:=20os.path.basename(f),=20files)=0D=0A=20=20=20=20=20=20=20=20for=20f=20= in=20files:=0D=0A=20=20=20=20=20=20=20=20=20=20=20=20self.failUnless(f=20= in=20destResFiles)=0D=0A=20=20=20=20=20=20=20=20=20=20=20=20=0D=0A=20=20=20= =20#=20check=20individual=20resource=20files=20were=20copied=0D=0A=20=20=20= =20for=20path=20in=20resFiles=20or=20[]:=0D=0A=20=20=20=20=20=20=20=20= base=20=3D=20os.path.basename(path)=0D=0A=20=20=20=20=20=20=20=20= self.failUnless(base=20in=20destResFiles)=0D=0A=20=20=20=20=20=20=20=20=20= =20=20=20=0D=0A=0D=0A=0D=0A=0D=0Aclass=20= PackageBuilderTest(unittest.TestCase):=0D=0A=20=20=20=20"Various=20tests=20= for=20making=20OS=20X=20packages=20(.pkg)"=0D=0A=0D=0A=20=20=20=20def=20= test0(self):=0D=0A=20=20=20=20=20=20=20=20"Vanilla=20test=20for=20the=20= GNU=20readline=20distribution."=0D=0A=0D=0A=20=20=20=20=20=20=20=20= package(self)=0D=0A=0D=0A=0D=0A=20=20=20=20def=20test1(self):=0D=0A=20=20= =20=20=20=20=20=20"As=20test0,=20but=20with=20additional=20simple=20= resources."=0D=0A=0D=0A=20=20=20=20=20=20=20=20package(self,=20= "resources/simple")=0D=0A=0D=0A=0D=0A=20=20=20=20def=20test2(self):=0D=0A= =20=20=20=20=20=20=20=20"As=20test0,=20but=20with=20additional=20= localized=20resources."=0D=0A=0D=0A=20=20=20=20=20=20=20=20package(self,=20= "resources/localized")=0D=0A=0D=0A=0D=0A=20=20=20=20def=20test3(self):=0D= =0A=20=20=20=20=20=20=20=20"As=20test0,=20but=20with=20additional=20= single=20resource."=0D=0A=0D=0A=20=20=20=20=20=20=20=20package(self,=20= None,=20["resources/scripts/postflight"])=0D=0A=0D=0A=0D=0A=20=20=20=20= def=20test4(self):=0D=0A=20=20=20=20=20=20=20=20"As=20test0,=20but=20= with=20additional=20single=20resource=20tree."=0D=0A=0D=0A=20=20=20=20=20= =20=20=20package(self,=20None,=20["resources/localized/German.lproj"])=0D= =0A=0D=0A=0D=0A=0D=0A=0D=0Adef=20makeSuite():=0D=0A=20=20=20=20suite=20=3D= =20unittest.TestSuite()=0D=0A=20=20=20=20loader=20=3D=20= unittest.TestLoader()=0D=0A=20=20=20=20= suite.addTest(loader.loadTestsFromTestCase(PackageBuilderTest))=0D=0A=0D=0A= =20=20=20=20return=20suite=0D=0A=0D=0A=0D=0A=0D=0A=0D=0Aif=20__name__=20= =3D=3D=20'__main__':=0D=0A=20=20=20=20= unittest.TextTestRunner().run(makeSuite())=0D=0A=0D=0A= --Apple-Mail-7--180782879-- From gherman@darwin.in-berlin.de Thu Sep 12 08:41:22 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Thu, 12 Sep 2002 09:41:22 +0200 Subject: [Pythonmac-SIG] Python that ships with Jaguar vs... In-Reply-To: Message-ID: <08927017-C623-11D6-A96B-00039345C610@darwin.in-berlin.de> Tony Lownds: > I guess that expat was not included in darwin because there are > problems with the makefile in the canonical release of expat (on the > author's homepage) - it didn't make a libexpat.a. That's also why > expat was copied into the Python source tree, IIRC. It compiles fine on my 10.2 (as it did on 10.1.5). Find below what my home-distilled "installer" says about how to do it. If you want it in /usr/lib instedad of /usr/local/lib you need to modify the procedure. I think it's unfortunate that OS X doesn't come with a /usr/local folder, isn't it? Dinu dinu% python install.py --show expatLib Name: Expat Library by James Clark URL: http://belnet.dl.sourceforge.net/sourceforge/expat/expat-1.95.4.tar.gz Installation procedure: tar xfz expat-1.95.4.tar.gz cd expat-1.95.4 ./configure make sudo make install From Dan@Grassi.org Thu Sep 12 14:07:13 2002 From: Dan@Grassi.org (Dan Grassi) Date: Thu, 12 Sep 2002 09:07:13 -0400 Subject: [Pythonmac-SIG] buildpkg.py In-Reply-To: <1BDE46C4-C61C-11D6-A96B-00039345C610@darwin.in-berlin.de> Message-ID: <8E174F8A-C650-11D6-86EE-00039346A28A@grassi.org> On Thursday, September 12, 2002, at 02:51 AM, Dinu Gherman wrote: > Yep, like building multi-packages (.mpkg)... Feel free to send > patches including pointers to where some "undocumented" feature is > mentioned. The "InstallationCheck" is mentioned in some 10.0.x Apple docs and I now have 10.2 installed so that will not be easy. It was not easy to find back a year ago. It is a good place to pre-flight, I use it to verify minimum requirements such as available disk space, RAM and OS version allowing an early exit if minimums are not met. Also: preflight Is a combo of .pre_install and .pre_upgrade postflight Is a combo of .post_install and .post_upgrade postinstall preinstall The first three are used in the 10.2 Info.plist in DevTools.pkg and I suspect that the last is also still supported, these are in various Apple pre 10.2 docs. These are handy because they work for both install and upgrade. The "rootVolumeOnly" is not documented in 10.0.x of 10.1.x but is used by Apple in their pre-10.2 developer tools installers. In the 10.2 installer it is mentioned but that installer uses XML (IFPkgFlagRootVolumeOnly) and it currently does work in the 10.2 format, see 10.2 Info.plist in DevTools.pkg. "rootVolumeOnly" does work on 10.2 in the pre-10.2 format. I am using it in a new commercial product at the moment. At the very least it does no harm and is ignored. In my case I am installing a driver and that needs to go on the root volume. I came up with both of these over a year ago when I was doing the IBM ViaVoice installer. At that time there was little documentation and I was looking at all of Apple's .pkg and .mpkg files to figure things out. > BTW, it is perfectly possible to use Python for the pre/post instal- > lation/upgrade scripts run by Installer.app. They just must not have > a .py extension! Apple seems to use Perl scripts sometimes, like in > iCal.pkg/Contents/Resources/InstallationCheck . But that pre-supposes that Python is already installed, something that is only guaranteed on 10.2 and forward and the installer package you wrote generates pre-10.2 format. :-) Dan. From gherman@darwin.in-berlin.de Thu Sep 12 15:45:45 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Thu, 12 Sep 2002 16:45:45 +0200 Subject: [Pythonmac-SIG] buildpkg.py In-Reply-To: <8E174F8A-C650-11D6-86EE-00039346A28A@grassi.org> Message-ID: <519623EB-C65E-11D6-ADA7-00039345C610@darwin.in-berlin.de> Dan Grassi: > The "InstallationCheck" is mentioned in some 10.0.x Apple docs and I > now have 10.2 installed so that will not be easy. It was not easy to > find back a year ago. It is a good place to pre-flight, I use it to > verify minimum requirements such as available disk space, RAM and OS > version allowing an early exit if minimums are not met. You mean it's one more script, then? If so, the current version of buildpkg does not care. You can use it to add a resource like this to the package and that's it. It gives you no support yet for gene- rating such scripts. > Also: > preflight Is a combo of .pre_install and .pre_upgrade > postflight Is a combo of .post_install and .post_upgrade > postinstall > preinstall I'm not sure I get that. Aren't all these just optional scripts in the Contents/Resources folder? What do you mean by "combo"? > The first three are used in the 10.2 Info.plist in DevTools.pkg and I > suspect that the last is also still supported, these are in various > Apple pre 10.2 docs. These are handy because they work for both > install and upgrade. > > The "rootVolumeOnly" is not documented in 10.0.x of 10.1.x but is used > by Apple in their pre-10.2 developer tools installers. In the 10.2 > installer it is mentioned but that installer uses XML > (IFPkgFlagRootVolumeOnly) and it currently does work in the 10.2 > format, see 10.2 Info.plist in DevTools.pkg. "rootVolumeOnly" does > work on 10.2 in the pre-10.2 format. Sorry, but I'm confused again. I'm not aware of any new (XML?) format in the 10.2 installer. Could you give an example of a publically avail- able package using it? Or a pointer to a document describing it? >> BTW, it is perfectly possible to use Python for the pre/post instal- >> lation/upgrade scripts run by Installer.app. They just must not have >> a .py extension! Apple seems to use Perl scripts sometimes, like in >> iCal.pkg/Contents/Resources/InstallationCheck . > > But that pre-supposes that Python is already installed, something that > is only guaranteed on 10.2 and forward and the installer package you > wrote generates pre-10.2 format. :-) Again, I have no evidence for the packages created by buildpkg to be not accepted by the 10.2 installer. And, of course you need Python to execute installation scripts in Python. But I guess people will not only want to install Python itself as a package, but also other software. AFAICT there is not much (read: any) information within such packages to describe dependancies on other packages. I heard, though, that folks from osxgnu.org are working on an extended version of the package format and their own free installer. Regards, Dinu -- Dinu C. Gherman ...................................................................... "The first principle is that you must not fool yourself - and you are the easiest person to fool." (Richard Feynman) From Jack.Jansen@oratrix.com Thu Sep 12 21:49:43 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Thu, 12 Sep 2002 22:49:43 +0200 Subject: [Pythonmac-SIG] Need help with AppleEvent bug In-Reply-To: Message-ID: <2A770A28-C691-11D6-8B4D-003065517236@oratrix.com> On donderdag, september 12, 2002, at 03:34 , bill fancher wrote: > CodeWarrior is like TextEdit (and other Cocoa Apps) used to be: > a document has text elements. According to the CodeWarrior > dictionary, you can only refer to a range of them. AppleScript > hacks^H^H^H^H^H works around this somehow (I suspect the same > way it did with TextEdit). It appears that you can also refer > to the text elements by number. It further appears that the one > of interest is the first one. So... > > The following works here, assuming CodeWarrior is running and > has an open document (Mac OS X 10.2, Python 2.3, CW IDE 4.0.4): > > import CodeWarrior > > cw = CodeWarrior.CodeWarrior() > txt = CodeWarrior.editor_document(1).text(1) > print cw.get(txt) Bill, many thanks for the explanation! I've close the bug report with "Won't fix" status. If anyone happens to know how AppleScript does the workaround (and if it isn't too hairy to implement in Python): please reopen the bug and annotate it. That final two lines of your solution did however spark something that's been in the back of my mind since Day One of the Applescript modules. What you would *really* want to say in Python, I think, is >>> print cw.editor_document(1).text(1).get() And: I think that by now we have almost all the machinery in place to do so. The "cw" object now knows the name of the module it was imported from. So, it could have a __getattr__ method (probably inherited from aetools.TalkTo) that does a lookup of "editor_document" in it's module and returns an object that, when called, would instantiate CodeWarrior.editor_document with an added "fr" argument (pointing to the cw instance itself). The intermediate steps will then all work fine, the only problem is the final "get" lookup. But here the ObjectSpecifier class could also have an __getattr__ method, and this would percolate up the self.fr chain until it gets at the application object, at which point it would have the module name, lookup "get" and return a similar callable object. Anyone willing to give this a try? Leave the patch in sourceforge and I'll apply it when I get back from holidays, in 3 weeks time:-) -- - 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 Jack.Jansen@oratrix.com Thu Sep 12 22:02:00 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Thu, 12 Sep 2002 23:02:00 +0200 Subject: [Pythonmac-SIG] RE: [wxPython-mac] Python that ships with Jaguar vs... In-Reply-To: Message-ID: On donderdag, september 12, 2002, at 12:48 , Kevin Altis wrote: > Yep, /usr/local/bin is not part of the PATH and /usr/local/bin is where > everything is installed. Since users won't have /usr/local/bin > on their path > by default should the location of pythonw... be changed to simplify > installation or what is going to be the recommended change > users have to > make to their configuration so the framework build MachoPython > gets used? For the MacPython 2.3 [*] installer there are three solutions, I think: 1. Slam our "python" and "pythonw" into /usr/bin, overwriting Apple's python. 2. Put our "python" and "pythonw" in /usr/local/bin, and (optionally?) modify ~/Library/Preferences/Environ (or whereever it was again). 3. Don't install the scripts at all initially, and provide a way to install them later. I think 1 is out, really. Anyone disagree? 2 is possible, but I think 3 is nicer. There's "prior art" too: bbedit works this way (although I think we should implement things differently). 3 has the advantage that people can give MacPython a try, throw it away and have a normal system again. Also, with option 3 we can give the "Install Python Unix Tools" applet (or IDE extension, or something else) a GUI and give the option of /usr/bin or /usr/local/bin install, explain about possibly having to log out, etc. [*] Note I'm starting to try and get used to the new naming convention: MacPython 2.3 is the successor to MachoPython 2.2, and the successor to MacPython 2.2 is MacPython-OS9 2.3. It does take some mental gymnastics, however:-) -- - 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 Robin.Siebler@palmsource.com Thu Sep 12 23:23:03 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Thu, 12 Sep 2002 15:23:03 -0700 Subject: [Pythonmac-SIG] "Temp files/dir" Message-ID: <3271DBB88437ED41A0AB239E6C2554A43F5AD7@ussunm001.palmsource.com> I need to create some temp files in a MacPython script. Is there a = standard way of handling this on the Mac? Robin L. Siebler Software Test Engineer Palm --------------------------------------- Homer: If he didn't steal the church collection plate money, why is he = wearing those fancy clothes? Marge: Those were the clothes he wore to = church! Homer: Oooooh, how convenient. From Robin.Siebler@palmsource.com Fri Sep 13 00:06:07 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Thu, 12 Sep 2002 16:06:07 -0700 Subject: [Pythonmac-SIG] Determining the name of the "root" drive (startup disk) Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF930@ussunm001.palmsource.com> How can I do this for MacPython? Robin L. Siebler Software Test Engineer Palm --------------------------------------- Homer Simpson: I am so smart! I am so smart! I am so smart! S-M-R-T! I = mean, S-M-A-R-T! From Dan@Grassi.org Fri Sep 13 02:42:29 2002 From: Dan@Grassi.org (Dan Grassi) Date: Thu, 12 Sep 2002 21:42:29 -0400 Subject: [Pythonmac-SIG] buildpkg.py In-Reply-To: <519623EB-C65E-11D6-ADA7-00039345C610@darwin.in-berlin.de> Message-ID: <10823F39-C6BA-11D6-86EE-00039346A28A@grassi.org> On Thursday, September 12, 2002, at 10:45 AM, Dinu Gherman wrote: >> The "InstallationCheck" > You mean it's one more script, then? Yes >> preflight Is a combo of .pre_install and .pre_upgrade >> postflight Is a combo of .post_install and .post_upgrade >> postinstall >> preinstall > > I'm not sure I get that. Aren't all these just optional scripts in > the Contents/Resources folder? What do you mean by "combo"? In many (most) cases one is not sure if it will be an install or update, these cover both cases. >> The "rootVolumeOnly" is not documented in 10.0.x of 10.1.x but is >> used by Apple in their pre-10.2 developer tools installers. In the >> 10.2 installer it is mentioned but that installer uses XML >> (IFPkgFlagRootVolumeOnly) and it currently does work in the 10.2 >> format, see 10.2 Info.plist in DevTools.pkg. "rootVolumeOnly" does >> work on 10.2 in the pre-10.2 format. > > Sorry, but I'm confused again. I'm not aware of any new (XML?) format > in the 10.2 installer. Could you give an example of a publically avail- > able package using it? Or a pointer to a document describing it? Sure, 10.2 DevTools uses this new format. Also just check the help on the 10.2 Packagemaker. BTW, Apple has stated (WWDC 2002) that they will be supplying a shell tool to create (10.2) packages (was promised for Jag but I can not find it and it might not have made it). See: http://developer.apple.com/techpubs/macosx/ReleaseNotes/ PackageMaker.html > > Again, I have no evidence for the packages created by buildpkg to be > not accepted by the 10.2 installer. Neither do I, the 10.2 Installer is said (WWDC 2002) to accept "all knows options". > And, of course you need Python > to execute installation scripts in Python. But I guess people will > not only want to install Python itself as a package, but also other > software. Yes but this basically limits the Installer to 10.2 and above and if that is the case one should be using the new Installer format. > AFAICT there is not much (read: any) information within such packages > to describe dependancies on other packages. I heard, though, that > folks from osxgnu.org are working on an extended version of the > package format and their own free installer. As is Apple in the form of file "Hints" (WWDC 2002). BTW, I have a problem with buildpkg.py and titles that have a space in them even when quoted. I am using the shell interface. Dan -- who seems to end up doing a lot of installer work. From cjl@physics.otago.ac.nz Fri Sep 13 04:01:36 2002 From: cjl@physics.otago.ac.nz (Chris Lee) Date: Fri, 13 Sep 2002 15:01:36 +1200 Subject: [Pythonmac-SIG] Types and casting Message-ID: <1E08A4EC-C6C5-11D6-8498-0003937807FC@physics.otago.ac.nz> Hi All, I am reading in raw image files from a frame grabber for processing. What I really want is a matrix of integers for analysis (I don't care about the image itself). Is there an easy way to get python to do this? Cheers Chris ################################# Chris Lee Physics Department Otago University PO Box 56 Dunedin New Zealand Phone ++64 3 479 7749 Fax ++64 3 479 0964 ################################# From cjl@physics.otago.ac.nz Fri Sep 13 05:20:10 2002 From: cjl@physics.otago.ac.nz (Chris Lee) Date: Fri, 13 Sep 2002 16:20:10 +1200 Subject: [Pythonmac-SIG] Bug in Numeric? Message-ID: <17D091E0-C6D0-11D6-8498-0003937807FC@physics.otago.ac.nz> Hi I am doing the following >>> import Numeric >>> t = open("Macintosh HD:Users:cjl:Desktop:100902teu:00") >>> g = t.read() >>> g = Numeric.reshape(g,(512,512)) Up to here everything goes allright. I have imported my file of raw data which is simply a bunch of values between 0 and 255. g is a matrix with type 'c' I want to convert this to integer values so I try the stupid approach >>> h = Numeric.array(g, 'I') following which MacPython hard crashes... So a) is this a bug? b) How do I convert my array in a sensible way? Cheers Chris ################################# Chris Lee Physics Department Otago University PO Box 56 Dunedin New Zealand Phone ++64 3 479 7749 Fax ++64 3 479 0964 ################################# From mjb@uma.pt Fri Sep 13 09:03:12 2002 From: mjb@uma.pt (Michael J. Barber) Date: Fri, 13 Sep 2002 09:03:12 +0100 Subject: [Pythonmac-SIG] Determining the name of the "root" drive (startup disk) In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF930@ussunm001.palmsource.com> Message-ID: <3FD50AE5-C6EF-11D6-9E92-0050E4794D0F@uma.pt> On Friday, September 13, 2002, at 12:06 AM, Robin Siebler wrote: > How can I do this for MacPython? > Pass the buck to AppleScript, where it is easy! Python 2.2.1 (#134, Apr 9 2002, 21:16:52) [CW CARBON GUSI2 THREADS GC] Type "copyright", "credits" or "license" for more information. MacPython IDE 1.0.1 >>> import OSAm >>> OSAm.CompileAndExecute('tell app "Finder" to return the name of the startup disk') '"Macintosh HD"' >>> Hope that helps, Michael From gherman@darwin.in-berlin.de Fri Sep 13 11:15:29 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Fri, 13 Sep 2002 12:15:29 +0200 Subject: [Pythonmac-SIG] buildpkg.py In-Reply-To: <10823F39-C6BA-11D6-86EE-00039346A28A@grassi.org> Message-ID: Dan Grassi: > Sure, 10.2 DevTools uses this new format. Also just check the help on > the 10.2 Packagemaker. BTW, Apple has stated (WWDC 2002) that they > will be supplying a shell tool to create (10.2) packages (was promised > for Jag but I can not find it and it might not have made it). > > See: > http://developer.apple.com/techpubs/macosx/ReleaseNotes/ > PackageMaker.html Ok, I've found some more info, thanks! I think for the time being I'll stick with the package layout and install options provided by the current version of buildpkg.py. I'm writing a more detailed Readme which will better explain what you can expect from it and what not. > BTW, I have a problem with buildpkg.py and titles that have a space in > them even when quoted. I am using the shell interface. Oh yeah, the usual issues when I'm calling shell programs. I've just fixed it. It will be in the next version. Dinu -- Dinu C. Gherman ...................................................................... "I never apologize for the United States of America, I don't care what the facts are." (George Bush, Sr.) From aureli@ipk.fhg.de Fri Sep 13 11:33:22 2002 From: aureli@ipk.fhg.de (Aureli Soria Frisch) Date: Fri, 13 Sep 2002 12:33:22 +0200 Subject: [Pythonmac-SIG] Types and casting In-Reply-To: <1E08A4EC-C6C5-11D6-8498-0003937807FC@physics.otago.ac.nz> References: <1E08A4EC-C6C5-11D6-8498-0003937807FC@physics.otago.ac.nz> Message-ID: --============_-1180209287==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Hi, >I am reading in raw image files from a frame grabber for processing. >What I really want is a matrix of integers for analysis (I don't >care about the image itself). Is there an easy way to get python to >do this? I use a combination of PIL and Numeric for that purpose. So the frame grabber should save an image file (in supported formats) and then you can do a conversion to Numeric in order to have the numeric arrays. If you want to take the image directly from the buffer of the frame grabber I do not know how can you do that (or even if you can). I personally use following conversion functions (they are light modified from some functions I got from the Image-SIG mailing list): ####################################################### ##dataConversion.py ##functions for data conversion between Numeric and PIL # import Numeric import Image from ArrayPrinter import array2string #conversion image object (PIL) to narray object (Numeric) #outputDim: rank of output array def image2array(im,outputDim=3): if im.mode=="1": a=Numeric.fromstring(im.tostring(),Numeric.UnsignedInt8) #mystery why is needed im.mode="L" a = Numeric.fromstring(im.tostring(), Numeric.UnsignedInt8) a = a > 0 bands=1 elif im.mode == "L": a = Numeric.fromstring(im.tostring(), Numeric.UnsignedInt8) bands=1 elif im.mode == "F": a = Numeric.fromstring(im.tostring(), Numeric.Float32) bands=1 elif (im.mode=='RGB')|(im.mode=='YCbCr'): a = Numeric.fromstring(im.tostring(), Numeric.UnsignedInt8) bands=3 elif (im.mode=='RGBA')|(im.mode=='CMYK'): a = Numeric.fromstring(im.tostring(), Numeric.UnsignedInt8) bands=4 else: raise ValueError, im.mode+" mode not considered" #print "array u to now" #print a if outputDim==3: a.shape=(im.size[1],im.size[0],bands) elif outputDim==2: a=Numeric.reshape(a,(im.size[1],im.size[0])) elif outputDim==1: a=Numeric.reshape(a,(im.size[1]*im.size[0],)) #print "shape change" #print a return a #autoescaling function for representation with UnsignedInt8 def _imagesc(mat): maxV=max(Numeric.ravel(mat)) minV=min(Numeric.ravel(mat)) if maxV<>minV: return (255*(mat-minV)/(maxV-minV)).astype(Numeric.UnsignedInt8) #conversion array object (Numeric) to image object (PIL) #scale=1: autoscales image, each chanel independently #scale=2: autoscales image, with max value of all channels #scale=0: do not autoscale def array2image(a,scale=1): #print a.shape if len(a.shape)==3: b=() if scale==2: a=_imagesc(a) for i in range(a.shape[2]): #print a[:,:,i].shape if scale==1: a[:,:,i]=_imagesc(a[:,:,i]) b+=(array2image(a[:,:,i]),) #print b[0].size if a.shape[2]==3: #print "here shape 3",b #return b return Image.merge("RGB",b) elif a.shape[2]==1: #print "here shape 1",b return b[0] elif len(a.shape)==2: print "autoescaling image" a=_imagesc(a) mode ="L" elif a.typecode() == Numeric.UnsignedInt8: mode = "L" elif a.typecode() == Numeric.Float32: mode = "F" else: raise ValueError, "unsupported image mode" return Image.fromstring(mode, (a.shape[1], a.shape[0]), a.astype(a.typecode()).tostring()) #write array in an ASCII file def array2file(a,filename): s=array2string(a,a.shape[0]*5,2,1,"\n") file=open(filename,"w") file.write(s[1:-1]) file.close() -- ################################# Aureli Soria Frisch Fraunhofer IPK Dept. Pattern Recognition post: Pascalstr. 8-9, 10587 Berlin, Germany e-mail: aureli@ipk.fhg.de fon: +49 30 39006-143 fax: +49 30 3917517 web: http://vision.fhg.de/~aureli/web-aureli_en.html ################################# --============_-1180209287==_ma============ Content-Type: text/html; charset="us-ascii" Re: [Pythonmac-SIG] Types and casting
Hi,


I am reading in raw image files from a frame grabber for processing.
What I really want is a matrix of integers for analysis (I don't care about the image itself).  Is there an easy way to get python to do this?

I use a combination of PIL and Numeric for that purpose. So the frame grabber should save an image file (in supported formats) and then you can do a conversion to Numeric in order to have the numeric arrays. If you want to take the image directly from the buffer of the frame grabber I do not know how can you do that (or even if you can).

I personally use following conversion functions (they are light modified from some functions I got from the Image-SIG mailing list):

#######################################################
##dataConversion.py
##functions for data conversion between Numeric and PIL
#
import Numeric
import Image
from ArrayPrinter import array2string

#conversion image object (PIL) to narray object (Numeric)
#outputDim: rank of output array
def image2array(im,outputDim=3):
    if im.mode=="1":
        a=Numeric.fromstring(im.tostring(),Numeric.UnsignedInt8)                  
        #mystery why is needed
        im.mode="L"
        a = Numeric.fromstring(im.tostring(), Numeric.UnsignedInt8)
        a = a > 0
        bands=1
    elif im.mode == "L":
        a = Numeric.fromstring(im.tostring(), Numeric.UnsignedInt8)
        bands=1
    elif im.mode == "F":
        a = Numeric.fromstring(im.tostring(), Numeric.Float32)
        bands=1
    elif (im.mode=='RGB')|(im.mode=='YCbCr'):
        a = Numeric.fromstring(im.tostring(), Numeric.UnsignedInt8)
        bands=3
    elif (im.mode=='RGBA')|(im.mode=='CMYK'):
        a = Numeric.fromstring(im.tostring(), Numeric.UnsignedInt8)
        bands=4
    else:
        raise ValueError, im.mode+" mode not considered"
    #print "array u to now"
    #print a
    if outputDim==3:
            a.shape=(im.size[1],im.size[0],bands)
    elif outputDim==2:
            a=Numeric.reshape(a,(im.size[1],im.size[0]))
    elif outputDim==1:
            a=Numeric.reshape(a,(im.size[1]*im.size[0],))
    #print "shape change"
    #print a
    return a

   
#autoescaling function for representation with UnsignedInt8
def _imagesc(mat):
       
        maxV=max(Numeric.ravel(mat))
        minV=min(Numeric.ravel(mat))
        if maxV<>minV:
                return (255*(mat-minV)/(maxV-minV)).astype(Numeric.UnsignedInt8)

#conversion array object (Numeric) to image object (PIL)
#scale=1: autoscales image, each chanel independently
#scale=2: autoscales image, with max value of all channels
#scale=0: do not autoscale
def array2image(a,scale=1):
    #print a.shape
    if len(a.shape)==3:
        b=()
        if scale==2:
                a=_imagesc(a)
        for i in range(a.shape[2]):
                #print a[:,:,i].shape
               
                if scale==1:
                        a[:,:,i]=_imagesc(a[:,:,i])    
                b+=(array2image(a[:,:,i]),)
        #print b[0].size
        if a.shape[2]==3:
                #print "here shape 3",b
                #return b
                return Image.merge("RGB",b)
        elif a.shape[2]==1:
                #print "here shape 1",b
                return b[0]
    elif len(a.shape)==2:
            print "autoescaling image"
            a=_imagesc(a)
            mode ="L"
    elif a.typecode() == Numeric.UnsignedInt8:
        mode = "L"
    elif a.typecode() == Numeric.Float32:
        mode = "F"
    else:
        raise ValueError, "unsupported image mode"
    return Image.fromstring(mode, (a.shape[1], a.shape[0]), a.astype(a.typecode()).tostring())

#write array in an ASCII file   
def array2file(a,filename):
        s=array2string(a,a.shape[0]*5,2,1,"\n")
        file=open(filename,"w")
        file.write(s[1:-1])
        file.close()



--
#################################
Aureli Soria Frisch
Fraunhofer IPK
Dept. Pattern Recognition

post: Pascalstr. 8-9, 10587 Berlin, Germany
e-mail: aureli@ipk.fhg.de
fon: +49 30 39006-143
fax: +49 30 3917517
web: http://vision.fhg.de/~aureli/web-aureli_en.html
#################################
--============_-1180209287==_ma============-- From gherman@darwin.in-berlin.de Fri Sep 13 12:39:56 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Fri, 13 Sep 2002 13:39:56 +0200 Subject: [Pythonmac-SIG] "Temp files/dir" In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43F5AD7@ussunm001.palmsource.com> Message-ID: <86C6D73F-C70D-11D6-9E7D-00039345C610@darwin.in-berlin.de> Robin Siebler: > I need to create some temp files in a MacPython script. Is there a > standard way of handling this on the Mac? import tempfile Dinu -- Dinu C. Gherman ...................................................................... "The first principle is that you must not fool yourself - and you are the easiest person to fool." (Richard Feynman) From kp87@lycos.com Fri Sep 13 15:52:23 2002 From: kp87@lycos.com (kevin parks) Date: Fri, 13 Sep 2002 10:52:23 -0400 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG digest, Vol 1 #1203 - 10 msgs Message-ID: *** > For the MacPython 2.3 [*] installer there are three > solutions, I think: > 1. Slam our "python" and "pythonw" into /usr/bin, > overwriting > Apple's python. > 2. Put our "python" and "pythonw" in /usr/local/bin, > and > (optionally?) modify ~/Library/Preferences/Environ (or > whereever > it was again). > 3. Don't install the scripts at all initially, and > provide a way > to install them later. > > I think 1 is out, really. Anyone disagree? *** But then the user ends up with 2 pythons and there may be some confusion as to which is further up or down the path and which binary is actually getting used, no? Particularly for invoking scripts from the shell no? I, personally, would be confused with this. Couldn't there be an option to remove Apple's or something? It wouldn't be that hard to remove "our" python and reinstall the Apple one would it? _____________________________________________________________ Play the Elvis® Scratch & Win for your chance to instantly win $10,000 Cash - a 2003 Harley Davidson® Sportster® - 1 of 25,000 CD's - and more! http://r.lycos.com/r/sagel_mail_scratch_tl/http://win.ipromotions.com/lycos_020801/index.asp?tc=7087 From owen@astro.washington.edu Fri Sep 13 17:23:31 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Fri, 13 Sep 2002 09:23:31 -0700 Subject: [Pythonmac-SIG] Help: fink python broken after 10.2 upgrade Message-ID: I may have missed the discussion already on this (was on vacation recently) but I did check the archives and if it's there, I missed it. I upgraded to 10.2 yesterday (including the developer tools) and now my Python (the current fink binary, version 2.2) is broken. When I start it I see: /sw/bin/python Python 2.2 (#1, Apr 17 2002, 16:11:12) [GCC 2.95.2 19991024 (release)] on darwin Type "help", "copyright", "credits" or "license" for more information. dyld: /sw/bin/python Undefined symbols: /sw/lib/libreadline.4.2.dylib undefined reference to _tgetent expected to be defined in /usr/lib/libSystem.B.dylib Trace/BPT trap I realize python is also part of 10.2, so I tried that version. It runs, of course, but doesn't have readlines support and it can't find Tkinter or Numeric. Any suggestions for an easy way back to a working system (necessarily with Tkinter and Numeric and very preferably with readlines)? -- Russell In case it helps, here's my environment: =00H=00O=00M=00E=00=3D=00/=00U=00s=00e=00r=00s=00/=00r=00o=00w=00e=00n=00 =00S=00H=00E=00L=00L=00=3D=00/=00b=00i=00n=00/=00t=00c=00s=00h=00 =00U=00S=00E=00R=00=3D=00r=00o=00w=00e=00n=00 =00P=00A=00T=00H=00=3D=00/=00s=00w=00/=00b=00i=00n=00:=00/=00s=00w=00/=00s= =00b=00i=00n=00:=00/=00b=00i=00n=00:=00/=00s=00b=00i=00n=00:=00/=00u=00s=00r= =00/=00b=00i=00n=00:=00/=00u=00s=00r=00/=00s=00b=00i=00n=00:=00/=00u=00s=00r= =00/=00X=001=001=00R=006=00/=00b=00i=00n=00 =00P=00Y=00T=00H=00O=00N=00D=00O=00C=00S=00=3D=00/=00L=00i=00b=00r=00a=00r= =00y=00/=00A=00p=00p=00l=00i=00c=00a=00t=00i=00o=00n=00\=00 =00S=00u=00p=00p=00o=00r=00t=00/=00P=00y=00t=00h=00o=00n=00\=00 =002=00.=002= =00\=00 =00D=00o=00c=00s=00/=00 =00P=00Y=00T=00H=00O=00N=00P=00A=00T=00H=00=3D=00/=00U=00s=00e=00r=00s=00/= =00r=00o=00w=00e=00n=00/=00P=00y=00t=00h=00o=00n=00R=00O=00:=00/=00U=00s=00e= =00r=00s=00/=00r=00o=00w=00e=00n=00/=00P=00y=00t=00h=00o=00n=00R=00O=00/=00U= =00t=00i=00l=00:=00/=00U=00s=00e=00r=00s=00/=00r=00o=00w=00e=00n=00/=00P=00y= =00t=00h=00o=00n=00R=00O=00/=00T=00U=00I=00:=00 =00S=00S=00H=00_=00A=00U=00T=00H=00_=00S=00O=00C=00K=00=3D=00/=00t=00m=00p= =00/=005=000=001=00/=00n=00l=00.=00u=00u=00.=00p=00h=00i=00l=00.=00S=00S=00H= =00A=00g=00e=00n=00t=00.=00s=00o=00c=00k=00e=00t=00 =00D=00I=00S=00P=00L=00A=00Y=00=3D=00:=000=00.=000=00 =00_=00_=00C=00F=00_=00U=00S=00E=00R=00_=00T=00E=00X=00T=00_=00E=00N=00C=00O= =00D=00I=00N=00G=00=3D=000=00x=001=00F=005=00:=000=00:=000=00 =00T=00E=00R=00M=00=3D=00v=00t=001=000=000=00 =00T=00E=00R=00M=00C=00A=00P=00=3D=9D=9B=9D=9B=9D=9B=00 =00 =00T=00E=00R=00M=00_=00P=00R=00O=00G=00R=00A=00M=00=3D=00A=00p=00p=00l=00e= =00_=00T=00e=00r=00m=00i=00n=00a=00l=00 =00T=00E=00R=00M=00_=00P=00R=00O=00G=00R=00A=00M=00_=00V=00E=00R=00S=00I=00O= =00N=00=3D=008=001=00 =00L=00O=00G=00N=00A=00M=00E=00=3D=00r=00o=00w=00e=00n=00 =00H=00O=00S=00T=00T=00Y=00P=00E=00=3D=00m=00a=00c=00i=00n=00t=00o=00s=00h= =00 =00V=00E=00N=00D=00O=00R=00=3D=00a=00p=00p=00l=00e=00 =00O=00S=00T=00Y=00P=00E=00=3D=00d=00a=00r=00w=00i=00n=00 =00M=00A=00C=00H=00T=00Y=00P=00E=00=3D=00p=00o=00w=00e=00r=00p=00c=00 =00S=00H=00L=00V=00L=00=3D=001=00 =00P=00W=00D=00=3D=00/=00s=00w=00/=00b=00i=00n=00 =00G=00R=00O=00U=00P=00=3D=00s=00t=00a=00f=00f=00 =00H=00O=00S=00T=00=3D=00r=00o=00w=00e=00n=00.=00a=00s=00t=00r=00o=00.=00w= =00a=00s=00h=00i=00n=00g=00t=00o=00n=00.=00e=00d=00u=00 =00M=00A=00N=00P=00A=00T=00H=00=3D=00/=00s=00w=00/=00s=00h=00a=00r=00e=00/= =00m=00a=00n=00:=00/=00s=00w=00/=00m=00a=00n=00:=00/=00u=00s=00r=00/=00l=00o= =00c=00a=00l=00/=00s=00h=00a=00r=00e=00/=00m=00a=00n=00:=00/=00u=00s=00r=00/= =00l=00o=00c=00a=00l=00/=00m=00a=00n=00:=00/=00u=00s=00r=00/=00s=00h=00a=00r= =00e=00/=00m=00a=00n=00:=00/=00u=00s=00r=00/=00X=001=001=00R=006=00/=00m=00a= =00n=00 =00I=00N=00F=00O=00P=00A=00T=00H=00=3D=00/=00s=00w=00/=00s=00h=00a=00r=00e= =00/=00i=00n=00f=00o=00:=00/=00s=00w=00/=00i=00n=00f=00o=00:=00/=00u=00s=00r= =00/=00l=00o=00c=00a=00l=00/=00s=00h=00a=00r=00e=00/=00i=00n=00f=00o=00:=00/= =00u=00s=00r=00/=00l=00o=00c=00a=00l=00/=00l=00i=00b=00/=00i=00n=00f=00o=00:= =00/=00u=00s=00r=00/=00l=00o=00c=00a=00l=00/=00i=00n=00f=00o=00:=00/=00u=00s= =00r=00/=00s=00h=00a=00r=00e=00/=00i=00n=00f=00o=00 =00P=00E=00R=00L=005=00L=00I=00B=00=3D=00/=00s=00w=00/=00l=00i=00b=00/=00p= =00e=00r=00l=005=00 =00P=00E=00P=00P=00E=00R=00=3D=00/=00A=00p=00p=00l=00i=00c=00a=00t=00i=00o= =00n=00s=00/=00P=00e=00p=00p=00e=00r=00/=00P=00e=00p=00p=00e=00r=00 =00E=00D=00I=00T=00O=00R=00=3D=00/=00u=00s=00r=00/=00b=00i=00n=00/=00m=00l= =00p=00e=00 =00C=00V=00S=00_=00R=00S=00H=00=3D=00s=00s=00h=00 and my .cshrc: source /sw/bin/init.csh setenv PYTHONPATH "/Users/rowen/PythonRO:" setenv PYTHONDOCS "/Library/Application\ Support/Python\ 2.2\ Docs/" if( ! $?DISPLAY ) setenv DISPLAY :0.0 setenv PEPPER /Applications/Pepper/Pepper setenv EDITOR /usr/bin/mlpe # setenv EDITOR "bbedit -w" alias fnalcvs setenv CVSROOT cvsuser@sdss.fnal.gov:/cvs/sdss alias apocvs setenv CVSROOT :ext:cvs@galileo.apo.nmsu.edu:/home/cvs alias oldapocvs setenv CVSROOT :pserver:rowen-cvs@galileo.apo.nmsu.edu:/home/cvs setenv CVS_RSH ssh From english@spiritone.com Fri Sep 13 17:40:07 2002 From: english@spiritone.com (Josh English) Date: 13 Sep 2002 09:40:07 -0700 Subject: [Pythonmac-SIG] Re: Determining the name of the "root" drive References: <20020913104119.30544.4592.Mailman@mail.python.org> Message-ID: <3D8214E7.C08AE7E7@spiritone.com> Finally, one that even I can answer ; ) try >>> os.getcwd().split(':')[0] 'Marvin' Marvin is the name of my hard drive. Josh English english@spiritone.com From Robin.Siebler@palmsource.com Fri Sep 13 18:54:28 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Fri, 13 Sep 2002 10:54:28 -0700 Subject: [Pythonmac-SIG] Temp files/dir Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF936@ussunm001.palmsource.com> I guess I didn't word this very well. What I was trying to find out was = *where* to place temp files, which is very easy to find out in Windows. = After pounding my head against the monitor and searching Google for = about 30 minutes, I finally found this AppleScript command "path to = temporary items folder", which seems to be what I wanted to know. = Thanks for the help though. Aside from a post to this group, I never = found anything that said how to find the startup disk on a Mac. Robin L. Siebler Software Test Engineer Palm --------------------------------------- Lisa Simpson: I still believe in protecting animal's rights, but that = still doesn't excuse what I did. I'm sorry for wrecking your barbecue, = dad. Homer: That's okay, honey. I used to believe in things too. From Robin.Siebler@palmsource.com Fri Sep 13 19:40:25 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Fri, 13 Sep 2002 11:40:25 -0700 Subject: [Pythonmac-SIG] Calling diff from MacPython Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF93B@ussunm001.palmsource.com> I need to compare to files and find out where they are different. Using = diff seems to be a much better/faster choice compared to using cmp(). = How would I call the *nix command diff from MacPython? The MacPython = version of os has no system() call.=20 Robin L. Siebler Software Test Engineer Palm --------------------------------------- Moe Szyslak: Hey, I don't need no advice from a pinball machine. I'll = have you know, I wrote the book on love. Abe Simpson: Yeah - "All = Quiet on the Western Front"! From Jack.Jansen@oratrix.com Fri Sep 13 20:14:59 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Fri, 13 Sep 2002 21:14:59 +0200 Subject: [Pythonmac-SIG] Re: Determining the name of the "root" drive In-Reply-To: <3D8214E7.C08AE7E7@spiritone.com> Message-ID: <18A49CB8-C74D-11D6-8CD8-003065517236@oratrix.com> On vrijdag, september 13, 2002, at 06:40 , Josh English wrote: > Finally, one that even I can answer ; ) > > try > >>>> os.getcwd().split(':')[0] > 'Marvin' > > Marvin is the name of my hard drive. Close, but no cigar. Your currrent directory doesn't have to be on the startup disk. The right way to tackle this (or, one of the right ways, as the OSA example showed:-) is to ask where the current system folder is, and use your code on that filename: import macfs vrefnum, dirid = macfs.FindFolder('macs') fss = macfs.FSSpec(vrefnum, dirid, "") bootdiskname = fss.as_pathname().split(':')[0] -- - 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 bfancher@mac.com Fri Sep 13 20:20:53 2002 From: bfancher@mac.com (bill fancher) Date: Fri, 13 Sep 2002 12:20:53 -0700 Subject: [Pythonmac-SIG] Temp files/dir In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF936@ussunm001.palmsource.com> Message-ID: On Friday, September 13, 2002, at 10:54 AM, Robin Siebler wrote: > I guess I didn't word this very well. What I was trying to find out > was *where* to place temp files, which is very easy to find out in > Windows. After pounding my head against the monitor and searching > Google for about 30 minutes, I finally found this AppleScript command > "path to temporary items folder", which seems to be what I wanted to > know. Thanks for the help though. Aside from a post to this group, I > never found anything that said how to find the startup disk on a Mac. Following the pointer Dinu helpfully provided... >>> import tempfile >>> tempfile.mktemp() 'MacOSX:private:tmp:502:Temporary Items:Python-Tmp-0' >>> Or in "MachoPython" >>> import tempfile >>> tempfile.mktemp() '/tmp/tmpxH2Fb4' >>> I've never used this before. It took about two minutes to figure out. Further, tempfile provides cross-platform support for creating temp files, so you really don't need to know the folder name on ANY platform. Pointing out how much "better" Windows is probably won't win you many friends on this list. -- bill From Jack.Jansen@oratrix.com Fri Sep 13 20:25:19 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Fri, 13 Sep 2002 21:25:19 +0200 Subject: [Pythonmac-SIG] Calling diff from MacPython In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF93B@ussunm001.palmsource.com> Message-ID: <8A51C436-C74E-11D6-8CD8-003065517236@oratrix.com> On vrijdag, september 13, 2002, at 08:40 , Robin Siebler wrote: > I need to compare to files and find out where they are > different. Using diff seems to be a much better/faster choice > compared to using cmp(). How would I call the *nix command > diff from MacPython? The MacPython version of os has no > system() call. This is pretty much impossible, I think. It could be implemented, by using the CFM->MachO bridge and calling system() from libc through that, but unless someone can donate working code (in the form of a CFM system() routine that I can just drop in, and that will return a decent error on OS9) I couldn't be bothered to implement this. MacPython-OS9 is a dead end anyway. -- - 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 Robin.Siebler@palmsource.com Fri Sep 13 20:24:15 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Fri, 13 Sep 2002 12:24:15 -0700 Subject: [Pythonmac-SIG] Temp files/dir Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF93E@ussunm001.palmsource.com> >Pointing out how much "better" Windows is probably won't win you many=20 >friends on this list. I never said that Windows was "much better". Perhaps you should read my = post again. I said "Performing *this* task is easier on Windows". = Having *worked* for MicroSoft, I have a list of the things wrong with = Windows that is at *least* 5 miles long. From Robin.Siebler@palmsource.com Fri Sep 13 20:27:04 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Fri, 13 Sep 2002 12:27:04 -0700 Subject: [Pythonmac-SIG] Bug in cmp()? Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF93F@ussunm001.palmsource.com> I have 2 files that *should* be identical. According to 'diff -s', they = are. However, comparing the two files using cmp() results in a return = value of '-1'. Robin L. Siebler Software Test Engineer Palm --------------------------------------- [Homer uncovers a scheme to supply low-grade milk to the school] = Homer Simpson: They're milking rats! RATS! Mayor 'Diamond' Joe = Quimby: [to Fat Tony] Rats?! You promised me dog or higher! From just@letterror.com Fri Sep 13 20:31:49 2002 From: just@letterror.com (Just van Rossum) Date: Fri, 13 Sep 2002 21:31:49 +0200 Subject: [Pythonmac-SIG] Bug in cmp()? In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF93F@ussunm001.palmsource.com> Message-ID: Robin Siebler wrote: > I have 2 files that *should* be identical. According to 'diff -s', > they are. However, comparing the two files using cmp() results in a > return value of '-1'. The cmp() function compares two objects, not files. How exactly are you using it? Just From Jack.Jansen@oratrix.com Fri Sep 13 20:33:55 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Fri, 13 Sep 2002 21:33:55 +0200 Subject: [Pythonmac-SIG] Help: fink python broken after 10.2 upgrade In-Reply-To: Message-ID: On vrijdag, september 13, 2002, at 06:23 , Russell E Owen wrote: > I upgraded to 10.2 yesterday (including the developer tools) and now > my Python (the current fink binary, version 2.2) is broken. When I > start it I see: > /sw/bin/python > Python 2.2 (#1, Apr 17 2002, 16:11:12) > [GCC 2.95.2 19991024 (release)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > dyld: /sw/bin/python Undefined symbols: > /sw/lib/libreadline.4.2.dylib undefined reference to _tgetent > expected to be defined in /usr/lib/libSystem.B.dylib > Trace/BPT trap This is the Jaguar problem I've seen the most complaints about. Up to 10.1.5 Apple shipped a very old curses implementation and had it right in libSystem. Since 10.2 Apple ships a much more decent ncurses, but it lives in a separate shared library. And what bothers me is that the framework versioning would have allowed them to ship a compatibility version of libSystem, but apparently they didn't consider it worth it. If every upgrade from 10.N to 10.(N+1) is going to break a lot of innocent software Apple is moving away from the brilliant backward compatibility they had in OS7-8-9 (99.9% of your software survived an upgrade). Add to that the fact that I don't think it's possible on 10.2 to create a binary that will run on 10.1 also (or is there a way to do this? Please enlighten me), and it seems we're up the same creek that Windows users are, that OS upgrades are a dangerous thing not to be undertaken lightly. -- - 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 Robin.Siebler@palmsource.com Fri Sep 13 20:34:35 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Fri, 13 Sep 2002 12:34:35 -0700 Subject: [Pythonmac-SIG] Bug in cmp()? Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF941@ussunm001.palmsource.com> Ack! I'm obviously trying to do too many different things at the same = time today! I *should* have been using filecmp.cmp(). "Nevermind" -----Original Message----- From: Just van Rossum [mailto:just@letterror.com] Sent: Friday, September 13, 2002 12:32 PM To: Robin Siebler Cc: pythonmac-sig@python.org Subject: Re: [Pythonmac-SIG] Bug in cmp()? Robin Siebler wrote: > I have 2 files that *should* be identical. According to 'diff -s', > they are. However, comparing the two files using cmp() results in a > return value of '-1'. The cmp() function compares two objects, not files. How exactly are you = using it? Just From ryanwilcox@mac.com Fri Sep 13 20:48:09 2002 From: ryanwilcox@mac.com (Ryan Wilcox) Date: Fri, 13 Sep 2002 15:48:09 -0400 Subject: [Pythonmac-SIG] Calling diff from MacPython In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF93B@ussunm001.palmsource.com> Message-ID: On Friday, September 13, 2002, at 11:40 AM, Robin Siebler wrote: >I need to compare to files and find out where they are different. >Using diff seems to be a much better/faster choice compared to using >cmp(). How would I call the *nix command diff from MacPython? The >MacPython version of os has no system() call. If you can control your environment, you might consider using BBEdit's Compare Files. It's only "ok" -- but it's pretty easy to figure out if two files are different. (It however, will NOT tell you how MANY differences WERE found via the scripting interface) Don't know if it's faster then cmp() though. And I don't think there's a built-in BBEdit python module -- you'd have to wrap a lot of it yourself. --------------- HOLD THE TRAIN.... You also might be able to use the "do shell script" osax to do this.. wrapping this into SYSTEM, I think, would be pretty simple. On OS 9, doesn't system() call MPW? (I thought I saw that somewhere) If I get a chance this weekend, I can investigate this... Have a good holiday, Jack. -Ryan Wilcox ---------------- PGP: 0x2F4E9C31 ---------------- From Robin.Siebler@palmsource.com Fri Sep 13 21:26:07 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Fri, 13 Sep 2002 13:26:07 -0700 Subject: [Pythonmac-SIG] Calling diff from MacPython Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF943@ussunm001.palmsource.com> Using filecmp.cmp()and cmp() seems to be working, although I haven't fed = it any large files yet. I think using cmp() to compare each line of the = file (for files that filecmp shows to be different) might be a bit slow = on large (5k lines or better) files. -----Original Message----- From: Ryan Wilcox [mailto:ryanwilcox@mac.com] Sent: Friday, September 13, 2002 12:48 PM To: Robin Siebler; pythonmac-sig@python.org Subject: Re: [Pythonmac-SIG] Calling diff from MacPython On Friday, September 13, 2002, at 11:40 AM, Robin Siebler wrote: >I need to compare to files and find out where they are different.=20 >Using diff seems to be a much better/faster choice compared to using >cmp(). How would I call the *nix command diff from MacPython? The >MacPython version of os has no system() call.=20 If you can control your environment, you might consider using BBEdit's Compare Files. It's only "ok" -- but it's pretty easy to figure out if two files are different. (It however, will NOT tell you how MANY differences WERE found via the scripting interface) Don't know if it's faster then cmp() though. And I don't think there's a built-in BBEdit python module -- you'd have to wrap a lot of it yourself. --------------- HOLD THE TRAIN.... You also might be able to use the "do shell script" osax to do this.. wrapping this into SYSTEM, I think, would be pretty simple. On OS 9, doesn't system() call MPW? (I thought I saw that somewhere) If I get a chance this weekend, I can investigate this... Have a good holiday, Jack. -Ryan Wilcox ---------------- PGP: 0x2F4E9C31 ---------------- From Jack.Jansen@oratrix.com Fri Sep 13 21:54:15 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Fri, 13 Sep 2002 22:54:15 +0200 Subject: [Pythonmac-SIG] Should buildpkg mangle resource file names or not? Message-ID: Here's a question that came up in a private discussion between Dinu and me, and I'd like to get other people to think about it too. Dinu's original implementation of buildpkg.py copied a pre-defined set of files from the resource directory to the package. These files had to exist with the package name in there, i.e. "Python 2.3a1.pre_install". I modified this so that a file that was simply called "pre_install" would be copied into the package as "Python 2.3a1.pre_install". This has the advantage that you can use your resource-source-directory for multiple distributions, because the filenames in there are not dependent on the installer package name. For one thing, this would allow me to put the resource-source-directory for the Python installer under CVS more easily. Dinu then sent me a patch that copies *all* files from the resource-source-directory. This is arguably better (as you can include sub-scripts, and as it allows the inclusion of resources that buildpkg isn't aware of), but it would break the generic name scheme I had done. Which scheme is better? Or should we do both? How? -- - 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 goodger@users.sourceforge.net Fri Sep 13 22:19:43 2002 From: goodger@users.sourceforge.net (David Goodger) Date: Fri, 13 Sep 2002 17:19:43 -0400 Subject: [Pythonmac-SIG] Calling diff from MacPython In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF93B@ussunm001.palmsource.com> Message-ID: Robin Siebler wrote: > I need to compare to files and find out where they are different. Using diff > seems to be a much better/faster choice compared to using cmp(). cmp() just tells you if they're identical; diff tells you *what* the differences are. So I'd say it's more useful anyhow. > How would I call the *nix command diff from MacPython? Why not use Python's difflib? It may not be the speed demon that /bin/diff is, but it's OS-independent and gives *very* readable results. -- David Goodger Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ From Robin.Siebler@palmsource.com Fri Sep 13 22:22:57 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Fri, 13 Sep 2002 14:22:57 -0700 Subject: [Pythonmac-SIG] Calling diff from MacPython Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF944@ussunm001.palmsource.com> David Goodger Wrote: >Why not use Python's difflib? It may not be the speed demon that = /bin/diff >is, but it's OS-independent and gives *very* readable results. Because I never knew there was such a critter? Thanks! I'll go look it = up! From owen@astro.washington.edu Fri Sep 13 23:35:33 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Fri, 13 Sep 2002 15:35:33 -0700 Subject: [Pythonmac-SIG] Help: fink python broken after 10.2 upgrade In-Reply-To: References: Message-ID: Culling everything I've been able to find so far, it appears: - fink will need updating for fink python to run on MacOS 10.2. That is patently true of the binary. I'm not sure of the source. I tried the fink source installation and got nowhere (some database it wanted to install couldn't be installed), which is probably not a MacOS X 10.2 issue. - Installing Python directly from the unix tarball and getting readline and Tkinter support is a complicated process. In fact I'm still hacking at it, but so far I found: Dan Wolfe's Pythonmac-SIG message gives clear instructions on installing gnu readlines, which must be done before you install Python if you want readline support. I decided to try the Aqua version of tcl/tk. I installed the binary from and tried to use Tony Lownds' instructions for building Python with it from . However, these instructions are a bit old (they were clearly not written for the current Python and MacOS 10.2) and they failed for me. The make returned the following errors: libtool -o Python.framework/Versions/2.2/Python -dynamic libpython2.2.a \ -framework System -lcc_dynamic -arch_only ppc -flat_namespace -U _environ -framework CoreServices -framework Foundation -install_name Python.framework/Versions/2.2/Python -compatibility_version 2.2 -current_version 2.2 ld: Undefined symbols: _TclFreeObj _Tcl_AddErrorInfo _Tcl_Alloc _Tcl_CreateCommand _Tcl_CreateFileHandler _Tcl_CreateInterp I suspect I can just install XonX's current xfree86 (which is rumored to have been updated for MacOS 10.2) and then do the default build of Python. That is certainly what I will try next on Monday (I'm getting a cold and am going home early). However, if anyone has already waded through this swamp and has actual instructions for building Python with readlines and Tkinter support, I would be very grateful for them. -- Russell At 9:33 PM +0200 2002-09-13, Jack Jansen wrote: >On vrijdag, september 13, 2002, at 06:23 , Russell E Owen wrote: >>I upgraded to 10.2 yesterday (including the developer tools) and now >>my Python (the current fink binary, version 2.2) is broken. When I >>start it I see: >>/sw/bin/python >>Python 2.2 (#1, Apr 17 2002, 16:11:12) >>[GCC 2.95.2 19991024 (release)] on darwin >>Type "help", "copyright", "credits" or "license" for more information. >>dyld: /sw/bin/python Undefined symbols: >>/sw/lib/libreadline.4.2.dylib undefined reference to _tgetent >>expected to be defined in /usr/lib/libSystem.B.dylib >>Trace/BPT trap > >This is the Jaguar problem I've seen the most complaints about. Up >to 10.1.5 Apple shipped a very old curses implementation and had it >right in libSystem. Since 10.2 Apple ships a much more decent >ncurses, but it lives in a separate shared library. > >And what bothers me is that the framework versioning would have >allowed them to ship a compatibility version of libSystem, but >apparently they didn't consider it worth it. If every upgrade from >10.N to 10.(N+1) is going to break a lot of innocent software Apple >is moving away from the brilliant backward compatibility they had in >OS7-8-9 (99.9% of your software survived an upgrade). Add to that >the fact that I don't think it's possible on 10.2 to create a binary >that will run on 10.1 also (or is there a way to do this? Please >enlighten me), and it seems we're up the same creek that Windows >users are, that OS upgrades are a dangerous thing not to be >undertaken lightly. >-- >- 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 owen@astro.washington.edu Fri Sep 13 23:41:50 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Fri, 13 Sep 2002 15:41:50 -0700 Subject: [Pythonmac-SIG] readlines support--any reason to use 4.2 instead of 4.3? Message-ID: I just realized I fairly blindly copied somebody else's instructions for installing readlines 4.2, but 4.2a and 4.3 are also available. Is there a good reason not to use the latest version? -- Russell From dkwolfe@pacbell.net Fri Sep 13 23:55:51 2002 From: dkwolfe@pacbell.net (Dan Wolfe) Date: Fri, 13 Sep 2002 15:55:51 -0700 Subject: [Pythonmac-SIG] readlines support--any reason to use 4.2 instead of 4.3? In-Reply-To: Message-ID: Not really... the only reason that I haven't upgrade is because I haven't figured out how to modified the make file to take into account the new version ncurse and the fact that Apple broke it out of the system library in 10.2... it's on my list of things to do but it's pretty long way down the list since 4.2 works just fine for me. ;-) - Dan On Friday, September 13, 2002, at 03:41 PM, Russell E Owen wrote: > I just realized I fairly blindly copied somebody else's instructions > for installing readlines 4.2, but 4.2a and 4.3 are also available. Is > there a good reason not to use the latest version? From tony@lownds.com Sat Sep 14 00:03:01 2002 From: tony@lownds.com (Tony Lownds) Date: Fri, 13 Sep 2002 16:03:01 -0700 Subject: [Pythonmac-SIG] Help: fink python broken after 10.2 upgrade In-Reply-To: References: Message-ID: Russell, If you can install Tcl/Tk on your own and get Python from CVS then Python's default build will install Tkinter for you! No more mucking with Modules/Setup files. >I decided to try the Aqua version of tcl/tk. I installed the binary >from >and tried to use Tony Lownds' instructions for building Python with >it from . However, these >instructions are a bit old (they were clearly not written for the >current Python and MacOS 10.2) > and they failed for me. Yeah, they are for 2.2 and have not been tried except by you on Jaguar yet. Anyway, I think you need this line at the top of Modules/Setup.local: *shared* -Tony From owen@astro.washington.edu Sat Sep 14 00:21:46 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Fri, 13 Sep 2002 16:21:46 -0700 Subject: [Pythonmac-SIG] progress report...Tkinter no go with xfree86 either Message-ID: I installed xfree86 using XonX's new installer "XFree86_4.2.0.1-10.2" for MacOS 10.2. That went fine. My OroborOSX was already current so I left it alone. I'd also already installed gnu readlines as per Dan Wolfe's helpful posting. I then build Python 2.2.1 using % make clean % make % sudo make install I don't recall seeing any outright errors, but did not save the output. The results are a Python that supports readlines (yaay), but that does NOT have Tkinter support. I get the usual error about failure to load _tkinter. I'm really surprised; I was sure this would work. Now I'm really stuck. Is there any way to get Python 2.2.1 to work with Tkinter under Jaguar? -- Russell From seth@jtan.com Sat Sep 14 02:01:33 2002 From: seth@jtan.com (Seth Delackner) Date: Fri, 13 Sep 2002 18:01:33 -0700 Subject: [Pythonmac-SIG] Bug in Numeric? In-Reply-To: <17D091E0-C6D0-11D6-8498-0003937807FC@physics.otago.ac.nz> Message-ID: <82FC801C-C77D-11D6-86B2-000393873F82@jtan.com> How did you even BUILD numeric on the Mac? I just built and installed a 2.2.1 framework python, and with either Numeric 22 or 21.3 on running "setup.py build" the step: building 'umath' extension cc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Wno-long-double -no-cpp-precomp -fno-common -dynamic -DHAVE_INVERSE_HYPERBOLIC -IInclude -IPackages/FFT/Include -IPackages/RNG/Include -I/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c Src/umathmodule.c -o build/temp.darwin-5.5-Power Macintosh-2.3/umathmodule.o Src/umathmodule.c: In function `UINT_multiply': Src/umathmodule.c:718: warning: `x' might be used uninitialized in this function Src/umathmodule.c: At top level: Src/umathmodule.c:2394: `acosh' undeclared here (not in a function) Src/umathmodule.c:2394: too many errors, bailing out error: command 'cc' failed with exit status 1 Fails, with an error about 'acosh' being undeclared, which is total hogwash because it is in . In fact, I tried a simple test file and the following fails to compile: #include "Python.h" #include static void* a[] = { (void*)acosh}; int main(void){ return 0; } With the same acosh error. Help? From seth@jtan.com Sat Sep 14 09:56:48 2002 From: seth@jtan.com (Seth Delackner) Date: Sat, 14 Sep 2002 04:56:48 -0400 Subject: [Pythonmac-SIG] How to get Tkinter support: --enable-framework In-Reply-To: References: Message-ID: <20020914085648.GA12516@callisto.jtan.com> On Fri, Sep 13, 2002 at 04:21:46PM -0700, Russell E Owen wrote: > I then build Python 2.2.1 using > % make clean > % make > % sudo make install Go read: http://tony.lownds.com/macosx/tkinter.html From seth@jtan.com Sat Sep 14 10:01:07 2002 From: seth@jtan.com (Seth Delackner) Date: Sat, 14 Sep 2002 05:01:07 -0400 Subject: [Pythonmac-SIG] Doh (My bad advice on Tk) Message-ID: <20020914090107.GB12516@callisto.jtan.com> Well, I didn't read Tony's prior message about the Modules/Setup.local stuff being necessary, but I'm pretty sure that you still have to do ./configure --enable-framework Anyway, with 2.2.1 (the release tar.gz, not cvs since cvs just gave me a 2.3 release candidate) the instructions on his page still work fine. With OS X 10.1.5 anyway. Now if only wxPython and pygame would get up to speed... the current OS X pygame is several months behind the official release and their page says you can't build it yourself without hitting bugs in python itself. From gherman@darwin.in-berlin.de Sat Sep 14 13:57:51 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Sat, 14 Sep 2002 14:57:51 +0200 Subject: [Pythonmac-SIG] Should buildpkg mangle resource file names or not? In-Reply-To: Message-ID: <93936B10-C7E1-11D6-9E7D-00039345C610@darwin.in-berlin.de> Jack Jansen: > Dinu then sent me a patch that copies *all* files from the > resource-source-directory. This is arguably better (as you can include > sub-scripts, and as it allows the inclusion of resources that buildpkg > isn't aware of), but it would break the generic name scheme I had > done. Here is a somewhat draftish Readme describing some background... http://python.net/~gherman/projects/buildpkg/ReadMe.txt Dinu -- Dinu C. Gherman ...................................................................... "They made a desert and called it peace." (Tacitus) From gherman@darwin.in-berlin.de Sat Sep 14 14:05:40 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Sat, 14 Sep 2002 15:05:40 +0200 Subject: [Pythonmac-SIG] Python CVS RDF news files Message-ID: Hi, I'm making available RDF news files with pointers to the latest changes in the Python (and ReportLab) CVS repositories (using ViewCVS on SourceForge): http://me.in-berlin.de/~darwin/cvspysf.rdf (Python, 24 h) http://me.in-berlin.de/~darwin/cvsrlsf.rdf (ReportLab, 72 h) Both are updated each hour. You can point any GUI tools like SlashDock* (on OS X) to them and save time by forgetting about typing the respective URLs or CVS commands for tracking changes. BTW, another interesting news file is ActiveState's one, which will let you keep an eye on the latest recipes on their cook- book website: http://aspn.activestate.com/ASPN/Cookbook/Python/index_rss Regards, Dinu * http://homepage.mac.com/stas/slashdock.html -- Dinu C. Gherman ...................................................................... "There are causes worth dying for, but none worth killing for." (Albert Camus) From aparajita@aparajitaworld.com Sat Sep 14 17:06:33 2002 From: aparajita@aparajitaworld.com (Aparajita Fishman) Date: Sat, 14 Sep 2002 12:06:33 -0400 Subject: [Pythonmac-SIG] psycopg or pypgsql Message-ID: I am having no luck getting psycopg to build/install so it will work with MacPython. It is working fine using the command line python 2.2 that comes with Jaguar. Any help would be appreciated. Aparajita Victory-Heart Productions aparajita@aparajitaworld.com www.aparajitaworld.com From english@spiritone.com Sat Sep 14 19:11:02 2002 From: english@spiritone.com (Josh English) Date: 14 Sep 2002 11:11:02 -0700 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG digest, Vol 1 #1205 - 15 msgs References: <20020913205502.7033.20938.Mailman@mail.python.org> Message-ID: <3D837BB5.2ED66FE4@spiritone.com> Darn. I didn't think about that, since I only have one drive and the OSA example didn't work. Apparently I don't have those modules installed on my system. I got the following error on my machine: >>> import macfs >>> vrefnum,dirid = macfs.FindFolder('macs') Traceback (most recent call last): File "", line 1, in ? TypeError: function takes exactly 3 arguments (1 given) I suspect this may have something to do with the fact that I am still on Mac OS 9.1 A sys.version call returns '2.2 (#124, Dec 22 2001, 17:36:41) [CW CARBON GUSI2 THREADS GC]' on my machine. Josh Englsih English@spiritone.com > > Subject: Re: [Pythonmac-SIG] Re: Determining the name of the "root" drive > Date: Fri, 13 Sep 2002 21:14:59 +0200 > From: Jack Jansen > To: "Josh English" > CC: pythonmac-sig@python.org > > Close, but no cigar. Your currrent directory doesn't have to be > on the startup disk. > > The right way to tackle this (or, one of the right ways, as the > OSA example showed:-) is to ask where the current system folder > is, and use your code on that filename: > > import macfs > vrefnum, dirid = macfs.FindFolder('macs') > fss = macfs.FSSpec(vrefnum, dirid, "") > bootdiskname = fss.as_pathname().split(':')[0] > > -- > - Jack Jansen From jwblist@olympus.net Sun Sep 15 05:22:27 2002 From: jwblist@olympus.net (John W Baxter) Date: Sat, 14 Sep 2002 21:22:27 -0700 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG digest, Vol 1 #1203 - 10 msgs In-Reply-To: References: Message-ID: At 10:52 -0400 9/13/2002, kevin parks wrote: >But then the user ends up with 2 pythons and there may be some confusion as to >which is further up or down the path and which binary is actually getting >used, no? >Particularly for invoking scripts from the shell no? I, personally, would >be confused >with this. Couldn't there be an option to remove Apple's or something? It >wouldn't be >that hard to remove "our" python and reinstall the Apple one would it? Call one of them something else. In another venue, we've grown tired of tracking RedHat's Python 1.5.2 (named python) and RedHat's or our installs of some Python 2.? (named python2). Our scripts now run in "python-preferred" whose definition we adjust as the Pythons change. Ugh. --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From owen@astro.washington.edu Sun Sep 15 22:03:36 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Sun, 15 Sep 2002 14:03:36 -0700 Subject: [Pythonmac-SIG] apologies: python 2.2.1 and Tkinter Message-ID: I must have really been out of it (given the nasty cold I came home with on Friday this is pretty likely :)). I completely forgot to install the normal unix version of tcl/tk before my last attempt to make Python 2.2.1, so of course it could not find it (all I had was the Aqua/framework version installed). I guess that's next to try for Monday. Hopefully this is my last posting on this stupid subject. I'm guessing that installing gnu readlines 4.2, the normal unix tcl/tk and then finally the normal Python 2.2.1 will get me back to a release version of Python that runs with Tkinter. -- Russell From cjl@physics.otago.ac.nz Mon Sep 16 05:22:44 2002 From: cjl@physics.otago.ac.nz (Chris Lee) Date: Mon, 16 Sep 2002 16:22:44 +1200 Subject: [Pythonmac-SIG] IDE Goes crazy.. Message-ID: Hi All, I'm sorry to be a pain but I just had a loverly thing happen to me I've been using the Python IDE all day with it going fine. I decide I want to insert a progress status dialog into my program (since I am trying something stupid and want feedback on how stupid it is). When I choose to browse the easy dialog module from the module browser I get a vast output which is pasted below. I quit the python IDE and tried to restart but all I get is a <> output window. I ran configureCarbon again and that got the IDE back but the module browser still goes crazy but only on esy dialogs (I haven't checked all the other modules though) Is this a known issue? What is the work around? Cheers Chris error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 390, in myDrawCell key, value = data[6:].split("\t", 1) ValueError: unpack list of wrong size error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') error in list definition callback: Traceback (most recent call last): File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:Wlists.py", line 412, in listDefinitionFunc dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 362, in listDefDraw dataOffset, dataLen, theList) File "Macintosh HD:Applications:Python 2.2.1:Mac:Tools:IDE:PyBrowser.py", line 393, in myDrawCell theIcon = Icn.GetCIcon(iconId) MacOS.Error: (-192, 'Resource not found') ################################# Chris Lee Physics Department Otago University PO Box 56 Dunedin New Zealand Phone ++64 3 479 7749 Fax ++64 3 479 0964 ################################# From mailing@espace-video.fr Mon Sep 16 16:01:18 2002 From: mailing@espace-video.fr (mailing@espace-video.fr) Date: Mon, 16 Sep 2002 17:01:18 +0200 Subject: [Pythonmac-SIG] ESPACE VIDEO FRANCE Message-ID: <200209161501.g8GF1Is01461@localhost.localdomain>
ESPACE VIDEO=20 FRANCE
 
Actualit=E9s Vid=E9os Vivez en direct toute= =20 l'actualit=E9 de la vid=E9o =E0 la location...
Les sorties=20 cin=E9ma...

Acc=E8s direct= au Site=20
 
Faites vos achatsCoquins =E0=20 prix Malins...
Acc=E8s direct au Site
(+18 ans uniquement)
Bou= tique lingerie=20
VHS =E0 partir de
1,99=80
     &nbs= p;DVD
=E0 partir de 4,99=80

 


Pour vous d=E9sinscrire, merci de vous rendre ici:
http://espace-video.fr/cgi-bin/pg-mlpro.cgi?A=3Dpythonm= ac-sig@python.org&L=3D4 From bfancher@mac.com Mon Sep 16 18:58:52 2002 From: bfancher@mac.com (bill fancher) Date: Mon, 16 Sep 2002 10:58:52 -0700 Subject: [Pythonmac-SIG] buildpkg.py In-Reply-To: <10823F39-C6BA-11D6-86EE-00039346A28A@grassi.org> Message-ID: On Thursday, September 12, 2002, at 06:42 PM, Dan Grassi wrote: > > Sure, 10.2 DevTools uses this new format. Also just check the help on > the 10.2 Packagemaker. BTW, Apple has stated (WWDC 2002) that they > will be supplying a shell tool to create (10.2) packages (was promised > for Jag but I can not find it and it might not have made it). > > See: > http://developer.apple.com/techpubs/macosx/ReleaseNotes/ > PackageMaker.html > %% /Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker -help 2002-09-16 10:55:49.928 PackageMaker[411] 2002-09-16 10:55:49.931 PackageMaker[411] ** PackageMaker help ** 2002-09-16 10:55:49.933 PackageMaker[411] * no args, will launch gui version 2002-09-16 10:55:49.935 PackageMaker[411] * options: 2002-09-16 10:55:49.937 PackageMaker[411] PackageMaker -build -p -f -r -i -d Just ran accross that on Project Builder list. -- bill From tony@lownds.com Mon Sep 16 19:24:18 2002 From: tony@lownds.com (Tony Lownds) Date: Mon, 16 Sep 2002 11:24:18 -0700 Subject: *Not* Launching GUI (was Re: [Pythonmac-SIG] buildpkg.py) In-Reply-To: References: Message-ID: Hi, > >%% /Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker -help >2002-09-16 10:55:49.928 PackageMaker[411] >2002-09-16 10:55:49.931 PackageMaker[411] ** PackageMaker help ** >2002-09-16 10:55:49.933 PackageMaker[411] * no args, will launch >gui version This implies there is a way to NOT launch a GUI - Bill or anyone else, do you know how they do that? IDLE could benefit from this, let me explain. IDLE from the idlefork project now runs separate processes for the interactive interpreter and when running a script. This is desirable so that errant programs cannot crash the editing environment. It does this by doing os.exec(sys.executable). On a framework build with Tkinter, that causes a second icon to show up in the dock! Its pretty disconcerting for a user. Any ideas on making a python GUI program spawn a background, non-GUI python process? Just using the /usr/bin/python that Apple provides isn't desirable, someone may want to use 2.3 features. BTW, is anyone willing to look at the IDLE keybindings for OSX I am proposing? Contact me off-list. Thanks, -Tony From Robin.Siebler@palmsource.com Mon Sep 16 19:52:03 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Mon, 16 Sep 2002 11:52:03 -0700 Subject: [Pythonmac-SIG] Difflib question Message-ID: <3271DBB88437ED41A0AB239E6C2554A43F5ADA@ussunm001.palmsource.com> Is there a way to get difflib to output *only* the lines that are = different (instead of all of the lines)? Robin L. Siebler Software Test Engineer Palm --------------------------------------- Seymour Skinner: There's no justice like angry-mob justice. From Chris.Barker@noaa.gov Mon Sep 16 19:49:01 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Mon, 16 Sep 2002 11:49:01 -0700 Subject: [Pythonmac-SIG] Bug in Numeric? References: <17D091E0-C6D0-11D6-8498-0003937807FC@physics.otago.ac.nz> Message-ID: <3D86279C.6DCD2DBB@noaa.gov> Chris Lee wrote: > >>> import Numeric > >>> t = open("Macintosh HD:Users:cjl:Desktop:100902teu:00") > >>> g = t.read() all is well here. You now have a string with your data in it. > >>> g = Numeric.reshape(g,(512,512)) You shouldn't expect this to work. reshape() takes an array as the first argument. You have passed it a string. > >>> h = Numeric.array(g, 'I') > following which MacPython hard crashes... I wouldn't expect this to work either. the array() constuctor expects a sequence of numbers (or maybe charactors, for type 'c'). HOwever, it shouldn't hard crash, either... What I think you want to do is take the data in a string, and make an array out of it. Use the fromstring() function: g = Numeric.fromstring(g,'b') # I thinkyou want 'b' as it sounds like you data is single byte unsigned integers. g.shape = (512,512) should do it. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From owen@astro.washington.edu Mon Sep 16 20:35:03 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Mon, 16 Sep 2002 12:35:03 -0700 Subject: [Pythonmac-SIG] Pyton with Tkinter on MacOS X; I give up Message-ID: OK, I've been defeated. I installed tcl 8.3.4 easily enough (using the unix installer), ending with % sudo make install. It all ran fine. But the unix installer for tk 8.3.4 croaked near the end of the make--it can't seem to find any of the tcl symbols. cc -dynamiclib -prebind -o libtk8.3.dylib tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o tkCmds.o tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o tkSelect.o tkUtil.o tkVisual.o tkWindow.o tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o tkUnixFocus.o tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o tkUnixSend.o tkUnixWm.o tkUnixXId.o tkStubInit.o tkStubLib.o tkButton.o tkEntry.o tkFrame.o tkListbox.o tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o tkScale.o tkScrollbar.o tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o tkImage.o tkImgBmap.o tkImgGIF.o tkImgPPM.o tkImgPhoto.o tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o tkTextMark.o tkTextTag.o tkTextWind.o -L/Archives*/UnixSoftware/tcl8.3.4/unix ld: warning prebinding disabled because of undefined symbols ld: Undefined symbols: _Tcl_DeleteHashEntry _Tcl_Free ...semi-infinitely long list of _Tcl_... crap The tcl stuff is in /usr/local/lib: % ls -l /usr/local/lib total 2536 -rw-r--r-- 1 root wheel 69648 Sep 13 14:49 libhistory.a -rw-r--r-- 1 root wheel 604124 Sep 13 14:49 libreadline.a -r-xr-xr-x 1 root wheel 603504 Sep 16 12:16 libtcl8.3.dylib -rw-r--r-- 1 root wheel 1568 Sep 16 12:16 libtclstub8.3.a drwxr-xr-x 520 root wheel 17680 Sep 13 16:03 python2.2 drwxr-xr-x 19 root wheel 646 Sep 16 12:16 tcl8.3 -rw-r--r-- 1 root wheel 6733 Sep 16 12:16 tclConfig.sh Maybe this is that hideous namespace depth problem folks were complaining about earlier or maybe I'm clueless on unix or... I also tried building the 8.4 macosx projects. No README so it was blind, but opening the project and building the targets in turn (Configure, Make and Tcl) acted as if it worked. But no sign of anything in /usr/local and trying to do the same for tk croaked right away--no sign of the tcl stuff it needed. I have more admiration all the time for the fink folks (and of course for Jack Jensen, with MacPython 2.3 that will have a real installer). I knew they the fink folks were saving us from downloading a bunch of miscellaneous source code and doing the ./configure, make, sudo make install dance with it, but clearly it goes way beyond that. (Also, for those who haven't been following, I already tried to get Python 2.2.1 to build as a framework with the 8.4a4 framework version of tcl/tk, but that also failed to find a bunch of needed files. Apparently using the CVS version of Python may fix that.) I guess I'll wait until the fink folks compile a binary of Python or 2.3 is available. I'm sure sorry I ever upgraded to 10.2. -- Russell From calvin@xmission.com Mon Sep 16 20:35:33 2002 From: calvin@xmission.com (Calvin) Date: Mon, 16 Sep 2002 13:35:33 -0600 (MDT) Subject: [Pythonmac-SIG] building pil jpeg has no symbols Message-ID: I have been trying to install PIL and I keep running into the following problem when doing make. I've been trying to build PIL with jpeg libs and cannot do it. Currenty I am running Mac OS X 10.2 with development tools installed. Python, mysql, mysqldb, readline, zlib all installed fine and work. Here is the error at the end of libImaging/make ranlib libImaging.a ranlib: file: libImaging.a(Dib.o) has no symbols ranlib: file: libImaging.a(JpegDecode.o) has no symbols ranlib: file: libImaging.a(JpegEncode.o) has no symbols gcc -o coretest coretest.o libImaging.a -lz -lm I have IJG jpeg installed in /usr/local but no matter what I do, I cannot get it to be recognized when I ./configure, make in libImaging. the configure just zooms by the config lines for JpegEncode, JpegDecode and then it fails to build the jpeg bits on make. I can install and import PIL, but it has no jpeg, which is a problem doing thumbnails and the like on webpages. If anyone has ANY ideas on what to try, please let me know. I've fiddled with configure and Makefile options and nothing seems to work. Any help would be appreciated. below is the output from the make test and make install from building jpeg. thanks for your help. -calvin [:~/Desktop/mac_osx_setupunix/jpeg-6b] calvin% make test rm -f testout* ./djpeg -dct int -ppm -outfile testout.ppm ./testorig.jpg ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp ./testorig.jpg ./cjpeg -dct int -outfile testout.jpg ./testimg.ppm ./djpeg -dct int -ppm -outfile testoutp.ppm ./testprog.jpg ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg ./testimg.ppm ./jpegtran -outfile testoutt.jpg ./testprog.jpg cmp ./testimg.ppm testout.ppm cmp ./testimg.bmp testout.bmp cmp ./testimg.jpg testout.jpg cmp ./testimg.ppm testoutp.ppm cmp ./testimgp.jpg testoutp.jpg cmp ./testorig.jpg testoutt.jpg [:~/Desktop/mac_osx_setupunix/jpeg-6b] calvin% sudo make install /usr/bin/install -c cjpeg /usr/local/bin/cjpeg /usr/bin/install -c djpeg /usr/local/bin/djpeg /usr/bin/install -c jpegtran /usr/local/bin/jpegtran /usr/bin/install -c rdjpgcom /usr/local/bin/rdjpgcom /usr/bin/install -c wrjpgcom /usr/local/bin/wrjpgcom /usr/bin/install -c -m 644 ./cjpeg.1 /usr/local/man/man1/cjpeg.1 /usr/bin/install -c -m 644 ./djpeg.1 /usr/local/man/man1/djpeg.1 /usr/bin/install -c -m 644 ./jpegtran.1 /usr/local/man/man1/jpegtran.1 /usr/bin/install -c -m 644 ./rdjpgcom.1 /usr/local/man/man1/rdjpgcom.1 /usr/bin/install -c -m 644 ./wrjpgcom.1 /usr/local/man/man1/wrjpgcom.1 [thearthole:~/Desktop/mac_osx_setupunix/jpeg-6b] calvin% sudo make install-lib /usr/bin/install -c -m 644 jconfig.h /usr/local/include/jconfig.h /usr/bin/install -c -m 644 ./jpeglib.h /usr/local/include/jpeglib.h /usr/bin/install -c -m 644 ./jmorecfg.h /usr/local/include/jmorecfg.h /usr/bin/install -c -m 644 ./jerror.h /usr/local/include/jerror.h /usr/bin/install -c -m 644 libjpeg.a /usr/local/lib/libjpeg.a From just@letterror.com Mon Sep 16 20:43:17 2002 From: just@letterror.com (Just van Rossum) Date: Mon, 16 Sep 2002 21:43:17 +0200 Subject: [Pythonmac-SIG] building pil jpeg has no symbols In-Reply-To: Message-ID: Calvin wrote: > I have IJG jpeg installed in /usr/local but no matter what I do, I cannot > get it to be recognized when I ./configure, make in libImaging. the > configure just zooms by the config lines for JpegEncode, JpegDecode and > then it fails to build the jpeg bits on make. > > I can install and import PIL, but it has no jpeg, which is a problem doing > thumbnails and the like on webpages. > > If anyone has ANY ideas on what to try, please let me know. I've fiddled > with configure and Makefile options and nothing seems to work. Any help > would be appreciated. I think I needed to fiddle with libImaging/ImConfig.h manually. Check whether it contains the following lines (and not #undef for HAVE_LIBJPEG): /* Define if you have the IJG jpeg library (-ljpeg). */ #define HAVE_LIBJPEG 1 Just From just@letterror.com Mon Sep 16 20:56:27 2002 From: just@letterror.com (Just van Rossum) Date: Mon, 16 Sep 2002 21:56:27 +0200 Subject: [Pythonmac-SIG] IDE Goes crazy.. In-Reply-To: Message-ID: Chris Lee wrote: > I'm sorry to be a pain but I just had a loverly thing happen to me > I've been using the Python IDE all day with it going fine. > I decide I want to insert a progress status dialog into my program > (since I am trying something stupid and want feedback on how stupid it > is). When I choose to browse the easy dialog module from the module > browser I get a vast output which is pasted below. > > I quit the python IDE and tried to restart but all I get is a > <> output window. I ran configureCarbon again and that got > the IDE back but the module browser still goes crazy but only on esy > dialogs (I haven't checked all the other modules though) > Is this a known issue? > What is the work around? Ugh, I see what's happening :-(. I'll have to have a good look at this, so for now I'll simply file a bug report and assign it to myself. It's fairly easy to make it not trace back, but that doesn't solve the problem. It has to do with the fact that a ListManager list can only contain 32kb of data, and when you add more, it overwrites other pieces of data. Just From just@letterror.com Mon Sep 16 21:01:58 2002 From: just@letterror.com (Just van Rossum) Date: Mon, 16 Sep 2002 22:01:58 +0200 Subject: [Pythonmac-SIG] Difflib question In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43F5ADA@ussunm001.palmsource.com> Message-ID: Robin Siebler wrote: > Is there a way to get difflib to output *only* the lines that are > different (instead of all of the lines)? Questions like this are much better asked on comp.lang.python, as it's not MacPython-specific. But I bet you'll find the answer even quicker if you read the source... Just From calvin@xmission.com Mon Sep 16 21:27:51 2002 From: calvin@xmission.com (Calvin) Date: Mon, 16 Sep 2002 14:27:51 -0600 (MDT) Subject: [Pythonmac-SIG] building pil-jpeg has no symbols Message-ID: Just van Rossum provided the following tip to correct the problem of jpeg not being built with make. : >>Here is the error at the end of libImaging/make >> >>ranlib libImaging.a >>ranlib: file: libImaging.a(Dib.o) has no symbols >>ranlib: file: libImaging.a(JpegDecode.o) has no symbols >>ranlib: file: libImaging.a(JpegEncode.o) has no symbols >>gcc -o coretest coretest.o libImaging.a -lz -lm >I think I needed to fiddle with libImaging/ImConfig.h manually. Check >whether it >contains the following lines (and not #undef for HAVE_LIBJPEG): > >/* Define if you have the IJG jpeg library (-ljpeg). */ >#define HAVE_LIBJPEG 1 > >Just I modified ImConfig.h too look like this: /* Define if you have the IJG jpeg library (-ljpeg). */ /* #undef HAVE_LIBJPEG */ #define HAVE_LIBJPEG 1 Make ran correctly but still gave this error: ranlib: file: libImaging.a(Dib.o) has no symbols I'm not sure what Dib.o relates too. Regardless, after running python setup.py build, and python setup.py install, jpeg is now usable in PIL. Thank you Just. -calvin From just@letterror.com Mon Sep 16 21:33:36 2002 From: just@letterror.com (Just van Rossum) Date: Mon, 16 Sep 2002 22:33:36 +0200 Subject: [Pythonmac-SIG] FrameWork build errors Message-ID: I'm trying to build a Framework Python from CVS and am getting oodles of tracebacks during "make" (see below). I did "make clean" before. Does anyone know what could be the problem? This is on OSX.1.5. Jack's away until oct 5... Just building '_Win' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Wno-long-double -no-cpp-precomp -fno-common -dynamic -I. -I/Users/just/code/python_cvs/./Include -I/Users/just/code/python_cvs/./Mac/Include -I/usr/local/include -I/Users/just/code/python_cvs/Include -I/Users/just/code/python_cvs -c /Users/just/code/python_cvs/Mac/Modules/win/_Winmodule.c -o build/temp.darwin-5.5-Power Macintosh-2.3/_Winmodule.o Traceback (most recent call last): File "./setup.py", line 1040, in ? main() File "./setup.py", line 1035, in main scripts = ['Tools/scripts/pydoc'] File "/Users/just/code/python_cvs/Lib/distutils/core.py", line 136, in setup dist.run_commands() File "/Users/just/code/python_cvs/Lib/distutils/dist.py", line 886, in run_commands self.run_command(cmd) File "/Users/just/code/python_cvs/Lib/distutils/dist.py", line 906, in run_command cmd_obj.run() File "/Users/just/code/python_cvs/Lib/distutils/command/build.py", line 107, in run self.run_command(cmd_name) File "/Users/just/code/python_cvs/Lib/distutils/cmd.py", line 334, in run_command self.distribution.run_command(command) File "/Users/just/code/python_cvs/Lib/distutils/dist.py", line 906, in run_command cmd_obj.run() File "/Users/just/code/python_cvs/Lib/distutils/command/build_ext.py", line 269, in run self.build_extensions() File "./setup.py", line 160, in build_extensions build_ext.build_extensions(self) File "/Users/just/code/python_cvs/Lib/distutils/command/build_ext.py", line 395, in build_extensions self.build_extension(ext) File "./setup.py", line 165, in build_extension build_ext.build_extension(self, ext) File "/Users/just/code/python_cvs/Lib/distutils/command/build_ext.py", line 468, in build_extension depends=ext.depends) File "/Users/just/code/python_cvs/Lib/distutils/ccompiler.py", line 657, in compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/Users/just/code/python_cvs/Lib/distutils/unixccompiler.py", line 111, in _compile self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + File "/Users/just/code/python_cvs/Lib/distutils/ccompiler.py", line 937, in spawn spawn (cmd, dry_run=self.dry_run) File "/Users/just/code/python_cvs/Lib/distutils/spawn.py", line 37, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/Users/just/code/python_cvs/Lib/distutils/spawn.py", line 133, in _spawn_posix exec_fn(cmd[0], cmd) File "./Lib/os.py", line 309, in execvp _execvpe(file, args) File "./Lib/os.py", line 323, in _execvpe from errno import ENOENT, ENOTDIR ImportError: No module named errno From just@letterror.com Mon Sep 16 22:04:00 2002 From: just@letterror.com (Just van Rossum) Date: Mon, 16 Sep 2002 23:04:00 +0200 Subject: [Pythonmac-SIG] FrameWork build errors In-Reply-To: Message-ID: Just van Rossum wrote: > I'm trying to build a Framework Python from CVS and am getting oodles of > tracebacks during "make" (see below). I did "make clean" before. Does anyone > know what could be the problem? This is on OSX.1.5. Jack's away until oct 5... Erm, somehow my Modules/Setup file was broken. "I never touched it, honest!" Nevermind... Just From Robin.Siebler@palmsource.com Tue Sep 17 00:13:10 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Mon, 16 Sep 2002 16:13:10 -0700 Subject: [Pythonmac-SIG] Pydoc Message-ID: <3271DBB88437ED41A0AB239E6C2554A43F5ADE@ussunm001.palmsource.com> How do I get pydoc to list my scripts (which are located in the default = Scripts directory)? Robin L. Siebler Software Test Engineer Palm --------------------------------------- Bart Simpson: What a day, eh, Milhouse? The sun is out, birds are = singing, bees are trying to have sex with them -- as is my = understanding... From Anthony Baxter Tue Sep 17 04:23:36 2002 From: Anthony Baxter (Anthony Baxter) Date: Tue, 17 Sep 2002 13:23:36 +1000 Subject: [Pythonmac-SIG] Re: [Image-SIG] building pil-jpeg has no symbols In-Reply-To: Message-ID: <200209170323.g8H3Nbm14872@localhost.localdomain> Have you stripped the library, by any chance? If so, you'll need to rebuild it - a stripped library is useless. -- Anthony Baxter It's never too late to have a happy childhood. From seanh@unforgettable.com Tue Sep 17 07:45:42 2002 From: seanh@unforgettable.com (Sean Hummel) Date: Mon, 16 Sep 2002 23:45:42 -0700 Subject: [Pythonmac-SIG] I must be missing something Message-ID: <15D033D9-CA09-11D6-9F95-003065428512@unforgettable.com> I've recently installed OSX 10.2 and have found that the python shipped with it, doesn't appear to have the Carbon module (along with the other Macintosh modules,) installed in it. Am I doing something wrong or is this the way Apple shipped it? From just@letterror.com Tue Sep 17 08:17:59 2002 From: just@letterror.com (Just van Rossum) Date: Tue, 17 Sep 2002 09:17:59 +0200 Subject: [Pythonmac-SIG] I must be missing something In-Reply-To: <15D033D9-CA09-11D6-9F95-003065428512@unforgettable.com> Message-ID: Sean Hummel wrote: > I've recently installed OSX 10.2 and have found that the python shipped > with it, doesn't appear to have the Carbon module (along with the other > Macintosh modules,) installed in it. > > Am I doing something wrong or is this the way Apple shipped it? It's the way Apple shipped it. It's a pure Unix install, no Mac stuff whatsoever. Just From just@letterror.com Tue Sep 17 08:57:14 2002 From: just@letterror.com (Just van Rossum) Date: Tue, 17 Sep 2002 09:57:14 +0200 Subject: [Pythonmac-SIG] Building NumPy for Python.framework Message-ID: I'm trying to build Numeric for a framework build of (current CVS) Python, but I'm having no luck. Here is the last bit of the output of "python setup.py build": building 'umath' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Wno-long-double -no-cpp-precomp -fno-common -dynamic -DHAVE_INVERSE_HYPERBOLIC -IInclude -IPackages/FFT/Include -IPackages/RNG/Include -I/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c Src/umathmodule.c -o build/temp.darwin-5.5-Power Macintosh-2.3/umathmodule.o Src/umathmodule.c: In function `UINT_multiply': Src/umathmodule.c:718: warning: `x' might be used uninitialized in this function Src/umathmodule.c: At top level: Src/umathmodule.c:2394: `acosh' undeclared here (not in a function) Src/umathmodule.c:2394: too many errors, bailing out error: command 'gcc' failed with exit status 1 [python:~/code/Numeric-22.0] just% The same Numeric builds just fine on a unix install. Any clues? Just From seth@jtan.com Tue Sep 17 20:05:36 2002 From: seth@jtan.com (Seth Delackner) Date: Tue, 17 Sep 2002 12:05:36 -0700 Subject: [Pythonmac-SIG] Building NumPy for Python.framework In-Reply-To: Message-ID: <72F6D977-CA70-11D6-AF41-000393873F82@jtan.com> I had this *exact* same problem until I nuked my old /usr/local/bin/python* and reinstalled from 2.2.1's release source.tar.gz, following letter for letter the instructions in the Mac/OSX/README file. Thing to remember is that installing the framework build does NOT create simlinks in /usr/local/bin, so old versions of python sitting there can screw it all up. On Tuesday, September 17, 2002, at 12:57 , Just van Rossum wrote: > I'm trying to build Numeric for a framework build of (current CVS) > Python, but I'm having no luck. Here is the last bit of the output of > "python setup.py build": > > > building 'umath' extension > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Wno-long-double > -no-cpp-precomp > -fno-common -dynamic -DHAVE_INVERSE_HYPERBOLIC -IInclude > -IPackages/FFT/Include > -IPackages/RNG/Include > -I/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c > Src/umathmodule.c -o build/temp.darwin-5.5-Power > Macintosh-2.3/umathmodule.o > Src/umathmodule.c: In function `UINT_multiply': > Src/umathmodule.c:718: warning: `x' might be used uninitialized in this > function > Src/umathmodule.c: At top level: > Src/umathmodule.c:2394: `acosh' undeclared here (not in a function) > Src/umathmodule.c:2394: too many errors, bailing out > error: command 'gcc' failed with exit status 1 > [python:~/code/Numeric-22.0] just% > > > The same Numeric builds just fine on a unix install. > > Any clues? > > Just > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From just@letterror.com Tue Sep 17 20:22:40 2002 From: just@letterror.com (Just van Rossum) Date: Tue, 17 Sep 2002 21:22:40 +0200 Subject: [Pythonmac-SIG] Building NumPy for Python.framework In-Reply-To: <72F6D977-CA70-11D6-AF41-000393873F82@jtan.com> Message-ID: Seth Delackner wrote: > I had this *exact* same problem until I nuked my old > /usr/local/bin/python* and reinstalled from 2.2.1's release > source.tar.gz, following letter for letter the instructions in the > Mac/OSX/README file. Thing to remember is that installing the framework > build does NOT create simlinks in /usr/local/bin, so old versions of > python sitting there can screw it all up. Hm, that's bad :-(. The thing is, I don't want to nuke my /usr/local/bin/python until I have the framework completely working, as I'm kindof attached to having a working command line Python with a whole bunch of 3d party extension... I guess I'll wait until Jack is back, so we can debug this problem. Hm, even better: I'll file a bug report and assign it to him... Thanks for the info. Just From just@letterror.com Tue Sep 17 20:32:39 2002 From: just@letterror.com (Just van Rossum) Date: Tue, 17 Sep 2002 21:32:39 +0200 Subject: [Pythonmac-SIG] Building NumPy for Python.framework In-Reply-To: Message-ID: Just van Rossum wrote: > Hm, even better: I'll file a bug report and assign it to him... Done: http://www.python.org/sf/610730 Just From Robin.Siebler@palmsource.com Tue Sep 17 20:39:13 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Tue, 17 Sep 2002 12:39:13 -0700 Subject: [Pythonmac-SIG] Problem installing a module Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF96F@ussunm001.palmsource.com> I downloaded a logging module for Python and uncompressed it. The icon = for all of the .py files in the folder is a blank document icon. Get = info for the .py files show they will be handled by the Python = Interpreter. However, if I double-click on setup.py, I get the = following error message: "This is not a script. It is probably an = auxiliary Python file such as an application template or a preference = file." Obviously, this is a bogus error message. How do I fix this? I = can install it just fine using the command-line version of Python, but I = need it for the GUI version. Robin L. Siebler Software Test Engineer Palm --------------------------------------- Ned Flanders: A rude Frenchman! Why I never. From just@letterror.com Tue Sep 17 20:48:25 2002 From: just@letterror.com (Just van Rossum) Date: Tue, 17 Sep 2002 21:48:25 +0200 Subject: [Pythonmac-SIG] Problem installing a module In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF96F@ussunm001.palmsource.com> Message-ID: Robin Siebler wrote: > I downloaded a logging module for Python and uncompressed it. The > icon for all of the .py files in the folder is a blank document icon. > Get info for the .py files show they will be handled by the Python > Interpreter. However, if I double-click on setup.py, I get the > following error message: "This is not a script. It is probably an > auxiliary Python file such as an application template or a preference > file." Obviously, this is a bogus error message. How do I fix this? > I can install it just fine using the command-line version of Python, > but I need it for the GUI version. It's probably the file type that is wrong. It should (for this version of MacPython, apparently) be TEXT. You can chage it with ResEdit or FileTyper or possibly many other utilities. Depending on the version of MacPython you're actually using, you might need to change the line endings to "Mac" (ie. \r). This can be done with BBEdit, or the IDE. Just From Robin.Siebler@palmsource.com Tue Sep 17 20:59:23 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Tue, 17 Sep 2002 12:59:23 -0700 Subject: [Pythonmac-SIG] Problem installing a module Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF970@ussunm001.palmsource.com> I found the fixfiletypes.py script and this did the trick. -----Original Message----- From: Just van Rossum [mailto:just@letterror.com] Sent: Tuesday, September 17, 2002 12:48 PM To: Robin Siebler Cc: pythonmac-sig@python.org Subject: Re: [Pythonmac-SIG] Problem installing a module Robin Siebler wrote: > I downloaded a logging module for Python and uncompressed it. The > icon for all of the .py files in the folder is a blank document icon. > Get info for the .py files show they will be handled by the Python > Interpreter. However, if I double-click on setup.py, I get the > following error message: "This is not a script. It is probably an > auxiliary Python file such as an application template or a preference > file." Obviously, this is a bogus error message. How do I fix this? > I can install it just fine using the command-line version of Python, > but I need it for the GUI version. It's probably the file type that is wrong. It should (for this version = of MacPython, apparently) be TEXT. You can chage it with ResEdit or = FileTyper or possibly many other utilities. Depending on the version of MacPython = you're actually using, you might need to change the line endings to "Mac" (ie. = \r). This can be done with BBEdit, or the IDE. Just From michael@looma.co.nz Tue Sep 17 21:18:02 2002 From: michael@looma.co.nz (Michael Dunstan) Date: Wed, 18 Sep 2002 08:18:02 +1200 Subject: [Pythonmac-SIG] Building NumPy for Python.framework In-Reply-To: Message-ID: <90ECE289-CA7A-11D6-A2AE-000393B53F20@looma.co.nz> On Wednesday, Sep 18, 2002, at 07:22 Pacific/Auckland, Just van Rossum wrote: > Seth Delackner wrote: > >> I had this *exact* same problem until I nuked my old >> /usr/local/bin/python* and reinstalled from 2.2.1's release >> source.tar.gz, following letter for letter the instructions in the >> Mac/OSX/README file. Thing to remember is that installing the >> framework >> build does NOT create simlinks in /usr/local/bin, so old versions of >> python sitting there can screw it all up. > > Hm, that's bad :-(. The thing is, I don't want to nuke my > /usr/local/bin/python > until I have the framework completely working, as I'm kindof attached > to having > a working command line Python with a whole bunch of 3d party > extension... > How about explicitly selecting the python you want to install it into? In other words use the full path for the executable rather than rely your shell just finding a python on your path. For example /Library/Frameworks/Python.framework/Versions/2.3/bin/python setup.py build That is what I did to get Numeric "into" my framework build of CVS python. Michael. From cjl@physics.otago.ac.nz Tue Sep 17 22:56:09 2002 From: cjl@physics.otago.ac.nz (Chris Lee) Date: Wed, 18 Sep 2002 09:56:09 +1200 Subject: [Pythonmac-SIG] Linking python to custom libraries Message-ID: <4641C788-CA88-11D6-9B96-0003937807FC@physics.otago.ac.nz> Hi, MacPython comes with numpy and its own lit BLAS libraries. I was wondering how do you configure python to link to the vBLAS libraries instead? Is it a simple configuration change or do you have to write a wrapper for it? Cheers Chris ################################# Chris Lee Physics Department Otago University PO Box 56 Dunedin New Zealand Phone ++64 3 479 7749 Fax ++64 3 479 0964 ################################# From just@letterror.com Tue Sep 17 23:03:18 2002 From: just@letterror.com (Just van Rossum) Date: Wed, 18 Sep 2002 00:03:18 +0200 Subject: [Pythonmac-SIG] Building NumPy for Python.framework In-Reply-To: <90ECE289-CA7A-11D6-A2AE-000393B53F20@looma.co.nz> Message-ID: Michael Dunstan wrote: > How about explicitly selecting the python you want to install it into? > In other words use the full path for the executable rather than rely > your shell just finding a python on your path. For example > > /Library/Frameworks/Python.framework/Versions/2.3/bin/python setup.py > build > > That is what I did to get Numeric "into" my framework build of CVS > python. I used a python in /usr/local/bin that was a symlink to exactly that. Nevertheless I just tried your suggestion and it doesn't help :-(. Just From seth@jtan.com Wed Sep 18 17:25:17 2002 From: seth@jtan.com (Seth Delackner) Date: Wed, 18 Sep 2002 09:25:17 -0700 Subject: [Pythonmac-SIG] Building NumPy for Python.framework In-Reply-To: Message-ID: <380DB90A-CB23-11D6-91D6-000393873F82@jtan.com> Hrm. I would try temporarily moving /usr/local/bin/python* to somewhere else, clean my python source tree, rebuild the framework from 2.2.1 source tar.gz, and hope. After it succeeds, you could always move the files back. From stephenm@humongous.com Wed Sep 18 19:53:17 2002 From: stephenm@humongous.com (Magladry, Stephen) Date: Wed, 18 Sep 2002 11:53:17 -0700 Subject: [Pythonmac-SIG] cross platform os.path.nornpath problem Message-ID: <151590CD351823429A7EBA135BEEAD5801ADE835@sea-horse.humongous.com> we are working on a cross platform game and I am running into a "problem" with os.path.normpath. We have decided to use Unix style relative paths within our Python code. The system, written in c++, is then responsible for the conversion to a Mac specific path for file i/o. The problem is lies within some Python code. Here is a quick example. import os print os.path.normpath( "foo/goo/file.txt" )# a unix relative path (result) >>> :foo/goo/file.txt Well, of course! "/" are valid chars in a Mac file name, so the operation worked as intended. I would have liked to have the result be "file.txt". Is there a way within Python 2.2.1 that I could do this with writing our own special normalizer? Thanks, Stephen Magladry From Robin.Siebler@palmsource.com Wed Sep 18 21:42:29 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Wed, 18 Sep 2002 13:42:29 -0700 Subject: [Pythonmac-SIG] MacPython on 10.2? Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF97B@ussunm001.palmsource.com> I haven't been paying attention to anything having to do with Mac OSX = 10.2 since I don't have it and probably won't have it for quite some = time. However, one of my co-workers just tried to install MacPython on = his 10.2 machine and the installation failed. Is this a known issue? = If so, are there any workarounds for it? Robin L. Siebler Software Test Engineer Palm --------------------------------------- Moe Szyslak: They think they're so high and mighty, just because they = never got caught driving without pants. From Robin.Siebler@palmsource.com Wed Sep 18 21:50:35 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Wed, 18 Sep 2002 13:50:35 -0700 Subject: [Pythonmac-SIG] MacPython on 10.2? Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF97C@ussunm001.palmsource.com> This is very strange. We had to run the install 4 or 5 times before it = would actually complete. -----Original Message----- From: Robin Siebler=20 Sent: Wednesday, September 18, 2002 1:42 PM To: pythonmac-sig@python.org Subject: [Pythonmac-SIG] MacPython on 10.2? I haven't been paying attention to anything having to do with Mac OSX = 10.2 since I don't have it and probably won't have it for quite some = time. However, one of my co-workers just tried to install MacPython on = his 10.2 machine and the installation failed. Is this a known issue? = If so, are there any workarounds for it? Robin L. Siebler Software Test Engineer Palm --------------------------------------- Moe Szyslak: They think they're so high and mighty, just because they = never got caught driving without pants. _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig From Robin.Siebler@palmsource.com Wed Sep 18 21:54:30 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Wed, 18 Sep 2002 13:54:30 -0700 Subject: [Pythonmac-SIG] Problems simulating command-line arguments Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF97D@ussunm001.palmsource.com> When I try to simulate command-line arguments by holding down the option = key and double-clicking on a script, I am getting the following = behavior: 1. The finder window containing the script immediately closes. I find = this *highly* annoying. Is this a known bug, or something I can turn = off? 2. 75% of the time, the interpreter launches without the dialog (where = command-line arguments can be set) appearing. 3. 25% of the time, the dialog appears and I am able to set the = command-line arguments. Robin L. Siebler Software Test Engineer Palm --------------------------------------- Monty' Burns: Get me Steven Spielberg! Waylon Smithers: He's = unavaliable. Monty' Burns: Then get me his non-union Mexican = equivalent! From Robin.Siebler@palmsource.com Wed Sep 18 22:23:41 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Wed, 18 Sep 2002 14:23:41 -0700 Subject: [Pythonmac-SIG] MacPython 10.2 Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF980@ussunm001.palmsource.com> We got MacPython to install finally, but it is still not working = properly. The IDE launches and typing "print 'Hello'" in the = interactive window works, but saving that as a script and dropping it on = the interpreter doesn't. The interpreter window opens, but it reads = *terminated* in the title. Robin L. Siebler Software Test Engineer Palm --------------------------------------- Moe Szyslak: People today are healthier and drinking less. You know, if = it wasn't for the junior high school next door, no one would even use = the cigarette machine. From Robin.Siebler@palmsource.com Wed Sep 18 22:25:22 2002 From: Robin.Siebler@palmsource.com (Robin Siebler) Date: Wed, 18 Sep 2002 14:25:22 -0700 Subject: [Pythonmac-SIG] Problems simulating command-line arguments Message-ID: <3271DBB88437ED41A0AB239E6C2554A43EF981@ussunm001.palmsource.com> I guess that I should mention that I am having *this* problem on 10.1.x >When I try to simulate command-line arguments by holding down the = option key and double- >clicking on a script, I am getting the following behavior: >1. The finder window containing the script immediately closes. I find = this *highly*=20 >annoying. Is this a known bug, or something I can turn off? >2. 75% of the time, the interpreter launches without the dialog (where = command-line=20 >arguments can be set) appearing. >3. 25% of the time, the dialog appears and I am able to set the = command-line arguments. Robin L. Siebler Software Test Engineer Palm --------------------------------------- Moe Szyslak: People today are healthier and drinking less. You know, if = it wasn't for the junior high school next door, no one would even use = the cigarette machine. From alexp@strata.com Wed Sep 18 23:15:20 2002 From: alexp@strata.com (Alexandre Parenteau) Date: Wed, 18 Sep 2002 15:15:20 -0700 Subject: [Pythonmac-SIG] MacPython on 10.2? In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF97C@ussunm001.palmsource.com> Message-ID: Hi Robin, Same thing over here. I said to Jack I think there are still weird problems with AppleEvents and MacPython 2.2.1 (CFM) on OS 10.2. Here is the work around which worked for me : Let the installer fail, go to the python folder, run ConfigurePythonCarbon manually. Alex. > This is very strange. We had to run the install 4 or 5 times before it would > actually complete. > > -----Original Message----- > From: Robin Siebler > Sent: Wednesday, September 18, 2002 1:42 PM > To: pythonmac-sig@python.org > Subject: [Pythonmac-SIG] MacPython on 10.2? > > > I haven't been paying attention to anything having to do with Mac OSX 10.2 > since I don't have it and probably won't have it for quite some time. > However, one of my co-workers just tried to install MacPython on his 10.2 > machine and the installation failed. Is this a known issue? If so, are there > any workarounds for it? > > Robin L. Siebler > Software Test Engineer > Palm > --------------------------------------- > Moe Szyslak: They think they're so high and mighty, just because they never > got caught driving without pants. > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From seth@jtan.com Thu Sep 19 01:42:51 2002 From: seth@jtan.com (Seth Delackner) Date: Wed, 18 Sep 2002 17:42:51 -0700 Subject: [Pythonmac-SIG] Problems simulating command-line arguments In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF97F@ussunm001.palmsource.com> Message-ID: My apologies! I just tried option-clicking on something and it worked just fine. I followed Tony Lownd's instructions to the letter, first installing the Aqua version of TK, then compiling 2.2.1 from source as a framework. I would suggest trying that. First make sure /usr/local/bin/python* and /Library/Frameworks/Python* are removed. I didn't do that first and old versions screwed me up with some things. Also make sure the .py file you are opening is associated with the proper application. With my method it would be "Python 6.5" On Wednesday, September 18, 2002, at 02:20 , Robin Siebler wrote: > I am having *this* problem on 10.1.5 From roz1@softhome.net Wed Sep 18 08:52:25 2002 From: roz1@softhome.net (rozita) Date: Wed, 18 Sep 2002 10:52:25 +0300 Subject: [Pythonmac-SIG] appling for....... Message-ID: <001401c25eed$41ece720$9e75d93e@alborz> This is a multi-part message in MIME format. ------=_NextPart_000_0011_01C25F01.796EB660 Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: quoted-printable Dear whom it concerns to =20 I am trying to find the algorithm of ADPCM with source of C and also = DSP. could u please do me a favour and send them to me ( of course if it is = possible) ? =20 I look forward to hearing from you . Thank in advance . =20 your faithfully rozita=20 =20 =20 ------=_NextPart_000_0011_01C25F01.796EB660 Content-Type: text/html; charset="windows-1256" Content-Transfer-Encoding: quoted-printable
  Dear whom it concerns to
 
I am = trying to find the=20 algorithm of ADPCM with source of C and  also DSP.
could u please do me a favour and send them to = me  (=20 of course if it is possible) ?
 
I look = forward to=20 hearing from you . Thank in advance .
 
your=20 faithfully
rozita 
 
 
------=_NextPart_000_0011_01C25F01.796EB660-- From bfancher@mac.com Thu Sep 19 18:13:56 2002 From: bfancher@mac.com (bill fancher) Date: Thu, 19 Sep 2002 10:13:56 -0700 Subject: [Pythonmac-SIG] cross platform os.path.nornpath problem In-Reply-To: <151590CD351823429A7EBA135BEEAD5801ADE835@sea-horse.humongous.com> Message-ID: <2E37A441-CBF3-11D6-9435-0005029E8B13@mac.com> On Wednesday, September 18, 2002, at 11:53 AM, Magladry, Stephen wrote: > we are working on a cross platform game and I am running into a > "problem" > with os.path.normpath. We have decided to use Unix style relative paths > within our Python code. The system, written in c++, is then > responsible for > the conversion to a Mac specific path for file i/o. The problem is lies > within some Python code. Here is a quick example. > > > import os > print os.path.normpath( "foo/goo/file.txt" )# a unix relative path > (result) >>> :foo/goo/file.txt > > Well, of course! "/" are valid chars in a Mac file name, so the > operation > worked as intended. I would have liked to have the result be > "file.txt". I don't see why normpath would return that even with POSIX paths. (It doesn't with the "unix python" installed in 10.2.) > there a way within Python 2.2.1 that I could do this with writing our > own > special normalizer? You should compose your paths with os.path.join: >>> import os >>> p = os.path.join('foo','goo','file.txt') >>> p ':foo:goo:file.txt' >>> os.path.normpath(p) ':foo:goo:file.txt' >>> and decompose them with os.path.split. E.g. to get "file.txt": os.path.split('foo:goo:file.txt')[-1] HTH, -- bill > > > Thanks, > > > Stephen Magladry > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From Martina@Oefelein.de Thu Sep 19 20:21:59 2002 From: Martina@Oefelein.de (Martina Oefelein) Date: Thu, 19 Sep 2002 21:21:59 +0200 Subject: [Pythonmac-SIG] cross platform os.path.nornpath problem In-Reply-To: <151590CD351823429A7EBA135BEEAD5801ADE835@sea-horse.humongous.com> Message-ID: <117F7BB8-CC05-11D6-AB64-000A27979162@Oefelein.de> Hi Stephen: > import os > print os.path.normpath( "foo/goo/file.txt" )# a unix relative path > (result) >>> :foo/goo/file.txt > > Well, of course! "/" are valid chars in a Mac file name, so the > operation > worked as intended. I would have liked to have the result be > "file.txt". Is > there a way within Python 2.2.1 that I could do this with writing our > own > special normalizer? I'm using urllib for this purpose: from urllib import url2pathname, pathname2url print os.path.normpath(url2pathname("foo/goo/file.txt")) should do the job ciao Martina From seth@jtan.com Fri Sep 20 01:02:24 2002 From: seth@jtan.com (Seth Delackner) Date: Thu, 19 Sep 2002 17:02:24 -0700 Subject: [Pythonmac-SIG] disutils link arguments BEFORE object files? Message-ID: <3E1ECC62-CC2C-11D6-9580-000393873F82@jtan.com> I'm trying to get pyopengl to compile on OS X, and a stumbling block that I had to brute force around was that a link step needed to have "-framework AGL" on the command line BEFORE the object files. The distutils extra_link_args variable is attached to the command line after everything else, so is there some way to get what I want? I would think there would be just a simple "pre_object_args" variable, considering that this is not uncommon (requiring libraries to be included before objects on the linker command line). From jburgess@cs.stanford.edu Fri Sep 20 01:13:19 2002 From: jburgess@cs.stanford.edu (Jed Burgess) Date: Thu, 19 Sep 2002 17:13:19 -0700 Subject: [Pythonmac-SIG] Building wxPython Message-ID: I have successfully built wxWindows (can run demos) and am trying to complete my installation of wxPython (on 10.1.5). I had been trying to run the demo using python (didn't realize I should be using pythonw) and I was getting the behavior described in this message from July (http://lists.wxwindows.org/pipermail/wxpython-mac/2002-July/ 000361.html) whereby Python hung and would not respond. The import would succeed, but it hung when it got to app.MainLoop(). The only output I get is: 19:48:12: Debug: /usr/local/lib/libwx_macd-2.3.rsrc When I run the demo using pythonw, the app launches, but the import fails. original argc=2 original argv[0] = "/Applications/Python.app/Contents/MacOS/python" original argv[1] = "demo/demo.py" modified argc=2 modified argv[0] = "/Applications/Python.app/Contents/MacOS/python" modified argv[1] = "demo/demo.py" Traceback (most recent call last): File "demo/demo.py", line 3, in ? import Main File "demo/Main.py", line 15, in ? from wxPython.wx import * File "/Library/Frameworks/Python.framework/Versions/2.2/lib/python2.2/site- pac kages/wxPython/__init__.py", line 20, in ? import wxc ImportError: Failure linking new module Does anyone know why python would be able to import wxPython.wx, but pythonw would not? They seem to be looking in different places, but I don't know how to get pythonw to look in the proper place (or alternatively to get the stuff the belongs in that different place there). Thank you for any help you can give. Jed From jwblist@olympus.net Fri Sep 20 06:50:34 2002 From: jwblist@olympus.net (John W Baxter) Date: Thu, 19 Sep 2002 22:50:34 -0700 Subject: [Pythonmac-SIG] Problems simulating command-line arguments In-Reply-To: <3271DBB88437ED41A0AB239E6C2554A43EF97D@ussunm001.palmsource.com> References: <3271DBB88437ED41A0AB239E6C2554A43EF97D@ussunm001.palmsource.com> Message-ID: At 13:54 -0700 9/18/2002, Robin Siebler wrote: >When I try to simulate command-line arguments by holding down the option >key and double-clicking on a script, I am getting the following behavior: > >1. The finder window containing the script immediately closes. I find >this *highly* annoying. Is this a known bug, or something I can turn off? It's how Finder works and has worked for many years (to sometime in the mid 1980s, I think). It does get in the way of using the Option key for things like this. The key is to hit Option late enough so Finder doesn't see it, but early enough that the application does...there's a fair amount of room, see below. >2. 75% of the time, the interpreter launches without the dialog (where >command-line arguments can be set) appearing. >3. 25% of the time, the dialog appears and I am able to set the >command-line arguments. I don't know for sure, but here's a guess: you aren't holding down Option long enough, and by the time the code is loaded and has a chance to look at the modifier keys, the Option key is up. That's what happens in non-Pythonic venues...there's a good chance it does here, too. It's been a few years since I needed to deal with command line arguments in MacPython. Unfortunately, this is essentially an unteachable skill in the world of programs for distribution, so you need to do something else in that world. It's not hard to learn for yourself. --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From Chris.Barker@noaa.gov Sat Sep 21 00:19:08 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Fri, 20 Sep 2002 16:19:08 -0700 Subject: [Pythonmac-SIG] mxDateTime for MacPython 2.1 (Classic and Carbon would be nice) References: <3271DBB88437ED41A0AB239E6C2554A43EF97D@ussunm001.palmsource.com> Message-ID: <3D8BACEC.A980F6EB@noaa.gov> Hi all, Has anyone got the various mxTools compiled for MacPython? I only need mxDateTime at the moment, but the other stuff in mxBase would be nice too. I have a copy mxDateTime compiled for MacPython 2.0, but not for later versions. I've tried compiling it myself with CodeWarrior 4.0, with which I've compiled a number of my own extensions, but I get errors I can't figure out. I'm pretty hopeless with MacOs and a total Newbie with CodeWarrior, so any suggestions there would be great (and who thought "./configure, make, make install" was tough! ) Oh for the day when I can make the full transition to OS-X!! Anyway, my CodeWarrior problem is: Link Error: Undefined 'floor' (code) Referenced from 'mxDateTime_FromGMTicks' in mxDateTime.c etc... "floor" should be in the math libraries somewhere, but I can't figure out what to link against to find it. I'm currently linked against: MSL ShLibRuntiime.lib PythonCore I imagine all I have to do is add the right math library to the libraries list, but I can't figure out which one. Any help appreciated... -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From gherman@darwin.in-berlin.de Sun Sep 22 10:08:10 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Sun, 22 Sep 2002 11:08:10 +0200 Subject: [Pythonmac-SIG] Compiling Biggles without X11? Message-ID: Hi, has anybody succeeded in compiling Biggles(.sf.net), a chart library on top of GNU plotutils and NumPy on OS X? I get compile errors b/c I have no X11 on my box... but I don't quite see why X11 should be mandatory, except for some X11 bitmap formats/libraries, maybe. Dinu -- Dinu C. Gherman ...................................................................... "The first principle is that you must not fool yourself - and you are the easiest person to fool." (Richard Feynman) From buro@petr.com Mon Sep 23 14:34:35 2002 From: buro@petr.com (Petr van Blokland) Date: Mon, 23 Sep 2002 15:34:35 +0200 Subject: [Pythonmac-SIG] _renderPM.so for Jaguar Message-ID: <3D8F186B.C4857389@petr.com> LS Did anyone manage to build _renderPM.so for Jaguar already? Kind reagards, Petr van Blokland buro@petr.com -- buro@petr.com www.petr.com Petr van Blokland From daniel_t@earthlink.net Mon Sep 23 14:51:50 2002 From: daniel_t@earthlink.net (Daniel) Date: Mon, 23 Sep 2002 09:51:50 -0400 Subject: [Pythonmac-SIG] What IDE to use? In-Reply-To: <3D8F186B.C4857389@petr.com> References: <3D8F186B.C4857389@petr.com> Message-ID: I've managed to install MachoPython but I miss the IDE that comes with MacPython. Is there a different IDE that I should switch to, or can I get the MacPythonIDE to work with MachoPython? From gherman@darwin.in-berlin.de Mon Sep 23 18:55:13 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Mon, 23 Sep 2002 19:55:13 +0200 Subject: [Pythonmac-SIG] Jaguar compiling issues (Was:_renderPM.so for Jaguar) In-Reply-To: <3D8F186B.C4857389@petr.com> Message-ID: <9C370824-CF1D-11D6-8BFC-00039345C610@darwin.in-berlin.de> Petr van Blokland: > Did anyone manage to build _renderPM.so for Jaguar already? I'm pretty sure this has to do with some library changes, as it has been mentioned already several times here. I'd be glad if someone knowledgable would explain which changes and how to solve this problem in general, once and for all? One other affected package is readline 4.3 (4.2 compiles well). Regards, Dinu PS: Concerning _renderPM, you can find a pre-10.2 build here: ftp://ftp.reportlab.com/_renderPM-jag.so -- Dinu C. Gherman ...................................................................... "I'll let you be in my dream if I can be in yours." (Bob Dylan) From gherman@darwin.in-berlin.de Tue Sep 24 07:41:58 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Tue, 24 Sep 2002 08:41:58 +0200 Subject: [Pythonmac-SIG] Jaguar compiling issues (Was:_renderPM.so for Jaguar) In-Reply-To: <9C370824-CF1D-11D6-8BFC-00039345C610@darwin.in-berlin.de> Message-ID: I wrote on pythonmac-sig@python.org: > I'm pretty sure this has to do with some library changes, as it > has been mentioned already several times here. I'd be glad if > someone knowledgable would explain which changes and how to > solve this problem in general, once and for all? Here you might get an idea of what the problem (compiling modules on Mac OS 10.2) could be: http://www.osxgnu.org/#jagbugs I have no clue how to fix distutils to reflect this, though (and/or if this s possible at all)... Anybody else who could speak up? Dinu CC to the distutils list. -- Dinu C. Gherman ...................................................................... "There are causes worth dying for, but none worth killing for." (Albert Camus) From brian_l@mac.com Tue Sep 24 08:50:44 2002 From: brian_l@mac.com (Brian Lenihan) Date: Tue, 24 Sep 2002 00:50:44 -0700 Subject: [Pythonmac-SIG] Jaguar compiling issues (Was:_renderPM.so for Jaguar) In-Reply-To: Message-ID: <54B8D17A-CF92-11D6-9E6C-003065F88956@mac.com> On Monday, September 23, 2002, at 11:41 PM, Dinu Gherman wrote: > I wrote on pythonmac-sig@python.org: > >> I'm pretty sure this has to do with some library changes, as it >> has been mentioned already several times here. I'd be glad if >> someone knowledgable would explain which changes and how to >> solve this problem in general, once and for all? > > Here you might get an idea of what the problem (compiling modules > on Mac OS 10.2) could be: > > http://www.osxgnu.org/#jagbugs This is a separate issue from what you originally posted to the pythonmac-sig. Apple's autoconf is indeed broken, but I hadn't seen it because I'm using Fink's version. The proposed fix from osxgnu os not quite right, it should be: exit (setpgrp (1,1) == -1 ? 0 : 1);])] distutils should not have to work around a vendor's broken autoconf. Apple needs to fix this. > I have no clue how to fix distutils to reflect this, though (and/or > if this s possible at all)... Anybody else who could speak up? > > Dinu > > CC to the distutils list. > > -- > Dinu C. Gherman > ...................................................................... > "There are causes worth dying for, but none worth killing for." > (Albert Camus) > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From gherman@darwin.in-berlin.de Tue Sep 24 09:25:11 2002 From: gherman@darwin.in-berlin.de (Dinu Gherman) Date: Tue, 24 Sep 2002 10:25:11 +0200 Subject: [Pythonmac-SIG] Jaguar compiling issues (Was:_renderPM.so for Jaguar) In-Reply-To: <54B8D17A-CF92-11D6-9E6C-003065F88956@mac.com> Message-ID: <246FCEEA-CF97-11D6-A7F1-00039345C610@darwin.in-berlin.de> Brian Lenihan: > http://www.osxgnu.org/#jagbugs > > This is a separate issue from what you originally posted to the > pythonmac-sig. Apple's autoconf is indeed broken, but I hadn't seen > it because I'm using Fink's version. This is what I meant, just down a few lines on that page: What has changed in 10.2? The biggest changes seem to be that the System linked libraries in OS X have moved to separate libraries so the LDFLAGS and CFLAGS have to be set. The most common new settings are: CFLAGS=-no-cpp-precomp LDFLAGS=-ltinfo -lgcc ( setenv CFLAGS -no-cpp-precomp;setenv LDFLAGS '-ltinfo -lgcc') If a program did not use any of libraries that were moved it still works on 10.2. Example :bzip2, gnutar, rpm etc. Dinu -- Dinu C. Gherman ...................................................................... "I tremble for my country when I reflect that God is just, that His justice will not sleep forever." (Thomas Jefferson) From andrew.straw@adelaide.edu.au Wed Sep 25 08:59:57 2002 From: andrew.straw@adelaide.edu.au (Andrew Straw) Date: Wed, 25 Sep 2002 17:29:57 +0930 Subject: [Pythonmac-SIG] Compiling Biggles without X11? In-Reply-To: Message-ID: On Sunday, September 22, 2002, at 06:38 PM, Dinu Gherman wrote: > Hi, > > has anybody succeeded in compiling Biggles(.sf.net), a chart library > on top of GNU plotutils and NumPy on OS X? I get compile errors b/c > I have no X11 on my box... but I don't quite see why X11 should be > mandatory, except for some X11 bitmap formats/libraries, maybe. Biggles is working just fine on my 10.2.1 system (no X11) with python 2.3a0 from cvs. I installed plotutils-2.4.1, which IIRC compiled just fine with ./configure, make, sudo make install. Then I added the following to Biggles's setup.py, which allowed it to be built and installed without problems: elif sys.platform == "darwin": libplot_prefix = "/usr/local" libplot_include_dirs = [libplot_prefix+"/include"] libplot_library_dirs = [libplot_prefix+"/lib"] libplot_libraries = ["plot"] The show() method is not working (I think that depends on X11), but write_eps() works fine. Andrew From fgranger@altern.org Wed Sep 25 16:44:08 2002 From: fgranger@altern.org (Francois Granger) Date: Wed, 25 Sep 2002 17:44:08 +0200 Subject: [Pythonmac-SIG] AppleEvent Message-ID: I am trying some AppleEvent in Python (v2.2.1 on MacOS 9.1). Basically, I want to iterate throught all the messages in one folder, and get some items of each message such as 'From', 'Received: ... I tested the following AppleScript with ScriptEditor tell application "Microsoft Entourage" set theList to messages of folder "Spam" repeat with m in theList set txt to headers of m end repeat end tell I am now trying to convert it to Python. I read the doc. Created the Entourage folder inside the lib-Scriptpackabes folder. I read th archives o= f the list, no idea how to do it. Id did the simple test code: import Entourage #talker =3D Entourage.Entourage() #talker.activate() fld =3D Entourage.folder("Spam") wnd =3D Entourage.windows(fld) #messlist =3D wnd.content() messlist =3D Entourage.current_messages(fld) #messlist =3D talker.get(Entourage.message(fld)) for mess in messlist: headers =3D mess.headers() 1) With line 2 and 3 uncommented I get the following traceback. Traceback (most recent call last): File "Macintosh HD:Dev:spam:asentourage.py", line 3, in ? talker.activate() File "Macintosh HD:Python 2.2:Mac:Lib:aetools.py", line 195, in activate self.send('misc', 'actv') File "Macintosh HD:Python 2.2:Mac:Lib:lib-scriptpackages:Entourage:Entourage_Mail_and_News_Sui.py", line 53, in send _arguments, _attributes) TypeError: send() takes at most 3 arguments (5 given) 2) Line 7 give me a proper object, not iterable. I tried a lot of other combination, but I guess I did understood nothing to what was recently discussed about verbs and attributes ;-) --=20 Fran=E7ois Granger fgranger@altern.org From fig@monitor.net Wed Sep 25 18:29:33 2002 From: fig@monitor.net (Stephen R. Figgins) Date: Wed, 25 Sep 2002 12:29:33 -0500 Subject: [Pythonmac-SIG] Jaguar Macho Build woes Message-ID: I am following Tony Lownds instructions for Macho Python + Tkinter and compiling on Jaguar. But Python.app doesn't launch. It starts to, then stops. I also notice I am missing some shared object files. Most importantly, _socket. Any idea what's going on? -Stephen From fig@monitor.net Wed Sep 25 18:34:05 2002 From: fig@monitor.net (Stephen R. Figgins) Date: Wed, 25 Sep 2002 12:34:05 -0500 Subject: [Pythonmac-SIG] Re: Jaguar Macho Build woes Message-ID: Oops... Looks like I botched my copy of Idle, it's launching now. Still don't know why I have no _socket though. -Stephen From daniel_t@earthlink.net Wed Sep 25 18:34:55 2002 From: daniel_t@earthlink.net (Daniel) Date: Wed, 25 Sep 2002 13:34:55 -0400 Subject: [Pythonmac-SIG] Jaguar Macho Build woes In-Reply-To: References: Message-ID: At 12:29 PM -0500 09/25/02, Stephen R. Figgins wrote: >I am following Tony Lownds instructions for Macho Python + Tkinter and >compiling on Jaguar. > >But Python.app doesn't launch. It starts to, then stops. > >I also notice I am missing some shared object files. Most importantly, >_socket. > >Any idea what's going on? This may be way too simple minded but, dose Python.app output anything to your Console? What line endings are on the .py file you are using to launch Python.app with? From Chris.Barker@noaa.gov Wed Sep 25 18:31:57 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Wed, 25 Sep 2002 10:31:57 -0700 Subject: [Pythonmac-SIG] mxDateTime for MacPython 2.1 (Classic andCarbon would be nice) References: <3271DBB88437ED41A0AB239E6C2554A43EF97D@ussunm001.palmsource.com> <3D8BACEC.A980F6EB@noaa.gov> Message-ID: <3D91F30C.945B5229@noaa.gov> Vincent Marchetti wrote: > Chris Barker wrote: > >Has anyone got the various mxTools compiled for MacPython? I only need > >mxDateTime at the moment, but the other stuff in mxBase would be nice > >too. > I am enclosing shared library I use with Python 2.2; thanks, that might be helpful, but I also need a version for Python 2.1 (Classic). >I compile this with the following files in my CodeWarrior > project: > > MSL_ShLibRuntime_PPC.Lib > CarbonLib (stub) > PythonCoreCarbon (stub) > mxDateTime.c I have: mxDateTime.c MSL ShLibRuntime.Lib PythonCore I'm making a classic version, so I shouldn't need the Carbon stuff, but I get the follwoing errors: Link Error : undefined 'floor' (code) Referenced from 'mxDateTime_FromGMTicks' in mxDateTime.c Referenced from 'mxDateTime_FromAbsDays' in mxDateTime.c Referenced from 'mxDateTime_AsString' in mxDateTime.c Referenced from 'mxDateTime_FromTicks' in mxDateTime.c Referenced from 'mxDateTime_CalcTicks' in mxDateTime.c Referenced from 'mxDateTime_AsTicksWithOffset' in mxDateTime.c Referenced from 'mxDateTime_TimeString' in mxDateTime.c Referenced from 'mxDateTimeDelta_AsString' in mxDateTime.c Anyone have any idea how to solve this?? It sure looks like a mathlib problem, but I have no idea what to include. From lsloan@umich.edu Thu Sep 26 17:21:38 2002 From: lsloan@umich.edu (Lance E Sloan) Date: Thu, 26 Sep 2002 12:21:38 -0400 Subject: [Pythonmac-SIG] Jaguar Macho Build woes In-Reply-To: References: Message-ID: <3502622.1033042898@[10.0.1.38]> --On Wednesday, September 25, 2002 12:29 -0500 "Stephen R. Figgins" wrote: > I am following Tony Lownds instructions for Macho Python + Tkinter and > compiling on Jaguar. Isn't it fun? :) When I followed his instructions, I couldn't get it to build without an X11 package (like XDarwin) installed. I didn't want to install X11. I emailed Tony and he suggested that I download the latest source release of Tcl/Tk (8.4.0) and build the frameworks myself, rather than using the pre-release versions (8.4a4) of the binaries that are available. Tony forwarded some instructions from the Mac TCL mailing list (tcl-mac@lists.sourceforge.net) for building the frameworks. I did that, then I followed Tony's instructions from step three onward and I've ended up with a working Python.app with IDLE. The problem I've had is that if I run this new Python interpreter from a Terminal shell prompt, when I use Tkinter to open a Tk window, if I try to click on that window, I get an error, "SetFrontProcess failed,-606". Tony said this is happening a lot. He suggested I use pythonw, which didn't build for me and I haven't figured out how to do it yet, or try Python 2.3 which "automagically" builds a Mac IDE for Python and apparently doesn't have this problem. I haven't had time to try that yet. -- Lance E Sloan Web Services, Univ. of Michigan: Full-service Web and database design, development, and hosting. Specializing in Python & Perl CGIs. http://websvcs.itd.umich.edu/ - "Putting U on the Web" From kp87@lycos.com Thu Sep 26 18:38:37 2002 From: kp87@lycos.com (kevin parks) Date: Thu, 26 Sep 2002 13:38:37 -0400 Subject: [Pythonmac-SIG] Macho Build woes Message-ID: >> Macho Build woes I hear you brother. I too, was an overly hunky programmer. The whispers, the stares, just terrible. No one likes a mimbo hacker. I am sure that abandoning your exercise regiment and adopting a programmer's diet, will help you in your quest to be taken seriously as a python programmer. Get rid of that beefy look and get on the proper diet. Lots of coffee, sandwiches, pizza, cheese (anything with the word cheese in it: Cheese nips, cheese doodles, grilled cheese, cheesewiz) and just about anything that comes from a vending machine. I promise you, your excessively attractive body will be appropriately flabby (like mine) in no time and you will be 100% pure pocket-protector geek. good luck in your quest! -kevin-- ____________________________________________________________ Tired of all the SPAM in your inbox? Switch to LYCOS MAIL PLUS http://www.mail.lycos.com/brandPage.shtml?pageId=plus From apicard@adobe.com Thu Sep 26 21:28:34 2002 From: apicard@adobe.com (Antoine Picard) Date: Thu, 26 Sep 2002 13:28:34 -0700 Subject: [Pythonmac-SIG] MacPython on X.2.1 Message-ID: --============_-1179050381==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Hi! I have been developing a mac program that embeds python. On X.1.5 everything seems to be fine. However, on another system running X.2.1, I ran into the problem that is described on the mac python web page about the installer "failing with an empty window with a <> titlebar". I followed the instructions and was able to get the python interpreter to run (after a restart) but both my tool and a trivial python script (hello world) lead to the <> window also. I have noticed that the tool actually brings up its UI if I run my program inside the CW debugger but, in that case, I have double apple, file and edit menus in the menubar. Are any of these attributable to known MacPython/X.2.1 issues? Any input would be very appreciated. -- Antoine Picard Font Tools Group, Type Department Adobe Systems Inc. W12-320 345 Park Ave San Jose, CA (408) 536-3508 --============_-1179050381==_ma============ Content-Type: text/html; charset="us-ascii" MacPython on X.2.1
Hi!
I have been developing a mac program that embeds python.
On X.1.5 everything seems to be fine. However, on another system running X.2.1, I ran into the problem that is described on the mac python web page about  the installer "failing with an empty window with a <<Terminated>> titlebar". I followed the instructions and was able to get the python interpreter to run (after a restart) but both my tool and a trivial python script (hello world) lead to the <<Terminated>> window also.
I have noticed that the tool actually brings up its UI if I run my program inside the CW debugger but, in that case, I have double apple, file and edit menus in the menubar.

Are any of these attributable to known MacPython/X.2.1 issues? Any input would be very appreciated.


-- 

                        Antoine Picard
                  Font Tools Group, Type Department
                       Adobe Systems Inc.
                      W12-320 345 Park Ave
                    San Jose, CA
                    (408) 536-3508
--============_-1179050381==_ma============-- From owen@astro.washington.edu Thu Sep 26 23:08:58 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Thu, 26 Sep 2002 16:08:58 -0600 Subject: [Pythonmac-SIG] Jaguar Macho Build woes Message-ID: Stephen R. Figgins wrote: >I am following Tony Lownds instructions for Macho Python + Tkinter and >compiling on Jaguar...I am missing some shared object files. Most >importantly, _socket. I'm seeing the same thing. I did the standard unix build (after installing ReadLines 4.2 and Tcl/Tk 8.something (3 or 4, I don't recall which at the moment). It all seemed to build OK, though I may have missed some error messages. The result seems just fine except no _socket. I have no idea how to fix it. I spent days just getting that that point. It's painful, since I am developing a Python networked GUI. Barring a solution, I'm planning to wait for fink to be updated to 10.2 or for Python 2.3. -- Russell From jhrsn@pitt.edu Fri Sep 27 04:03:45 2002 From: jhrsn@pitt.edu (Jim Harrison) Date: Thu, 26 Sep 2002 23:03:45 -0400 Subject: [Pythonmac-SIG] MacPython on X.2.1 -- argc/argv option In-Reply-To: Message-ID: > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3115926227_43471 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable on 9/26/02 4:28 PM, Antoine Picard at apicard@adobe.com wrote: However, on another system running X.2.1, I ran into the problem that = is described on the mac python web page about the installer "failing with an empty window with a <> titlebar". I followed the instructions and was able to get the python interpreter to run (after a restart) but both my tool and a trivial python script (hello world) = lead to the <> window also. Same here. If I "Disable argc/argv emulation" in EditPythonPrefs, the interactive interpreter runs fine, but of course you can't drag/drop or double-click scripts. If argc/argv emulation is not disabled, = everything terminates immediately with the <> window, including starting the interactive interpreter. Oddly, I have gotten drag/drop scripts to work intermittently with a subset of scripts, but I'm not able to relate this to any particular setting. On another topic, note also that X.2.1 apparently doesn't by default = set up a /usr/local/bin directory. This is confusing to BBedit, which tries to call python at that location when you run code from the shebang = menu. If you create the directory and put a link to python in it, BBedit will run python code from the editor again, using unix python as the interpreter. Jim Harrison Univ of Pittsburgh --B_3115926227_43471 Content-type: text/html; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Re: [Pythonmac-SIG] MacPython on X.2.1 -- argc/argv = option on 9/26/02 4:28 PM, Antoine Picard at = apicard@adobe.com wrote:

However, on another system = running X.2.1, I ran into the problem that is described on the mac = python web page about  the installer "failing with an empty window = with a <<Terminated>> titlebar". I followed the instructions and was able to = get the python interpreter to run (after a restart) but both my tool = and a trivial python script (hello world) lead to the = <<Terminated>> window also.

Same here. If I “Disable argc/argv emulation” in = EditPythonPrefs, the interactive interpreter runs fine, but of course = you can’t drag/drop or double-click scripts. If argc/argv = emulation is not disabled, everything terminates immediately with the = <<Terminated>> window, including starting the interactive = interpreter. Oddly, I have gotten drag/drop scripts to work = intermittently with a subset of scripts, but I’m not able to = relate this to any particular setting.

On another topic, note also that X.2.1 apparently doesn’t by = default set up a /usr/local/bin directory. This is confusing to BBedit, = which tries to call python at that location when you run code from the = shebang menu. If you create the directory and put a link to python in = it, BBedit will run python code from the editor again, using unix = python as the interpreter.

Jim Harrison
Univ of Pittsburgh
--B_3115926227_43471-- From calvin@xmission.com Fri Sep 27 05:26:06 2002 From: calvin@xmission.com (Calvin) Date: Thu, 26 Sep 2002 22:26:06 -0600 (MDT) Subject: [Pythonmac-SIG] Jaguar Macho Build woes In-Reply-To: from "Russell E Owen" at Sep 26, 2002 04:08:58 PM Message-ID: > >I am following Tony Lownds instructions for Macho Python + Tkinter and > >compiling on Jaguar...I am missing some shared object files. Most > >importantly, _socket. I discovered this problem when I built python on 10.2. Luckily I had made a copy of the default install. I just copied it from "/python_default_install/lib/python2.2/lib-dynload" to "/usr/local/lib/python2.2/lib-dynload/" If you don't have it and want it, you should be able to get it here: http://thearthole.net/pythonstuff/ I just downloaded the tar and replaced the one in my "/usr/local/lib/python2.2/lib-dynload/" directory. It works for my cgi's anyway. In keeping with the gpl, you may find all the sources here: http://www.python.org -calvin From alczj@yahoo.es Fri Sep 27 08:43:16 2002 From: alczj@yahoo.es (=?iso-8859-1?q?Alfonso=20Baciero?=) Date: Fri, 27 Sep 2002 09:43:16 +0200 (CEST) Subject: [Pythonmac-SIG] Re: AppleEvent Message-ID: <20020927074316.84161.qmail@web12805.mail.yahoo.com> > Id did the simple test code: > > import Entourage > #talker = Entourage.Entourage() > #talker.activate() > fld = Entourage.folder("Spam") > wnd = Entourage.windows(fld) > #messlist = wnd.content() > messlist = Entourage.current_messages(fld) > #messlist = talker.get(Entourage.message(fld)) > for mess in messlist: > headers = mess.headers() > > > 1) With line 2 and 3 uncommented I get the following traceback. > > [...] The problem about point 1) is that class Entourage_Mail_and_News_Sui_Events (in the file "Entourage_Mail_and_News_Sui.py" in the folder Entourage) defines a method called send. This method overloads the method send in class TalkTo: In file "Entourage_Mail_and_News_Sui.py" : [...] class Entourage_Mail_and_News_Sui_Events: [...] def send(self, _object=None, _attributes={}, **_arguments): [...] A hack is to change the name of the method in class Entourage_Mail_and_News_Sui_Events, for example, instead of "send", "sendmessage", Alfonso. _______________________________________________________________ Yahoo! Messenger Nueva versión: Webcam, voz, y mucho más ¡Gratis! Descárgalo ya desde http://messenger.yahoo.es From mwh@python.net Fri Sep 27 09:35:50 2002 From: mwh@python.net (Michael Hudson) Date: 27 Sep 2002 09:35:50 +0100 Subject: [Pythonmac-SIG] Jaguar Macho Build woes In-Reply-To: Russell E Owen's message of "Thu, 26 Sep 2002 16:08:58 -0600" References: Message-ID: <2m1y7fu8wp.fsf@starship.python.net> Russell E Owen writes: > Stephen R. Figgins wrote: > >I am following Tony Lownds instructions for Macho Python + Tkinter and > >compiling on Jaguar...I am missing some shared object files. Most > >importantly, _socket. > > I'm seeing the same thing. I did the standard unix build (after > installing ReadLines 4.2 and Tcl/Tk 8.something (3 or 4, I don't > recall which at the moment). It all seemed to build OK, though I may > have missed some error messages. The result seems just fine except no > _socket. I have no idea how to fix it. This is awfully hard to diagnose. What happens when setup.py tries to build _socket? Cheers, M. -- That one is easily explained away as massively intricate conspiracy, though. -- Chris Klein, alt.sysadmin.recovery From fgranger@altern.org Fri Sep 27 12:26:56 2002 From: fgranger@altern.org (Francois Granger) Date: Fri, 27 Sep 2002 13:26:56 +0200 Subject: [Pythonmac-SIG] Re: AppleEvent In-Reply-To: <20020927074316.84161.qmail@web12805.mail.yahoo.com> References: <20020927074316.84161.qmail@web12805.mail.yahoo.com> Message-ID: At 9:43 +0200 27/09/02, in message [Pythonmac-SIG] Re: AppleEvent, Alfonso Baciero wrote: > > > > 1) With line 2 and 3 uncommented I get the following traceback. >> >A hack is to change the name of the method in class >Entourage_Mail_and_News_Sui_Events, for example, >instead of "send", "sendmessage", Thanks for this solution. I'll test it. Since I was going crazy with the Eudora one as well, I have been testing the OSAm module. It works well. The only thing is that I am afraid that it may be slow. From lsloan@umich.edu Fri Sep 27 14:06:32 2002 From: lsloan@umich.edu (Lance E Sloan) Date: Fri, 27 Sep 2002 09:06:32 -0400 Subject: [Pythonmac-SIG] Fwd: Re: Jaguar Macho Build woes Message-ID: <4802175.1033117592@[10.0.1.44]> Bob Ippolito sent me the following message about how to make a simple pythonw script for Mac OS X. In a later message he recommended to me that I really should try using Python 2.3 rather than 2.2. While 2.3 is bleeding edge, it has a lot of improvements for OS X. ---------- Forwarded Message ---------- Date: Thursday, September 26, 2002 13:24 -0400 From: Bob Ippolito To: Lance E Sloan Subject: Re: [Pythonmac-SIG] Jaguar Macho Build woes On Thursday, September 26, 2002, at 12:21 PM, Lance E Sloan wrote: > --On Wednesday, September 25, 2002 12:29 -0500 "Stephen R. Figgins" > wrote: >> I am following Tony Lownds instructions for Macho Python + Tkinter and >> compiling on Jaguar. > > Isn't it fun? :) > > When I followed his instructions, I couldn't get it to build without > an X11 package (like XDarwin) installed. I didn't want to install > X11. I emailed Tony and he suggested that I download the latest > source release of Tcl/Tk (8.4.0) and build the frameworks myself, > rather than using the pre-release versions (8.4a4) of the binaries > that are available. > > Tony forwarded some instructions from the Mac TCL mailing list > (tcl-mac@lists.sourceforge.net) for building the frameworks. I did > that, then I followed Tony's instructions from step three onward and > I've ended up with a working Python.app with IDLE. > > The problem I've had is that if I run this new Python interpreter from > a Terminal shell prompt, when I use Tkinter to open a Tk window, if I > try to click on that window, I get an error, "SetFrontProcess > failed,-606". Tony said this is happening a lot. He suggested I use > pythonw, which didn't build for me and I haven't figured out how to do > it yet, or try Python 2.3 which "automagically" builds a Mac IDE for > Python and apparently doesn't have this problem. I haven't had time > to try that yet. This is a "feature" of the Mac OS X window server. pythonw is a script that looks like: # !/bin/sh exec "/Library/Frameworks/../../Library/Frameworks/Python.framework/ Versions/2.3/Resources/Python.app/Contents/MacOS/python" "$@" Basically, WindowServer *will not* give you an opportunity to create windows that can respond to events unless the process is started with a /Full/Path/To/The/Executable (and a few other conditions).. Doesn't make a whole lot of sense, but that's how it is. using pythonw makes certain that your command line starts python with a full executable path (where your shell will not, the argv[0] will be more or less whatever you typed, not where it actually is). -bob ---------- End Forwarded Message ---------- -- Lance E Sloan Web Services, Univ. of Michigan: Full-service Web and database design, development, and hosting. Specializing in Python & Perl CGIs. http://websvcs.itd.umich.edu/ - "Putting U on the Web" From owen@astro.washington.edu Fri Sep 27 16:57:26 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Fri, 27 Sep 2002 09:57:26 -0600 Subject: [Pythonmac-SIG] Jaguar Macho Build woes In-Reply-To: <2m1y7fu8wp.fsf@starship.python.net> References: <2m1y7fu8wp.fsf@starship.python.net> Message-ID: At 9:35 AM +0100 9/27/02, Michael Hudson wrote: >Russell E Owen writes: > >> Stephen R. Figgins wrote: >> >I am following Tony Lownds instructions for Macho Python + Tkinter and >> >compiling on Jaguar...I am missing some shared object files. Most >> >importantly, _socket. >> >> I'm seeing the same thing. I did the standard unix build (after >> installing ReadLines 4.2 and Tcl/Tk 8.something (3 or 4, I don't >> recall which at the moment). It all seemed to build OK, though I may >> have missed some error messages. The result seems just fine except no >> _socket. I have no idea how to fix it. > >This is awfully hard to diagnose. What happens when setup.py tries to >build _socket? I didn't save the output from my build, so I have no idea--I didn't realize anything had gone wrong until I tried to use the socket module and it failed to import with an error that _socket did not exist. However, Stephen R. Figgins sent me the explanation of what's wrong and how to fix it. I suspect he also sent it to MacPython (I get the digest and so may not have seen it yet), but if not, I'll try to get permission to do so. -- Russell From owen@astro.washington.edu Fri Sep 27 17:00:11 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Fri, 27 Sep 2002 10:00:11 -0600 Subject: [Pythonmac-SIG] Jaguar Macho Build woes Message-ID: Correction: the person who sent me instructions for getting _socket to build was Brian Lenihan. My deepest apologies for being careless and for wasting bandwidth. -- Russell From owen@astro.washington.edu Fri Sep 27 19:29:28 2002 From: owen@astro.washington.edu (Russell E Owen) Date: Fri, 27 Sep 2002 12:29:28 -0600 Subject: [Pythonmac-SIG] Compiling MachoPython 2.2.1 on Jaguar: _socket Message-ID: Brian Lenihan kindly gave me permission to post his fix. This patch is NOT needed in the upcoming Python versions 2.2.2 and 2.3. Brian also said that he personally uses Python 2.3 from CVS. -- Russell ----- email from Brian Lenihan, posted with permission ----- There is a work-around for an OS X bug in the socketmodule which is no longer needed and prevents the socketmodule from compiling. line 216 of Modules/socketmodule.c: #ifdef __APPLE__ /* On OS X, getaddrinfo returns no error indication of lookup failure, so we must use the emulation instead of the libinfo implementation. Unfortunately, performing an autoconf test for this bug would require DNS access for the machine performing the configuration, which is not acceptable. Therefore, we determine the bug just by checking for __APPLE__. If this bug gets ever fixed, perhaps checking for sys/version.h would be appropriate, which is 10/0 on the system with the bug. */ /*#undef HAVE_GETADDRINFO*/ /* avoid clashes with the C library definition of the symbol. */ /*#define getaddrinfo fake_getaddrinfo*/ #endif You can delete the whole section, or comment out the #undef and the #define as long as you don't nest the comments. I've found it is prudent to run make again after a Python build to see if any modules failed to compile. From fig@monitor.net Fri Sep 27 20:06:14 2002 From: fig@monitor.net (Stephen R. Figgins) Date: Fri, 27 Sep 2002 14:06:14 -0500 Subject: [Pythonmac-SIG] Jaguar Macho Build woes In-Reply-To: <2m1y7fu8wp.fsf@starship.python.net> Message-ID: On 9/27/02 3:35 AM, "Michael Hudson" wrote: > > This is awfully hard to diagnose. What happens when setup.py tries to > build _socket? It didn't even try. The default modules/Setup file didn't say to build it. You have two options in that file, you can do plain sockets or support SSL. Enabling either of those you will run into some build problems though with missing symbols when you go to make python. You need to include the libcrypt or libssl libraries, to build SSL support and something else for IPV6, which I wasn't sure about. I ended up configuring Python without IPV6 support (--disable ipv6) since I didn't need it and couldn't figure out the right command to search my library files for the missing symbols. I wasn't exactly sure how to put -lssl and -lcrypt into the make command to build the modules either, so I just ran the command manually where make bombed out, then resumed make. -Stephen From mwh@python.net Sat Sep 28 12:01:23 2002 From: mwh@python.net (Michael Hudson) Date: 28 Sep 2002 12:01:23 +0100 Subject: [Pythonmac-SIG] Jaguar Macho Build woes In-Reply-To: "Stephen R. Figgins"'s message of "Fri, 27 Sep 2002 14:06:14 -0500" References: Message-ID: <2mit0qwf7g.fsf@starship.python.net> "Stephen R. Figgins" writes: > On 9/27/02 3:35 AM, "Michael Hudson" wrote: > > > > This is awfully hard to diagnose. What happens when setup.py tries to > > build _socket? > > It didn't even try. The default modules/Setup file didn't say to build it. I'm guessing you don't quite understand how extension modules are built any more? setup.py (note: NOT Modules/Setup) certainly should try to build _socket... > You have two options in that file, you can do plain sockets or support SSL. > Enabling either of those you will run into some build problems though with > missing symbols when you go to make python. You need to include the > libcrypt or libssl libraries, to build SSL support and something else for > IPV6, which I wasn't sure about. I ended up configuring Python without IPV6 > support (--disable ipv6) since I didn't need it and couldn't figure out the > right command to search my library files for the missing symbols. This should be fixed in CVS (both HEAD and release22-maint). > I wasn't exactly sure how to put -lssl and -lcrypt into the make command to > build the modules either, so I just ran the command manually where make > bombed out, then resumed make. This is a new one on me; I've not heard of ssl problems before. Cheers, M. -- (Unfortunately, while you get Tom Baker saying "then we were attacked by monsters", he doesn't flash and make "neeeeooww-sploot" noises.) -- Gareth Marlow, ucam.chat, from Owen Dunn's review of the year From stephen.langer@nist.gov Mon Sep 30 19:19:34 2002 From: stephen.langer@nist.gov (Stephen A. Langer) Date: Mon, 30 Sep 2002 14:19:34 -0400 Subject: [Pythonmac-SIG] porting a python extension to OS X 10.2 Message-ID: Hello -- Can someone point me to a summary of how to compile and link a Python extension module, written in C++, under OS X 10.2? On other Unixes (Linux, SGI), we compile with gcc 2.95.x and link with gcc -shared, producing a .so file which Python is happy to load. gcc 3.1 on OS X doesn't understand -shared. Do I have to use libtool instead? When I try to do that, libtool complains at the end about all sorts of undefined symbols, which should have been resolved by the list of libraries it was given. What am I missing? Many thanks, Steve -- -- EMail: stephen.langer@nist.gov Phone: (301) 975-5423 -- -- WWW: http://math.nist.gov/mcsd/Staff/SLanger/ Fax: (301) 990-4127 -- -- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, Md 20899-8910 -- From phschmid@cadinfo.ch Mon Sep 30 21:14:56 2002 From: phschmid@cadinfo.ch (Philippe Schmid) Date: Mon, 30 Sep 2002 22:14:56 +0200 Subject: [Pythonmac-SIG] Failing to import PyGreSQL module (Python 2.2.1 on 10.2.1) Message-ID: I am trying to use the PyGreSQL python module ... without much success. Compiling seems to be fine with cc -shared -flat_namespace -undefined suppress -o _pg.so -I/usr/include/python2.2 -I/Users/higgins/Documents/postgres/postgresql-7.2.2/src/include/ -I/usr/local/pgsql/include -L/usr/local/pgsql/lib -lpq pgmodule.c but when trying to "import _pg" in Python (interpreter), I get this: Traceback (most recent call last): File "", line 1, in ? ImportError: Failure linking new module I also tried to compile with "standards" flags, as CFLAGS = -no-cpp-precomp and LDFLAGS = -lgcc If someone has another DB working module for Postgres, that would be also fine (I also tried the PyPgSQL one, but compilation fails and I do not have soo much time to debug this now). Someone an Idea ? Many thanks for helping... Philippe Schmid