From cdamundsen at gmail.com Mon Nov 1 05:35:46 2004 From: cdamundsen at gmail.com (Craig Amundsen) Date: Mon Nov 1 05:35:52 2004 Subject: [Pythonmac-SIG] Numeric headers In-Reply-To: References: <8dc0c28f0410301012721b9d8d@mail.gmail.com> Message-ID: <8dc0c28f0410312035157aa2f9@mail.gmail.com> Hi- On Sun, 31 Oct 2004 15:58:59 -0500, David M. Cooke wrote: > I've attached the diff that I use to compile Numeric with LAPACK > support on OS X. It compiles it with -faltivec and links agains the > vecLib framework. Hope this helps. That worked great. Thanks for the file. - Craig From Chris.Barker at noaa.gov Mon Nov 1 20:41:54 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Mon Nov 1 20:43:20 2004 Subject: [Pythonmac-SIG] Numeric headers In-Reply-To: <8dc0c28f0410301012721b9d8d@mail.gmail.com> References: <8dc0c28f0410301012721b9d8d@mail.gmail.com> Message-ID: <41869182.7040505@noaa.gov> Craig Amundsen wrote: > Has anyone out there managed to modify the 23.x setup.py to get a > successful build? It looks like you've found a solution, but just in case: you don't need to re-compile to use the headers. Just install Bob's package, then put the headers from Numeric source tarball somewhere you're compiler will find them, and you're done. -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 clifford.wells at comcast.net Tue Nov 2 02:21:07 2004 From: clifford.wells at comcast.net (Cliff Wells) Date: Tue Nov 2 02:21:12 2004 Subject: [Pythonmac-SIG] ANN: py2app / bdist_mpkg 0.1.5 preview In-Reply-To: <9BAA7798-231A-11D9-A940-000A95BA5446@redivi.com> References: <9BAA7798-231A-11D9-A940-000A95BA5446@redivi.com> Message-ID: <1099358467.9453.7.camel@devilbox.devilnet.internal> On Thu, 2004-10-21 at 00:35 -0400, Bob Ippolito wrote: > I've put together a little preview of py2app 0.1.5, which has MAJOR > feature enhancements over 0.1.4. > http://undefined.org/python/py2app-0.1.5.mpkg.zip (installer for Mac > OS X 10.3) Hi, I'm trying to use this version of py2app. I'm encountering the following error: error: can't copy 'favorites': doesn't exist or not a regular file This is true: favorites is a directory, not a regular file. However the same setup.py works for Windows, Linux *and* on OS X (if I use 'python setup.py py2app' rather than 'python setup.py bdist_mpkg'). My setup.py is as follows: from distutils.core import setup import sys, glob if sys.platform == 'win32': import py2exe buildstyle = 'windows' packager = 'py2exe' elif sys.platform == 'darwin': import py2app buildstyle = 'app' packager = 'py2app' else: buildstyle = 'console' packager = None setup(name='Project DU Reader', version = '1.0', description = 'Themeable RSS reader', author = 'Cliff Wells', author_email = 'clifford.wells@comcast.net', url = 'http://www.projectdu.com/', options = {packager: {'packages': ['encodings', 'twisted'], 'excludes': ['pywin', 'pywin.debugger', 'pywin.debugger.dbgcon', 'pywin.dialogs', 'pywin.dialogs.list', 'Tkinter', 'Tkconstants', 'tcl', 'Tk'] }}, data_files=[('', ['DU_Icon.ico', 'favorites', 'icons', 'themes'])], **{buildstyle: [{'script': 'du.py', 'icon_resources': [(1, 'DU_Icon.ico')], }]} ) For 'favorites' and 'icons' I could simply use glob. However the 'themes' directory is about three levels deep and I'd like to avoid having to do a ton of work to generate that particular file list, esp since it is large and changes frequently. Any help appreciated. Regards, Cliff -- Cliff Wells From bob at redivi.com Tue Nov 2 02:32:37 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 2 02:32:43 2004 Subject: [Pythonmac-SIG] ANN: py2app / bdist_mpkg 0.1.5 preview In-Reply-To: <1099358467.9453.7.camel@devilbox.devilnet.internal> References: <9BAA7798-231A-11D9-A940-000A95BA5446@redivi.com> <1099358467.9453.7.camel@devilbox.devilnet.internal> Message-ID: <144A680D-2C6F-11D9-955F-000A95BA5446@redivi.com> On Nov 1, 2004, at 20:21, Cliff Wells wrote: > On Thu, 2004-10-21 at 00:35 -0400, Bob Ippolito wrote: >> I've put together a little preview of py2app 0.1.5, which has MAJOR >> feature enhancements over 0.1.4. >> http://undefined.org/python/py2app-0.1.5.mpkg.zip (installer for Mac >> OS X 10.3) > > I'm trying to use this version of py2app. I'm encountering the > following error: > > error: can't copy 'favorites': doesn't exist or not a regular file > > This is true: favorites is a directory, not a regular file. However > the > same setup.py works for Windows, Linux *and* on OS X (if I use 'python > setup.py py2app' rather than 'python setup.py bdist_mpkg'). --- > data_files=[('', ['DU_Icon.ico', 'favorites', 'icons', > 'themes'])], --- > For 'favorites' and 'icons' I could simply use glob. However the > 'themes' directory is about three levels deep and I'd like to avoid > having to do a ton of work to generate that particular file list, esp > since it is large and changes frequently. Try passing it in as just: data_files=['DU_Icon.ico', 'favorites', 'icons', 'themes'] when using py2app, for now. -bob From sw at wordtech-software.com Wed Nov 3 04:35:05 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Wed Nov 3 04:35:09 2004 Subject: [Pythonmac-SIG] PyQt Message-ID: <418851E9.8000707@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Jack, I've received approval for a Sourceforge project for my PyQt-Mac distribution. I'm planning to put together a package installer of everything, and I'm also going to include an applet bundle of Eric3. Can't get it bundled as a standalone with py2app, and PyQt has so many moving parts that I couldn't even begin to give Bob useful information on debugging it--but that's not a problem if all of PyQt is installed. Given this, I'm not sure it makes much sense to add Eric3 to the packman database, but if you want to, that's fine. For what it's worth, I'm using an older version of Eric--3.5 was just released last month and crashes often, but 3.4.2 from last spring is very stable. I'm not going to include the Macpython extensions, but will refer people to download them if needed. When I have everything packaged to my satisfaction and I feel it's ready ~ to go, I'll send general download instructions to the list. It's ironic--I'm still not very far with learning Python development per se (my current big project, a GUI for DarwinPorts, is written with TkAqua, since DarwinPorts itself is written in Tcl), but I'm very interested in Qt and have spent a lot of time learning to build it--so this is fairly straightforward for me, and dovetails well with my interest in Python. Plus, with Qt licensing being unproblematic on the Mac, I think having this available opens up a lot of nice tools for Python developers. So, I'm glad to take this on. All best, Kevin - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBiFHpJmdQs+6YVcoRAuASAJ0fOwSSixhL0imdF0EZE1zSfL7YlACfVRzm 63WRkiN08jAThD+SqfqTyrI= =LH1g -----END PGP SIGNATURE----- From kant1304 at free.fr Thu Nov 4 21:53:29 2004 From: kant1304 at free.fr (kant1304@free.fr) Date: Thu Nov 4 21:53:30 2004 Subject: [Pythonmac-SIG] Requirements for a py2app application Message-ID: <1099601609.418a96c9296ac@imp3-q.free.fr> Hi, I've read on http://undefined.org/python/ that an application made with py2app was able to run as a standalone application, without any existing python installation. An application that I made with it worked without any problem, but a friend sent me this message that he received while launching the app I made : 2004-11-04 15:29:21.024 Greenhouse[777] Greenhouse Error 2004-11-04 15:29:21.025 Greenhouse[777] MacPython 2.3 is required to run this application. Furthermore, the app doesn't want to run. I know it isn't much, but does anyone have a clue of what may cause the problem ? Thanks in advance From delza at livingcode.org Thu Nov 4 22:49:08 2004 From: delza at livingcode.org (Dethe Elza) Date: Thu Nov 4 22:49:09 2004 Subject: [Pythonmac-SIG] Requirements for a py2app application In-Reply-To: <1099601609.418a96c9296ac@imp3-q.free.fr> References: <1099601609.418a96c9296ac@imp3-q.free.fr> Message-ID: <5AD63222-2EAB-11D9-BDAC-0003939B59E8@livingcode.org> What version of OS X was your friend running? OS 10.3 shipped with Python 2.3, but earlier versions did not. Generally I believe you have to create separate executables for 10.3 and for 10.2 (or earlier). --Dethe "Computers are beyond dumb, they're mind-numbingly stupid. They're hostile, rigid, capricious, and unforgiving. They're impossibly demanding and they never learn anything." -- John R. Levine From bob at redivi.com Fri Nov 5 00:54:49 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Nov 5 00:54:56 2004 Subject: [Pythonmac-SIG] Requirements for a py2app application In-Reply-To: <1099601609.418a96c9296ac@imp3-q.free.fr> References: <1099601609.418a96c9296ac@imp3-q.free.fr> Message-ID: On Nov 4, 2004, at 15:53, kant1304@free.fr wrote: > I've read on http://undefined.org/python/ that an application made > with py2app > was able to run as a standalone application, without any existing > python > installation. An application that I made with it worked without any > problem, > but a friend sent me this message that he received while launching the > app I > made : > > 2004-11-04 15:29:21.024 Greenhouse[777] Greenhouse Error > 2004-11-04 15:29:21.025 Greenhouse[777] MacPython 2.3 is required to > run this > application. > > Furthermore, the app doesn't want to run. > > I know it isn't much, but does anyone have a clue of what may cause > the problem > ? When you create an application with py2app one of two things happens by default: (a) It detects that you are using a vendor-provided Python installation and builds a semi-standalone executable. (b) It detects that you are using a custom Python installation (darwinports, compiled yourself, whatever) and builds a standalone executable. Using the standard Python installation on Mac OS X 10.3 or later will always cause (a) to happen. A semi-standalone executable includes NO subset of the Python installation you built it with, and depends on a very similar installation (namely, installed in the same place). There are several reasons for doing it this way, including but not limited to: - You probably have no legal right to redistribute any part of Mac OS X. - Even if you did do it, it wouldn't work on earlier versions of Mac OS X anyway. - It's a waste of space and time. Using any other Python installation will cause (b) to happen by default, which is always the case for Mac OS X 10.2 and earlier since it does not ship with a version of Python compatible with py2app. Applications built in this style include a subset of Python in the application bundle (the dylib, and the parts of the standard library you used). Note that there is no implicit guarantee that applications built in this style will work on previous versions of Mac OS X. Care must be taken to compile Python and any third party extensions you are using in such a way that they will be backwards compatible (MACOSX_DEPLOYMENT_TARGET, and you may also need to use the SDKs). Currently, the only proven method for creating a Python installation and set of packages that are compatible with a certain version of Mac OS X is to compile Python and any third party extensions on the target version of Mac OS X. Using py2app can be done from any version of Mac OS X, however, you have to be careful that you use the correct python interpreter when invoking py2app (probably via a setup.py). There is one caveat with (a). It's possible to have a machine running Mac OS X 10.3 that does not have Python at all. The only way to cause this scenario is to do a Customized install of Mac OS X and uncheck the BSD components. Most people clever enough to customize their installation know better, though. I can't say whether or not this is still the case for 10.4. I did file a bug saying that Python should not be an optional component (perl isn't), and I recommend that you do as well if it is important to you that your applications work on any 10.4+ machine regardless of how clever the user was with their customized installation. -bob From p.thibault at bigfoot.com Sat Nov 6 23:05:56 2004 From: p.thibault at bigfoot.com (Pierre Thibault) Date: Sat Nov 6 23:05:37 2004 Subject: [Pythonmac-SIG] Problems with file names Message-ID: <086DA833-3040-11D9-9D29-000A95B2409A@bigfoot.com> Hello, I have a little problem with the Python script I wrote. I am unable to treat some file names containing accentued characters or special characters like '. I use the os.walk() generator to traverse my hierarchy of files. I then use commands.getstatusoutput('md5 ' + "'" + fileName + "'") to execute the md5 command on the files I want. This is working well for most of my files but not for file names containing accentued characters or special characters like ' as I said before. Is there a way to reformat fineName to avoid these errors? Is there a special Unix command that I don't know to do that? Any help or idea on how to solve this problem would be appreciated. Regards. --------------------- Pierre From bob at redivi.com Sun Nov 7 02:20:14 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Nov 7 02:20:51 2004 Subject: [Pythonmac-SIG] Problems with file names In-Reply-To: <086DA833-3040-11D9-9D29-000A95B2409A@bigfoot.com> References: <086DA833-3040-11D9-9D29-000A95B2409A@bigfoot.com> Message-ID: <2D84B3FC-305B-11D9-9DB1-000A95BA5446@redivi.com> On Nov 6, 2004, at 17:05, Pierre Thibault wrote: > I have a little problem with the Python script I wrote. I am unable to > treat some file names containing accentued characters or special > characters like '. I use the os.walk() generator to traverse my > hierarchy of files. I then use commands.getstatusoutput('md5 ' + "'" + > fileName + "'") to execute the md5 command on the files I want. > > This is working well for most of my files but not for file names > containing accentued characters or special characters like ' as I said > before. Is there a way to reformat fineName to avoid these errors? Is > there a special Unix command that I don't know to do that? > > Any help or idea on how to solve this problem would be appreciated. Don't use the commands module, os.system, os.popen, etc. EVER. They all suck. Use the subprocess module from Python 2.4. Everything you need to know is in PEP 0324: http://www.python.org/peps/pep-0324.html -bob From delza at alliances.org Sun Nov 7 08:49:27 2004 From: delza at alliances.org (Dethe Elza) Date: Sun Nov 7 08:49:26 2004 Subject: [Pythonmac-SIG] Carbon GetKeys() and NSObject.self() Message-ID: <8CB0939F-3091-11D9-BFDC-0003939B59E8@alliances.org> Hi folks, Is there a way to access the Carbon GetKeys(keymap) method from within Python, or is that a job which calls for Pyrex? Also, I'm getting a weird error when calling % NSBundle.loadGSMarkupFile_externalNameTable_withZone_(self.filename, {'NSOwner': self}, None) TypeError: Expecting instance of NSBundle as self, got one of objc.pyobjc_unicode (loadGSMarkupFile_externalNameTable_withZone_ is the Renaissance equivalent of loadNibFile_externalNameTable_withZone_) The "self" in this case is a Python object, inheriting from NSObject which is the application delegate. Am I supposed to pass the bundle rather than the delegate object itself? Should I be calling the NSObject.self() method instead of using my self object, and if so, how? I tried using self.self() and got the same error. --Dethe "...coding isn't the poor handmaiden of design or analysis. Coding is where your fuzzy, comfortable ideas awaken in the harsh dawn of reality. It is where you learn what your computer can do. If you stop coding, you stop learning." Kent Beck, Smalltalk Best Practice Patterns -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2367 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041106/dac2f196/smime.bin From bob at redivi.com Sun Nov 7 10:22:34 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Nov 7 10:22:43 2004 Subject: [Pythonmac-SIG] Carbon GetKeys() and NSObject.self() In-Reply-To: <8CB0939F-3091-11D9-BFDC-0003939B59E8@alliances.org> References: <8CB0939F-3091-11D9-BFDC-0003939B59E8@alliances.org> Message-ID: <8EA2B8DB-309E-11D9-9DB1-000A95BA5446@redivi.com> On Nov 7, 2004, at 2:49, Dethe Elza wrote: > Is there a way to access the Carbon GetKeys(keymap) method from within > Python, or is that a job which calls for Pyrex? Possibly, but don't call that method. You probably want the current key modifiers: flags = NSApplication.sharedApplication().currentEvent().modifierFlags() see http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Classes/NSEvent.html for the flag masks (NSShiftKeyMask, etc.) > Also, I'm getting a weird error when calling > > % NSBundle.loadGSMarkupFile_externalNameTable_withZone_(self.filename, > {'NSOwner': self}, None) > TypeError: Expecting instance of NSBundle as self, got one of > objc.pyobjc_unicode > > (loadGSMarkupFile_externalNameTable_withZone_ is the Renaissance > equivalent of loadNibFile_externalNameTable_withZone_) > > The "self" in this case is a Python object, inheriting from NSObject > which is the application delegate. Am I supposed to pass the bundle > rather than the delegate object itself? Should I be calling the > NSObject.self() method instead of using my self object, and if so, > how? I tried using self.self() and got the same error. You're calling an instance method without an instance. NSBundle.mainBundle()..... -bob From pecora at anvil.nrl.navy.mil Sun Nov 7 13:25:33 2004 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Sun Nov 7 13:25:24 2004 Subject: [Pythonmac-SIG] Installed MacPython 10.3 Addons - Can't find Modules, even standard ones. Message-ID: <418E143D.7000708@anvil.nrl.navy.mil> I upgraded to Panther a month ago and just upgraded to MacPython 10.3 Addons (as per Jack Jansen's page - thanks, Jack). But now my programs can't even find standard modules. from Numeric import * brings up the error window: Can't find module Numeric. Even trig functions sine and cosine generate the same type of error. I've looked over the FAQ and can't see any answers (maybe I missed something). I'm guessing this is a Path problem, but I'm stumped. I have PYTHONPATH set to some of my modules (which seems to work), but not sure what to do about standard stuff. Any clues appreciated. Thanks. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora@anvil.nrl.navy.mil From pecora at anvil.nrl.navy.mil Sun Nov 7 17:13:34 2004 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Sun Nov 7 17:13:26 2004 Subject: [Pythonmac-SIG] Installed MacPython 10.3 Addons - Can't find Modules, even standard ones. In-Reply-To: <20041107160622.GB73348@uiuc.edu> References: <418E143D.7000708@anvil.nrl.navy.mil> <20041107160622.GB73348@uiuc.edu> Message-ID: <418E49AE.3070308@anvil.nrl.navy.mil> Nicholas Riley wrote: >On Sun, Nov 07, 2004 at 07:25:33AM -0500, Louis Pecora wrote: > > >>I upgraded to Panther a month ago and just upgraded to MacPython 10.3 >>Addons (as per Jack Jansen's page - thanks, Jack). >> >>But now my programs can't even find standard modules. from Numeric >>import * brings up the error window: Can't find module Numeric. Even >>trig functions sine and cosine generate the same type of error. I've >>looked over the FAQ and can't see any answers (maybe I missed >>something). I'm guessing this is a Path problem, but I'm stumped. I >>have PYTHONPATH set to some of my modules (which seems to work), but not >>sure what to do about standard stuff. >> >> > >Numeric is not a standard module; you'll need to install it. > OK. I thought it came with MacPython in the past. But aren't the trig functions part of the standard module? Thanks. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora@anvil.nrl.navy.mil From njriley at uiuc.edu Sun Nov 7 17:37:53 2004 From: njriley at uiuc.edu (Nicholas Riley) Date: Sun Nov 7 17:37:56 2004 Subject: [Pythonmac-SIG] Installed MacPython 10.3 Addons - Can't find Modules, even standard ones. In-Reply-To: <418E49AE.3070308@anvil.nrl.navy.mil> References: <418E143D.7000708@anvil.nrl.navy.mil> <20041107160622.GB73348@uiuc.edu> <418E49AE.3070308@anvil.nrl.navy.mil> Message-ID: <20041107163753.GA73994@uiuc.edu> On Sun, Nov 07, 2004 at 11:13:34AM -0500, Louis Pecora wrote: > Nicholas Riley wrote: > > >On Sun, Nov 07, 2004 at 07:25:33AM -0500, Louis Pecora wrote: > > > > > >>I upgraded to Panther a month ago and just upgraded to MacPython 10.3 > >>Addons (as per Jack Jansen's page - thanks, Jack). > >> > >>But now my programs can't even find standard modules. from Numeric > >>import * brings up the error window: Can't find module Numeric. Even > >>trig functions sine and cosine generate the same type of error. I've > >>looked over the FAQ and can't see any answers (maybe I missed > >>something). I'm guessing this is a Path problem, but I'm stumped. I > >>have PYTHONPATH set to some of my modules (which seems to work), but not > >>sure what to do about standard stuff. > >> > >> > > > >Numeric is not a standard module; you'll need to install it. > > > > OK. I thought it came with MacPython in the past. But aren't the trig > functions part of the standard module? This should work: >>> import math >>> math.sin(math.pi/2) 1.0 If it doesn't, what error message do you get? -- Nicholas Riley | From newsletter at theflow.de Sun Nov 7 17:57:24 2004 From: newsletter at theflow.de (Florian Munz) Date: Sun Nov 7 17:57:27 2004 Subject: [Pythonmac-SIG] py2app and /usr/lib libraries Message-ID: <1gmw6rl.wx4g5rhha8amM%newsletter@theflow.de> Hi, I had a lot of fun playing with py2app and PyObjC this weekend but for distributing my application I encountered the following difficulty: My application uses libxslt und libtidy and they depend on libraries in /usr/lib. What is the correct way to ship these in one application package? I tried it with an libxslt.framework insinde the package Frameworks directory, but I don't know if and how the libxslt python module must be recompiled to find the library at this location or what other changes need to be made. Another way may be to provide an pkg-based installer, but I have no experiences with this. thanks, Florian From telliott at hsc.wvu.edu Sun Nov 7 18:01:42 2004 From: telliott at hsc.wvu.edu (Tom Elliott) Date: Sun Nov 7 18:01:46 2004 Subject: [Pythonmac-SIG] Newbie PyObjC question Message-ID: I would like to know how to determine which of several radio buttons has been selected by the user, preferably in a simple variable like an int. I can set the buttons as an action for my Controller, and be told when the user pushes a button, but there's no info about which button was pushed. In the case of a slider, one can set the slider to be an outlet for the Controller and get the value by: value = self.mySlider.doubleValue() What is the corresponding call for a set of buttons? I can't figure out anything from the Apple APIs. Thanks a lot for any help. Tom Elliott From bob at redivi.com Sun Nov 7 19:45:47 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Nov 7 19:45:53 2004 Subject: [Pythonmac-SIG] py2app and /usr/lib libraries In-Reply-To: <1gmw6rl.wx4g5rhha8amM%newsletter@theflow.de> References: <1gmw6rl.wx4g5rhha8amM%newsletter@theflow.de> Message-ID: <3D6666B7-30ED-11D9-9D1F-000A95BA5446@redivi.com> On Nov 7, 2004, at 11:57, Florian Munz wrote: > I had a lot of fun playing with py2app and PyObjC this weekend but for > distributing my application I encountered the following difficulty: > > My application uses libxslt und libtidy and they depend on libraries in > /usr/lib. > > What is the correct way to ship these in one application package? > > I tried it with an libxslt.framework insinde the package Frameworks > directory, but I don't know if and how the libxslt python module must > be > recompiled to find the library at this location or what other changes > need to be made. > > Another way may be to provide an pkg-based installer, but I have no > experiences with this. DO NOT install anything to /usr/lib or /System, EVER. Put stuff in in /usr/local, /Library, etc. py2app completely ignores anything in system paths for good reason. -bob From bob at redivi.com Sun Nov 7 20:19:45 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Nov 7 20:19:50 2004 Subject: [Pythonmac-SIG] Newbie PyObjC question In-Reply-To: References: Message-ID: On Nov 7, 2004, at 12:01, Tom Elliott wrote: > I would like to know how to determine which of several radio buttons > has been selected by the user, preferably in a simple variable like an > int. I can set the buttons as an action for my Controller, and be > told when the user pushes a button, but there's no info about which > button was pushed. > > In the case of a slider, one can set the slider to be an outlet for > the Controller and get the value by: > > value = self.mySlider.doubleValue() > > What is the corresponding call for a set of buttons? I can't figure > out anything from the Apple APIs. > > Thanks a lot for any help. Give each radio button (a NSButtonCell) a tag, or just give them all meaningful titles. Make an outlet for your NSMatrix of NSButtonCells (radio buttons). To see which cells are selected you can do: selectedCells = filter(lambda cell: cell.intValue() == 1, self.myRadioMatrix.cells()) and then you'd get the title or tag from your selected cells. -bob From p.thibault at bigfoot.com Sun Nov 7 21:57:07 2004 From: p.thibault at bigfoot.com (Pierre Thibault) Date: Sun Nov 7 21:57:12 2004 Subject: [Pythonmac-SIG] Problems with file names In-Reply-To: <2D84B3FC-305B-11D9-9DB1-000A95BA5446@redivi.com> References: <086DA833-3040-11D9-9D29-000A95B2409A@bigfoot.com> <2D84B3FC-305B-11D9-9DB1-000A95BA5446@redivi.com> Message-ID: <96066284-30FF-11D9-B24F-000A95B2409A@bigfoot.com> Cool! The errors are gone! Le 6 nov. 2004, ? 20:20, Bob Ippolito a ?crit : > Don't use the commands module, os.system, os.popen, etc. EVER. They > all suck. Use the subprocess module from Python 2.4. > > Everything you need to know is in PEP 0324: > http://www.python.org/peps/pep-0324.html > Regards. --------------------- Pierre From delza at blastradius.com Sun Nov 7 09:44:13 2004 From: delza at blastradius.com (Dethe Elza) Date: Sun Nov 7 23:09:13 2004 Subject: [Pythonmac-SIG] Re: NSObject.self(): Never mind Message-ID: <33AD1F9E-3099-11D9-BFDC-0003939B59E8@blastradius.com> Well, I figured out the problem with loadGSMarkupFile_externalNameTable_withZone_. There is a class method with that signature, that I *thought* I was calling, and an instance method with that signature which I was *actually* calling, thus it wanted an NSBundle for the self parameter. Doh! Problem solve, now I'm getting a simple failure %-) --Dethe You know, Hobbes, some days even my lucky rocketship underpants don't help. --Calvin -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2371 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041107/1d92218d/smime.bin From ronaldoussoren at mac.com Mon Nov 8 08:37:02 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon Nov 8 08:37:26 2004 Subject: [Pythonmac-SIG] Re: NSObject.self(): Never mind In-Reply-To: <33AD1F9E-3099-11D9-BFDC-0003939B59E8@blastradius.com> References: <33AD1F9E-3099-11D9-BFDC-0003939B59E8@blastradius.com> Message-ID: On 7-nov-04, at 9:44, Dethe Elza wrote: > Well, I figured out the problem with > loadGSMarkupFile_externalNameTable_withZone_. There is a class method > with that signature, that I *thought* I was calling, and an instance > method with that signature which I was *actually* calling, thus it > wanted an NSBundle for the self parameter. Doh! That's the only hard TODO item in PyObjC at the moment, caused by a semantic mismatch between Python and Objective-C. In Python instance and class methods live in the same name space, while they are in different namespaces in Objective-C. If a ObjC class has a class and instance method with the same name you currently have to do some extra work to access the class method, because the instance method is found first. It should be possible to work around this, but nobody got around to work on that yet. This issue is really annoying when a class has an undocumented instance method with the same name as a documented class method :-( Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From delza at livingcode.org Tue Nov 9 06:20:29 2004 From: delza at livingcode.org (Dethe Elza) Date: Tue Nov 9 06:20:26 2004 Subject: [Pythonmac-SIG] py2app and Renaissance Message-ID: <120AD09F-320F-11D9-BFDC-0003939B59E8@livingcode.org> Bob, what's the best way to build an app using py2app if that app includes the Renaissance framework? I looked at the version of DrawBot you built using Renaissance, but it used bundlebuilder. More generally, how should I include frameworks with my pyobjc applications using py2app? Thanks! --Dethe "There's a little bit of God in every truck driver and a little bit of truck driver in every God." -- Blayne Horner From bob at redivi.com Tue Nov 9 07:04:48 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 9 07:04:55 2004 Subject: [Pythonmac-SIG] py2app and Renaissance In-Reply-To: <120AD09F-320F-11D9-BFDC-0003939B59E8@livingcode.org> References: <120AD09F-320F-11D9-BFDC-0003939B59E8@livingcode.org> Message-ID: <433C6E0D-3215-11D9-AB04-000A95BA5446@redivi.com> On Nov 9, 2004, at 0:20, Dethe Elza wrote: > Bob, what's the best way to build an app using py2app if that app > includes the Renaissance framework? I looked at the version of > DrawBot you built using Renaissance, but it used bundlebuilder. More > generally, how should I include frameworks with my pyobjc applications > using py2app? If you use a python module that links to Renaissance, it will automatically get included. Otherwise, you have to specify it as a framework. % python setup.py py2app -f Renaissance.framework (you can specify a full path to the framework or the dylib inside the framework if you want) or from setup.py it would look like: setup( app = [...], options = dict(py2app=dict( frameworks=['Renaissance.framework'], )), ) This command is your friend: % python setup.py --help py2app Every "long name" in the list corresponds to an option you can pass via the options dict. Hypens are converted to underscores. This same dance works for any distutils command, btw. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2089 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041109/8cbd3746/smime.bin From sw at wordtech-software.com Tue Nov 9 15:55:23 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Tue Nov 9 15:55:26 2004 Subject: [Pythonmac-SIG] Update on PyQt/question re: EasyDialogs Message-ID: <4190DA5B.2050509@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm still thrashing around on the installer script for PyQt-Mac--it has so many moving parts that I keep missing pieces of it in trying to use Installer/PackageMaker. Therefore, I've decided to use a basic Python script that incorporates Bob's authorization framework and EasyDialogs to wrap various commands to get everything in place (cp -R for Qt, sudo make install for the PyQt bits). I know the W widgets are depreceated, but am I correct that EasyDialogs is still actively maintained as part of the Mac-specific Python extensions? I'd like to document my use of it at my website (along with my use of Bob's authorization wrappper), but only if it isn't in imminent danger of going away. EasyDialogs is perfect for what I need here, a lightweight GUI wrapper for commands--like AppleScript's "display dialog" command but with the added benefit of a progress bar. (Believe it or not, this is what tipped the scale in favor of Python instead of AppleScript as my installer language.) I realize EasyDialogs are limited and will document it with that caveat, but it's very convenient for those who haven't had the time yet (like me) to learn a heavier toolkit such as PyObjC, wxPython, or even tkinter. Thanks, Kevin - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBkNpbJmdQs+6YVcoRArbWAJsHY6vyrw2EHdAQK+NRFholGpD2YACfdcBn CtLcHffg3lbexeR+kYFm/dU= =+am/ -----END PGP SIGNATURE----- From keithn at 2xtreme.net Tue Nov 9 20:32:09 2004 From: keithn at 2xtreme.net (Keith Nemitz) Date: Tue Nov 9 20:26:34 2004 Subject: [Pythonmac-SIG] pygame/pyobjc eats keys for subordinate process Message-ID: <0C5BBFD6-3286-11D9-9180-000393DB52E4@2xtreme.net> I'm not sure if this is a pygame question or a pyobjc question, either could be causing the problem I'm currently debugging. I'm invoking the Kagi purchase system from within my game. It opens a window, and I can click on the buttons and such, but all keystrokes are gobbled by the game before the Kagi window sees them. I've checked this by watching the events. If I bring other applications forward, they respond to the keyboard, just fine. I've turned 'grabbing' off. And there doesn't seem to be a way to 'give up' keyboard focus. (there's only the key.get_focused method) Are there other places/docs I should be looking? I'm hoping that I might find a cocoa call that will give the sub-window full control over events. I'm very close to shipping my adventure game, and this may be the last obstacle... yada,yada FLW! Assistance would be greatly appreciated. Keith Nemitz Mousechief Co. From bob at redivi.com Tue Nov 9 21:29:00 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 9 21:29:05 2004 Subject: [Pythonmac-SIG] Update on PyQt/question re: EasyDialogs In-Reply-To: <4190DA5B.2050509@wordtech-software.com> References: <4190DA5B.2050509@wordtech-software.com> Message-ID: On Nov 9, 2004, at 9:55, Kevin Walzer wrote: > I'm still thrashing around on the installer script for PyQt-Mac--it has > so many moving parts that I keep missing pieces of it in trying to use > Installer/PackageMaker. Therefore, I've decided to use a basic Python > script that incorporates Bob's authorization framework and EasyDialogs > to wrap various commands to get everything in place (cp -R for Qt, sudo > make install for the PyQt bits). Why can't you just create a normal pkg installer? I can't imagine what you would need to do to install this that would require anything above and beyond the functionality of Installer.app. I would certainly be much less inclined to use your installer if it's some custom stuff, who knows what it might do to my computer with authorization. At least with Installer I can look at any scripts it uses and the bill of materials before I touch it. > I know the W widgets are depreceated, but am I correct that EasyDialogs > is still actively maintained as part of the Mac-specific Python > extensions? I'd like to document my use of it at my website (along with > my use of Bob's authorization wrappper), but only if it isn't in > imminent danger of going away. EasyDialogs is perfect for what I need > here, a lightweight GUI wrapper for commands--like AppleScript's > "display dialog" command but with the added benefit of a progress bar. > (Believe it or not, this is what tipped the scale in favor of Python > instead of AppleScript as my installer language.) I realize EasyDialogs > are limited and will document it with that caveat, but it's very > convenient for those who haven't had the time yet (like me) to learn a > heavier toolkit such as PyObjC, wxPython, or even tkinter. I don't think EasyDialogs is going anywhere, but it's most definitely not actively maintained. -bob From sw at wordtech-software.com Tue Nov 9 21:51:11 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Tue Nov 9 21:51:17 2004 Subject: [Pythonmac-SIG] Update on PyQt/question re: EasyDialogs In-Reply-To: References: <4190DA5B.2050509@wordtech-software.com> Message-ID: <41912DBF.8060409@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bob Ippolito wrote: | | | Why can't you just create a normal pkg installer? I can't imagine what | you would need to do to install this that would require anything above | and beyond the functionality of Installer.app. I would certainly be | much less inclined to use your installer if it's some custom stuff, who | knows what it might do to my computer with authorization. At least with | Installer I can look at any scripts it uses and the bill of materials | before I touch it. | Bob, The main reason is that I'm having a hard time accounting for every piece that gets installed with Installer. PyQt has a *lot* of moving parts. I've tried a couple of times, and I always seem to leave something out. I thought it might be simpler to let the packages themselves do the installation work. My script will do nothing more than copy the compiled Qt directories to the right places (that's easy to manage) and then run make install to put the compiled versions of PyQt and sip from the build directories (which will be part of the download) into the correct places. I think it's more likely that something might break if I put together an incomplete pkg installer. In fact, I got the idea to do this from your own previous build of PyQt--you precompiled the binaries and then advised people to run sudo make install once they downloaded the files. The only difference is, my version automates that process. Another problem with installer--or perhaps it's just a limitation in my own skills--is that I need to add $QTDIR to the path, and I don't see a place in the installer process to do this. As I understand it, installer scripts don't have full access to environmental variables. Please advise if I'm wrong on this. Would it be better just to do what you did--have folks run sudo make install manually? They can also add $QTDIR themselves. That's easy enough and would simplify things greatly. Your advice is appreciated. Regards, Kevin - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBkS29JmdQs+6YVcoRAlvQAJ9YiR+p49SlCgtW5IyeycK2OECOAACfcPJp csG7N0dCeIZRjp1eXl0FyfM= =YavD -----END PGP SIGNATURE----- From sw at wordtech-software.com Tue Nov 9 22:20:44 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Tue Nov 9 22:20:48 2004 Subject: [Pythonmac-SIG] Update on PyQt/question re: EasyDialogs In-Reply-To: References: <4190DA5B.2050509@wordtech-software.com> Message-ID: <419134AC.4010100@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 One more thing: This is probably a dumb question, but are the install directories outlined in a makefile the places to look when setting up a pkg installer? If so then I will take another cut at the pkg installer. - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBkTSrJmdQs+6YVcoRAl5bAJ4iY3cd2kQgbVw/wNmS3EAHedu99wCfRAbb /vQi+9JAQfbxaP+CGF6yCDo= =CcjW -----END PGP SIGNATURE----- From Jack.Jansen at cwi.nl Tue Nov 9 22:26:54 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Nov 9 22:26:59 2004 Subject: [Pythonmac-SIG] Update on PyQt/question re: EasyDialogs In-Reply-To: <4190DA5B.2050509@wordtech-software.com> References: <4190DA5B.2050509@wordtech-software.com> Message-ID: <13F6EE6D-3296-11D9-9EA2-000D934FF6B4@cwi.nl> On 9 Nov 2004, at 15:55, Kevin Walzer wrote: > I know the W widgets are depreceated, but am I correct that EasyDialogs > is still actively maintained as part of the Mac-specific Python > extensions? EasyDialogs doesn't depend on W, only on Carbon. And I guess I'll maintain it for as long as that's feasible. Actually, now that someone has ported the API to Windows (using only calldll, so it doesn't require PythonWin) and with some talk here about doing a Cocoa port) we could consider at some point pushing for the API to become "standard" for Python dialogs, whatever the underlying GUI toolkit. -- 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 bob at redivi.com Tue Nov 9 22:28:53 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 9 22:29:01 2004 Subject: [Pythonmac-SIG] Update on PyQt/question re: EasyDialogs In-Reply-To: <41912DBF.8060409@wordtech-software.com> References: <4190DA5B.2050509@wordtech-software.com> <41912DBF.8060409@wordtech-software.com> Message-ID: <5A970A6A-3296-11D9-AB04-000A95BA5446@redivi.com> On Nov 9, 2004, at 15:51, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Bob Ippolito wrote: > > | > | > | Why can't you just create a normal pkg installer? I can't imagine > what > | you would need to do to install this that would require anything > above > | and beyond the functionality of Installer.app. I would certainly be > | much less inclined to use your installer if it's some custom stuff, > who > | knows what it might do to my computer with authorization. At least > with > | Installer I can look at any scripts it uses and the bill of materials > | before I touch it. > | > > Bob, > > The main reason is that I'm having a hard time accounting for every > piece that gets installed with Installer. PyQt has a *lot* of moving > parts. I've tried a couple of times, and I always seem to leave > something out. I thought it might be simpler to let the packages > themselves do the installation work. My script will do nothing more > than > copy the compiled Qt directories to the right places (that's easy to > manage) and then run make install to put the compiled versions of PyQt > and sip from the build directories (which will be part of the download) > into the correct places. I think it's more likely that something might > break if I put together an incomplete pkg installer. > > In fact, I got the idea to do this from your own previous build of > PyQt--you precompiled the binaries and then advised people to run sudo > make install once they downloaded the files. The only difference is, my > version automates that process. > > Another problem with installer--or perhaps it's just a limitation in my > own skills--is that I need to add $QTDIR to the path, and I don't see a > place in the installer process to do this. As I understand it, > installer > scripts don't have full access to environmental variables. Please > advise > if I'm wrong on this. > > Would it be better just to do what you did--have folks run sudo make > install manually? They can also add $QTDIR themselves. That's easy > enough and would simplify things greatly. Adding $QTDIR should only be necessary if you need to compile C/C++ software against Qt, it should mean nothing to PyQt. There's no real safe way to add something to the user's environment variables automatically either.. I mean, I guess there's ~/.MacOSX/environment.plist .. but it's not terribly nice to do that unless you really let the user know. Just providing the build dir and allowing people to run sudo make install and add $QTDIR themselves is a fine option for now. Anyone who should be playing with PyQt on the mac at this stage is surely capable of that. -bob From bob at redivi.com Tue Nov 9 22:33:19 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 9 22:33:26 2004 Subject: [Pythonmac-SIG] Update on PyQt/question re: EasyDialogs In-Reply-To: <419134AC.4010100@wordtech-software.com> References: <4190DA5B.2050509@wordtech-software.com> <419134AC.4010100@wordtech-software.com> Message-ID: On Nov 9, 2004, at 16:20, Kevin Walzer wrote: > One more thing: > > This is probably a dumb question, but are the install directories > outlined in a makefile the places to look when setting up a pkg > installer? If so then I will take another cut at the pkg installer. Typically I think what people do is specify a separate install prefix and build the package from that. -bob From delza at livingcode.org Wed Nov 10 07:52:59 2004 From: delza at livingcode.org (Dethe Elza) Date: Wed Nov 10 07:52:55 2004 Subject: [Pythonmac-SIG] py2app and Renaissance In-Reply-To: <433C6E0D-3215-11D9-AB04-000A95BA5446@redivi.com> References: <120AD09F-320F-11D9-BFDC-0003939B59E8@livingcode.org> <433C6E0D-3215-11D9-AB04-000A95BA5446@redivi.com> Message-ID: <288DEE57-32E5-11D9-BFDC-0003939B59E8@livingcode.org> Thanks Bob, it's working great now. I had to modify the __init__.py so that it works from site-packages/Renaissance/ or from site-packages.zip in an application bundle. I'm summarizing the process on my blog, would it be alright with you if I quote from your email below? Also, you mention that I can provide a path to the dylib inside the framework. Is the dylib really all that's used? A simple app is coming in a 1.7 MB, so if I can streamline that a bit, it would be nice. Of course, a not-so-simple app will probably also come in at 1.7 MB, so it's not really that bad... The whole Renaissance framework is 520K with headers, etc., while the dylib is 179K, so it would make a difference. I have been using "python setup.py --help py2app", although I spelled it "python setup.py py2app --help", but I was having trouble figuring out how to convert from command-line params to setup.py configuration, and your email provided the secret sauce. Thanks again, --Dethe On 8-Nov-04, at 10:04 PM, Bob Ippolito wrote: > > On Nov 9, 2004, at 0:20, Dethe Elza wrote: > >> Bob, what's the best way to build an app using py2app if that app >> includes the Renaissance framework? I looked at the version of >> DrawBot you built using Renaissance, but it used bundlebuilder. More >> generally, how should I include frameworks with my pyobjc >> applications using py2app? > > If you use a python module that links to Renaissance, it will > automatically get included. Otherwise, you have to specify it as a > framework. > > % python setup.py py2app -f Renaissance.framework > > (you can specify a full path to the framework or the dylib inside the > framework if you want) > > or from setup.py it would look like: > > setup( > app = [...], > options = dict(py2app=dict( > frameworks=['Renaissance.framework'], > )), > ) > > This command is your friend: > % python setup.py --help py2app > > Every "long name" in the list corresponds to an option you can pass > via the options dict. Hypens are converted to underscores. This same > dance works for any distutils command, btw. > > -bob > "And you think you're so clever and classless and free" ? John Lennon on prototype-based programming -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2488 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041109/e313d0eb/smime-0001.bin From bob at redivi.com Wed Nov 10 08:10:26 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed Nov 10 08:11:01 2004 Subject: [Pythonmac-SIG] py2app and Renaissance In-Reply-To: <288DEE57-32E5-11D9-BFDC-0003939B59E8@livingcode.org> References: <120AD09F-320F-11D9-BFDC-0003939B59E8@livingcode.org> <433C6E0D-3215-11D9-AB04-000A95BA5446@redivi.com> <288DEE57-32E5-11D9-BFDC-0003939B59E8@livingcode.org> Message-ID: <98E4FD7A-32E7-11D9-9FBC-000A9567635C@redivi.com> On Nov 10, 2004, at 1:52 AM, Dethe Elza wrote: > Thanks Bob, it's working great now. I had to modify the __init__.py > so that it works from site-packages/Renaissance/ or from > site-packages.zip in an application bundle. I'm summarizing the > process on my blog, would it be alright with you if I quote from your > email below? Go for it. > Also, you mention that I can provide a path to the dylib inside the > framework. Is the dylib really all that's used? A simple app is > coming in a 1.7 MB, so if I can streamline that a bit, it would be > nice. Of course, a not-so-simple app will probably also come in at > 1.7 MB, so it's not really that bad... The whole Renaissance > framework is 520K with headers, etc., while the dylib is 179K, so it > would make a difference. A Framework may or may not have resources in it that it expects to find at runtime. However, headers are only needed at compile time, so you can easily strip those if it makes a difference. A future version of py2app may have an option to do this. If you provide a path to the dylib it will still include the whole framework for the reason mentioned above. Natively it works with the path to the dylib, but it's smart enough to find it given reasonable information. If you give it a path to a framework that doesn't exist on the filesystem (i.e. 'Renaissance.framework') it will search for it in the same way that dyld does. > I have been using "python setup.py --help py2app", although I spelled > it "python setup.py py2app --help", but I was having trouble figuring > out how to convert from command-line params to setup.py configuration, > and your email provided the secret sauce. This is probably documented in distutils somewhere, though I figured it out by reading source. > On 8-Nov-04, at 10:04 PM, Bob Ippolito wrote: > >> On Nov 9, 2004, at 0:20, Dethe Elza wrote: >> >>> Bob, what's the best way to build an app using py2app if that app >>> includes the Renaissance framework? I looked at the version of >>> DrawBot you built using Renaissance, but it used bundlebuilder. >>> More generally, how should I include frameworks with my pyobjc >>> applications using py2app? >> >> If you use a python module that links to Renaissance, it will >> automatically get included. Otherwise, you have to specify it as a >> framework. >> >> % python setup.py py2app -f Renaissance.framework >> >> (you can specify a full path to the framework or the dylib inside the >> framework if you want) >> >> or from setup.py it would look like: >> >> setup( >> app = [...], >> options = dict(py2app=dict( >> frameworks=['Renaissance.framework'], >> )), >> ) >> >> This command is your friend: >> % python setup.py --help py2app >> >> Every "long name" in the list corresponds to an option you can pass >> via the options dict. Hypens are converted to underscores. This >> same dance works for any distutils command, btw. From sw at wordtech-software.com Wed Nov 10 09:59:57 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Wed Nov 10 10:00:01 2004 Subject: [Pythonmac-SIG] ANN: wxGladeOSX version 0.3.5.1 Message-ID: <4191D88D.30008@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The latest version of wxGlade, v. 0.3.5.1, is now available in a native Mac OS X application bundle. This release is a complete standalone version and no longer requires a separate installation of wxPython thanks to Bob Ippolito's py2app tool. As such, it may be of interest not only to wxPython developers, but also to any Mac-based wxWidgets developer; it can generate C++, Python, Perl, and XRC code. wxGlade is free and open-source. The Mac OS X build is available from http://www.wordtech-software.com/wxglade.html. For more information on wxGlade, see http://wxglade.sourceforge.net. - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBkdiNJmdQs+6YVcoRAuCpAJ4kENKD9hAGyel4hxUj4dZBy6eB+QCfS4Bz ZHVR1JgvpBtSRsvuW0Fo5RQ= =caMR -----END PGP SIGNATURE----- From sw at wordtech-software.com Wed Nov 10 11:18:35 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Wed Nov 10 11:18:38 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac installer available Message-ID: <4191EAFB.3050801@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 PyQt-Mac is a binary installer of the various components of Qt and PyQt for Mac OS X. Included are the following: ? * A complete build of Qt/Mac with QScintilla support. ? * A compiled binary of Sip, the application that converts Qt's C++ base into Python bindings. ? * PyQt. ? * Eric 3, an integrated development environment (IDE) for Python written with the PyQt toolkit. These packages include both compiled binaries and complete source code. For more information, see http://www.wordtech-software.com/pyqt-mac.html. - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBker6JmdQs+6YVcoRAtA8AJ9Y/35JzEU5UtNEICU7EQSFHT6lSQCghUuS owF35BTVioWZJNyTiEn6n2E= =UFDh -----END PGP SIGNATURE----- From sw at wordtech-software.com Wed Nov 10 22:09:37 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Wed Nov 10 22:09:46 2004 Subject: [Pythonmac-SIG] Update on PyQt-Mac forthcoming Message-ID: <41928391.2000302@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A major bug with my build of PyQt-Mac has been brought to my attention--I built Qt with static libraries, but PyQt looks for shared libraries. This will necessitate a rebuild of everything, which will take some time. I will have the new version ready to go in a few days. - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBkoOQJmdQs+6YVcoRAgaeAJ9577baJ1Ce0xTJsL2FuS1KF70aUQCfcD1j lf203fGgac1o8dWvSGpcTiA= =25yq -----END PGP SIGNATURE----- From sw at wordtech-software.com Thu Nov 11 15:08:36 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Thu Nov 11 15:08:41 2004 Subject: [Pythonmac-SIG] Question re: py2app Message-ID: <41937264.3060805@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've found a bug in wxGlade that only seems to exist in the version I packaged with py2app, as a standalone. Whenever I try to generate code using this program, I get an error message that says "no parser found"--apparently it can't find the parsers to convert the XML GUI description to Python code. It looks like at least one file, xml_parse.pyc, didn't get copied into the bundle by py2app, which may explain the problem. This doesn't exist when I run the program from a folder (double-click wxglade.py), nor does it exist when I bundle it as an applet (wxglade + all related files into an app bundle, but external libraries/modules like wxPython left alone)--but all I do with the applet bundle is copy all the wxglade files manually into the bundle into the Resources folder, keeping the same directory structure otherwise. I'm just not sure why that particular file isn't being copied when I run py2app. - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBk3JjJmdQs+6YVcoRAtROAJ9rlidPAzqwadtcdpxXH6sowJ9S/gCfaYxN CzuL9+DO9nUh4zopyeHNwBA= =gsxO -----END PGP SIGNATURE----- From bob at redivi.com Thu Nov 11 18:29:04 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Nov 11 18:29:11 2004 Subject: [Pythonmac-SIG] Question re: py2app In-Reply-To: <41937264.3060805@wordtech-software.com> References: <41937264.3060805@wordtech-software.com> Message-ID: <2F3BDADB-3407-11D9-B23B-000A95BA5446@redivi.com> On Nov 11, 2004, at 9:08, Kevin Walzer wrote: > I've found a bug in wxGlade that only seems to exist in the version I > packaged with py2app, as a standalone. Whenever I try to generate code > using this program, I get an error message that says "no parser > found"--apparently it can't find the parsers to convert the XML GUI > description to Python code. It looks like at least one file, > xml_parse.pyc, didn't get copied into the bundle by py2app, which may > explain the problem. This doesn't exist when I run the program from a > folder (double-click wxglade.py), nor does it exist when I bundle it as > an applet (wxglade + all related files into an app bundle, but external > libraries/modules like wxPython left alone)--but all I do with the > applet bundle is copy all the wxglade files manually into the bundle > into the Resources folder, keeping the same directory structure > otherwise. I'm just not sure why that particular file isn't being > copied > when I run py2app. The first thing to check is: what imports it? The next is, how does it get imported? If it's not using the "import" statement, then it needs to be explicitly stated by way of recipe or include option. -bob From brad.allen at omsdal.com Thu Nov 11 19:55:08 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Thu Nov 11 19:55:53 2004 Subject: [Pythonmac-SIG] parsing system_profiler xml output Message-ID: I ran across a recent recipe from Brian Quinlan for parsing the XML output of the system_profiler command (the XML output feature was introduced in 10.3). Here is the URL, and I've pasted the source code at the bottom of this email. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303063 "system_profiler returns it's XML data info pinfo format so this recipe contains a partial pinfo parser. This recipe also requires PyXML to do the key-based querying..." I'm confused about this. The descriptive text says that PyXML is required, but the import statements don't refer to PyXML. Also, I think "pinfo format" is probably really plist, since that's the DTD referred to in the system_profiler output. Maybe there's a way to do this using plistlib instead. I would post my comments at the Python Cookbook site, but I'd rather clear up my cluelessness first. Any thoughts on this would be appreciated. Anyway, when I try to run the recipe, it fails with the following traceback: oms-ballen:/OMS/IT_Tools/scripts/misc python ballen$ python system_profiler_xml.py Traceback (most recent call last): File "system_profiler_xml.py", line 137, in ? main() File "system_profiler_xml.py", line 134, in main print '%s: %s' % (k, info[k][0]) File "system_profiler_xml.py", line 91, in __getitem__ from xml import xpath ImportError: cannot import name xpath -------------------------------------------------------------------- source code for this recipe ----------------------------- #!/usr/bin/env python from xml import dom from xml.dom.xmlbuilder import DOMInputSource, DOMBuilder import datetime import time import os def group(lst, n): """group([0,3,4,10,2,3], 2) => [(0,3), (4,10), (2,3)] Group a list into consecutive n-tuples. Incomplete tuples are discarded e.g. >>> group(range(10), 3) [(0, 1, 2), (3, 4, 5), (6, 7, 8)] """ return zip(*[lst[i::n] for i in range(n)]) def remove_whilespace_nodes(node, unlink=False): """Removes all of the whitespace-only text decendants of a DOM node. When creating a DOM from an XML source, XML parsers are required to consider several conditions when deciding whether to include whitespace-only text nodes. This function ignores all of those conditions and removes all whitespace-only text decendants of the specified node. If the unlink flag is specified, the removed text nodes are unlinked so that their storage can be reclaimed. If the specified node is a whitespace-only text node then it is left unmodified.""" remove_list = [] for child in node.childNodes: if child.nodeType == dom.Node.TEXT_NODE and \ not child.data.strip(): remove_list.append(child) elif child.hasChildNodes(): remove_whilespace_nodes(child) for node in remove_list: node.parentNode.removeChild(node) if unlink: node.unlink() class POpenInputSource(DOMInputSource): "Use stdout from a system command as a DOMInputSource" def __init__(self, command): super(DOMInputSource, self).__init__() self.byteStream = os.popen(command) class OSXSystemProfiler(object): "Provide information from the Mac OS X System Profiler" def __init__(self, detail=-1): """detail can range from -2 to +1, with larger numbers returning more information. Beware of +1, it can take several minutes for system_profiler to generate the data.""" b = DOMBuilder() self.document = b.parse( POpenInputSource('system_profiler -xml -detailLevel %d' % detail)) remove_whilespace_nodes(self.document, True) def _content(self, node): "Get the text node content of an element or an empty string" if node.firstChild: return node.firstChild.nodeValue else: return '' def _convert_value_node(self, node): """Convert a 'value' node (i.e. anything but 'key') into a Python data structure""" if node.tagName == 'string': return self._content(node) elif node.tagName == 'integer': return int(self._content(node)) elif node.tagName == 'real': return float(self._content(node)) elif node.tagName == 'date': # 2004-07-05T13:29:29Z return datetime.datetime( *time.strptime(self._content(node), '%Y-%m-%dT%H:%M:%SZ')[:5]) elif node.tagName == 'array': return [self._convert_value_node(n) for n in node.childNodes] elif node.tagName == 'dict': return dict([(self._content(n), self._convert_value_node(m)) for n, m in group(node.childNodes, 2)]) else: raise ValueError(node.tagName) def __getitem__(self, key): from xml import xpath # pyxml xpath does not support /element1[...]/element2 nodes = xpath.Evaluate( '//dict[key=%r]' % key, self.document) results = [] for node in nodes: v = self._convert_value_node(node)[key] if isinstance(v, dict) and v.has_key('_order'): # this is just information for display pass else: results.append(v) return results def all(self): """Return the complete information from the system profiler as a Python data structure""" return self._convert_value_node( self.document.documentElement.firstChild) def main(): from optparse import OptionParser from pprint import pprint info = OSXSystemProfiler() parser = OptionParser() parser.add_option("-f", "--field", action="store", dest="field", help="display the value of the specified field") (options, args) = parser.parse_args() if len(args) != 0: parser.error("no arguments are allowed") if options.field is not None: pprint(info[options.field]) else: # just print some comment keys known to exist in only one important # dictionary for k in ['cpu_type', 'current_processor_speed', 'l2_cache_size', 'physical_memory', 'user_name', 'os_version', 'ip_address']: print '%s: %s' % (k, info[k][0]) if __name__ == '__main__': main() From eichin at metacarta.com Thu Nov 11 21:32:52 2004 From: eichin at metacarta.com (eichin@metacarta.com) Date: Thu Nov 11 21:33:00 2004 Subject: [Pythonmac-SIG] parsing system_profiler xml output In-Reply-To: References: Message-ID: <7gpt2kazyj.fsf@pikespeak.metacarta.com> > format" is probably really plist, since that's the DTD referred to in the > system_profiler output. Maybe there's a way to do this using plistlib > instead. plistlib as-shipped is missing a bunch of things; system profiler output fails on File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/plistlib.py", line 356, in begin_array self.addObject(a) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/plistlib.py", line 326, in addObject assert self.root is value AssertionError which I've seen before but not traced. iTunes plist importing also fails, but that's due to: >>> from xml.utils.iso8601 import parse Traceback (most recent call last): File "", line 1, in ? ImportError: No module named utils.iso8601 in plistlib.Date.__init__ and toString. That's at least easy to kludge around - just copy the definition of plistlib.Date, and make it pass the date strings back as strings. (as for the other part, Python's XML story is wierd - when PyXML is installed it drops some new things into the xml namespace, so having "import xml" work doesn't actually tell you anything useful.) From bob at redivi.com Thu Nov 11 21:45:17 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Nov 11 21:45:27 2004 Subject: [Pythonmac-SIG] parsing system_profiler xml output In-Reply-To: <7gpt2kazyj.fsf@pikespeak.metacarta.com> References: <7gpt2kazyj.fsf@pikespeak.metacarta.com> Message-ID: <986B5220-3422-11D9-B23B-000A95BA5446@redivi.com> On Nov 11, 2004, at 15:32, eichin@metacarta.com wrote: > >> format" is probably really plist, since that's the DTD referred to in >> the >> system_profiler output. Maybe there's a way to do this using plistlib >> instead. > > plistlib as-shipped is missing a bunch of things; system profiler > output fails on > > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/plat-mac/plistlib.py", line 356, in begin_array > self.addObject(a) > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/plat-mac/plistlib.py", line 326, in addObject > assert self.root is value > AssertionError If this doesn't work with Python 2.4's plistlib, then the output of system profiler is not correct. I'm at least 90% sure that Python 2.4's plistlib correctly reads and writes all valid plists. > which I've seen before but not traced. iTunes plist importing also > fails, but that's due to: > >>>> from xml.utils.iso8601 import parse > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named utils.iso8601 > > in plistlib.Date.__init__ and toString. That's at least easy to > kludge around - just copy the definition of plistlib.Date, and make it > pass the date strings back as strings. plistlib.Date, among other things, was broken before Python 2.4b2, even if you had PyXML installed. Get the version from Python 2.4. (it is backwards compatible). > (as for the other part, Python's XML story is wierd - when PyXML is > installed it drops some new things into the xml namespace, so having > "import xml" work doesn't actually tell you anything useful.) import _xmlplus is the correct way to detect the presence of PyXML. -bob From eichin at metacarta.com Thu Nov 11 23:34:02 2004 From: eichin at metacarta.com (eichin@metacarta.com) Date: Thu Nov 11 23:34:05 2004 Subject: [Pythonmac-SIG] parsing system_profiler xml output In-Reply-To: <986B5220-3422-11D9-B23B-000A95BA5446@redivi.com> References: <7gpt2kazyj.fsf@pikespeak.metacarta.com> <986B5220-3422-11D9-B23B-000A95BA5446@redivi.com> Message-ID: <7gekj0aucl.fsf@pikespeak.metacarta.com> > If this doesn't work with Python 2.4's plistlib, then the output of > system profiler is not correct. I'm at least 90% sure that Python > 2.4's plistlib correctly reads and writes all valid plists. Oh, excellent. I was quoting from the stock 2.3 install on 10.3.6, so it's good to know that 2.4 fixes this (esp. if it's in Tiger...) sys.version: '2.3 (#1, Sep 13 2003, 00:49:11) \n[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)]' From bob at redivi.com Thu Nov 11 23:56:58 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Nov 11 23:57:05 2004 Subject: [Pythonmac-SIG] parsing system_profiler xml output In-Reply-To: <7gekj0aucl.fsf@pikespeak.metacarta.com> References: <7gpt2kazyj.fsf@pikespeak.metacarta.com> <986B5220-3422-11D9-B23B-000A95BA5446@redivi.com> <7gekj0aucl.fsf@pikespeak.metacarta.com> Message-ID: On Nov 11, 2004, at 17:34, eichin@metacarta.com wrote: > >> If this doesn't work with Python 2.4's plistlib, then the output of >> system profiler is not correct. I'm at least 90% sure that Python >> 2.4's plistlib correctly reads and writes all valid plists. > > Oh, excellent. I was quoting from the stock 2.3 install on 10.3.6, so > it's good to know that 2.4 fixes this (esp. if it's in Tiger...) > > sys.version: '2.3 (#1, Sep 13 2003, 00:49:11) \n[GCC 3.3 20030304 > (Apple Computer, Inc. build 1495)]' Yes, I know you were talking about Python 2.3.. I'm just saying, if it STILL doesn't work, then system profiler is broken (emitting XML not compliant with the DTD). plistlib should no longer be broken because it was somewhat recently audited by (at least) Just and I, with fixes committed to CVS by Just before Python 2.4b2. Python 2.4 in Tiger wouldn't necessarily be a good thing anyway. 2.3.4 would be MUCH better for the compatibility reasons, with 2.4 being optional for the people who want it. Public information (posted darwin source) says that the WWDC build of Tiger had Python 2.3.3. Think of it this way: if Apple included 2.4, they probably wouldn't also include 2.3 (following their record of not including 2.2 in 10.3, and with other languages). This would break nearly every Python-based Application built on Panther since they are primarily semi-standalone. These applications would otherwise work, because 2.3.0 -> 2.3.x is binary compatible. Keeping 2.3 also allows Python-based applications built on Tiger to be deployed on Panther to a large degree (unless extensions are included with 10.4 specific features). Also, this would BREAK Apple's record of shipping painfully broken releases of Python with OS X releases. 2.2.0 (10.2) was broken beyond comprehension, and 2.3.0 (10.3) is quite crippled with regard to living hospitably with other installations of Python 2.3 due to unfortunate linker options and an incorrect mechanism for determining the path of the current interpreter. These bugs, and more, were all fixed by 2.3.3, with 2.3.4 having a couple additional bug fixes that probably don't matter as much. -bob From brad.allen at omsdal.com Fri Nov 12 01:45:13 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Fri Nov 12 01:46:07 2004 Subject: [Pythonmac-SIG] parsing system_profiler xml output In-Reply-To: <986B5220-3422-11D9-B23B-000A95BA5446@redivi.com> Message-ID: eichin@metacarta.com wrote: > > (as for the other part, Python's XML story is wierd - when PyXML is > > installed it drops some new things into the xml namespace, so having > > "import xml" work doesn't actually tell you anything useful.) Ah, thanks for the clarification. Bob Ippolito wrote: > import _xmlplus is the correct way to detect the presence of PyXML. I tried this, which didn't work on my system, so I guess PyXML is not part of the Panther Python distribution. I don't really want to fuss with distributing this to all our Macs if I can avoid it. Bob Ippolito wrote: > If this doesn't work with Python 2.4's plistlib, then the output of > system profiler is not correct. I'm at least 90% sure that Python > 2.4's plistlib correctly reads and writes all valid plists. Well, you may be right. I don't have an XML validator handy at the moment, but I tried your updated, bug-fixed plistlib on the full output of system_profiler -xml. It failed, but I didn't get the same traceback as eichin. Also, plistlib worked beautifully on partial output of system_profiler, such as system_profiler -SPNetworkDataType -xml. Here's what I did: At the bash prompt, ran: system_profiler -xml > /Users/ballen/system_profiler_output.plist In Python: import pyDesktopConfig.plistlibTest as plistlib plistDict = plistlib.readPlist('/Users/ballen/system_profiler_output.plist') ....after which I received the following error: oms-ballen:/OMS/IT_Tools/scripts/managedScript/pythonTools ballen$ python tester2.py Traceback (most recent call last): File "tester2.py", line 60, in ? plistDict = plistlib.readPlist('/Users/ballen/spoutput.txt') File "/OMS/IT_Tools/scripts/managedScript/pythonTools/pyDesktopConfig/plistlibTest.py", line 79, in readPlist rootObject = p.parse(pathOrFile) File "/OMS/IT_Tools/scripts/managedScript/pythonTools/pyDesktopConfig/plistlibTest.py", line 383, in parse parser.ParseFile(fileobj) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 13031, column 15 Next, I tried: In Bash: system_profiler SPNetworkDataType -xml > spNetwork.plist In Python: plistDict = plistlib.readPlist('/Users/ballen/spNetwork.plist') print plistDict [{'_timeStamp': Date('2004-11-12T35:16:00Z'), '_detailLevel': -1, '_items': [{'domain': 'omsdal.com', 'dns_servers': ['10.100.1.48', '10.100.1.35'], 'router_address': '10.100.32.1', 'broadcast_address': ['10.100.32.255'], 'type': 'Ethernet', 'ethernet_address': '00:0a:93:9d:76:f8', '_name': 'Built-in Ethernet', 'subnet_mask': ['255.255.255.0'], 'interface': 'en0', 'ip_address': ['10.100.32.81']}, {'interface': 'modem', 'type': 'PPP (PPPSerial)', '_name': 'Internal Modem'}, {'interface': 'en1', 'type': 'AirPort', 'ethernet_address': '00:31:62:0b:47:34', '_name': 'AirPort'}], '_dataType': 'SPNetworkDataType', '_properties': {'domain': {'_order': '80'}, 'dns_servers': {'_order': '70'}, 'router_address': {'_order': '60'}, 'broadcast_address': {'_order': '50'}, 'type': {'_order': '20', '_isColumn': 'YES', '_width': '100'}, 'ethernet_address': {'_order': '90'}, '_name': {'_order': '0', '_isColumn': 'YES', '_width': '100'}, 'subnet_mask': {'_order': '40'}, 'interface': {'_order': '10', '_isColumn': 'YES', '_width': '100'}, 'destination_address': {'_order': '35'}, 'ip_address': {'_order': '30', '_isColumn': 'YES', '_width': '100'}}}] Very nice! From bob at redivi.com Fri Nov 12 04:01:52 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Nov 12 04:02:31 2004 Subject: [Pythonmac-SIG] parsing system_profiler xml output In-Reply-To: References: Message-ID: <33F7144C-3457-11D9-8D4D-000A9567635C@redivi.com> On Nov 11, 2004, at 7:45 PM, brad.allen@omsdal.com wrote: > eichin@metacarta.com wrote: >>> (as for the other part, Python's XML story is wierd - when PyXML is >>> installed it drops some new things into the xml namespace, so having >>> "import xml" work doesn't actually tell you anything useful.) > > Ah, thanks for the clarification. > > Bob Ippolito wrote: >> import _xmlplus is the correct way to detect the presence of PyXML. > > I tried this, which didn't work on my system, so I guess PyXML is not > part > of the Panther Python distribution. I don't really want to fuss with > distributing this to all our Macs if I can avoid it. PyXML is not part of any standard distribution, it's a third party "extension" to Python's XML support. The way it integrates with the standard library is stupid. > Bob Ippolito wrote: >> If this doesn't work with Python 2.4's plistlib, then the output of >> system profiler is not correct. I'm at least 90% sure that Python >> 2.4's plistlib correctly reads and writes all valid plists. > > Well, you may be right. I don't have an XML validator handy at the > moment, > but I tried your updated, bug-fixed plistlib on the full output of > system_profiler -xml. It failed, but I didn't get the same traceback as > eichin. Also, plistlib worked beautifully on partial output of > system_profiler, such as system_profiler -SPNetworkDataType -xml. > > Here's what I did: > > At the bash prompt, ran: system_profiler -xml > > /Users/ballen/system_profiler_output.plist > > In Python: > import pyDesktopConfig.plistlibTest as plistlib > plistDict = > plistlib.readPlist('/Users/ballen/system_profiler_output.plist') > > > ....after which I received the following error: > > xml.parsers.expat.ExpatError: not well-formed (invalid token): line > 13031, > column 15 That's actually lower level than the DTD. Python's XML parser doesn't think the XML is well formed *at all*. Looking at the XML, it seems that Apple uses some low-ascii characters like this: 'Nov 11 19:09:50 crack-wlan kernel: \x10ADB present:8c' expat, the low level parser behind Python's default XML handling capabilities, does not like this at all. I believe this is probably a bug in expat. You can see this if you do: import xml.dom.minidom xml.dom.minidom.parseString('\x10') I'm not 100% sure if this is Apple's or Expat's fault, but you have a couple options: (a) Use Apple's plist parser via PyObjC instead (painfully easy to do and WAY faster than plistlib) (b) Throw away characters expat isn't going to understand, a correct implementation is probably close to this: import re SKIP = map(ord, u'\t\r\n\f\v') REFORMAT = re.compile( u'(%s)' % (u'|'.join([unichr(x) for x in range(1, ord(u' ')) if x not in SKIP]),) ) def reformat(s): return REFORMAT.sub(u'', s) plistString = reformat(file('system_profiler.xml').read().decode('utf -8')).encode('utf-8') -bob From just at letterror.com Fri Nov 12 08:44:49 2004 From: just at letterror.com (Just van Rossum) Date: Fri Nov 12 08:44:46 2004 Subject: [Pythonmac-SIG] parsing system_profiler xml output In-Reply-To: <33F7144C-3457-11D9-8D4D-000A9567635C@redivi.com> Message-ID: Bob Ippolito wrote: > That's actually lower level than the DTD. Python's XML parser doesn't > think the XML is well formed *at all*. Looking at the XML, it seems > that Apple uses some low-ascii characters like this: > > 'Nov 11 19:09:50 crack-wlan kernel: \x10ADB present:8c' > > expat, the low level parser behind Python's default XML handling > capabilities, does not like this at all. I believe this is probably a > bug in expat. The XML spec suggests it's an Apple bug: http://www.w3.org/TR/REC-xml/#charsets """Legal characters are tab, carriage return, line feed, and the legal characters of Unicode and ISO/IEC 10646.""" Interesting article: http://www.awprofessional.com/articles/article.asp?p=169537&seqNum=2 Just From just at letterror.com Fri Nov 12 11:29:48 2004 From: just at letterror.com (Just van Rossum) Date: Fri Nov 12 11:29:45 2004 Subject: [Pythonmac-SIG] parsing system_profiler xml output In-Reply-To: Message-ID: Just van Rossum wrote: > Bob Ippolito wrote: > > > That's actually lower level than the DTD. Python's XML parser > > doesn't think the XML is well formed *at all*. Looking at the XML, > > it seems that Apple uses some low-ascii characters like this: > > > > 'Nov 11 19:09:50 crack-wlan kernel: \x10ADB present:8c' > > > > expat, the low level parser behind Python's default XML handling > > capabilities, does not like this at all. I believe this is > > probably a bug in expat. > > The XML spec suggests it's an Apple bug: > http://www.w3.org/TR/REC-xml/#charsets > > """Legal characters are tab, carriage return, line feed, and the legal > characters of Unicode and ISO/IEC 10646.""" FWIW, I filed a bug with Apple, #3877177. Just From tea2 at cornell.edu Thu Nov 11 21:12:58 2004 From: tea2 at cornell.edu (Terry Acree) Date: Fri Nov 12 13:18:22 2004 Subject: [Pythonmac-SIG] BLT 2.4 into Python 23 on XP Message-ID: <14B0C97A-341E-11D9-ACAE-003065ED33E8@cornell.edu> Help I need to install BLT on winXP and I can't find the right path for the installer to follow. ...or I need to know more. after running the wizard a simple test program with Pmw.Blt.... yields "...no Blt module.." Thanks Terry From Jack.Jansen at cwi.nl Fri Nov 12 14:14:28 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Nov 12 14:14:55 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac installer available In-Reply-To: <4191EAFB.3050801@wordtech-software.com> References: <4191EAFB.3050801@wordtech-software.com> Message-ID: On 10 Nov 2004, at 11:18, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > PyQt-Mac is a binary installer of the various components of Qt and PyQt > for Mac OS X. Included are the following: > ? > * A complete build of Qt/Mac with QScintilla support. > ? > * A compiled binary of Sip, the application that converts Qt's C++ base > into Python bindings. > ? > * PyQt. > ? > * Eric 3, an integrated development environment (IDE) for Python > written > with the PyQt toolkit. It doesn't seem to work for me:-( First, and least important, there's a typo in the instructions. You say to do the following after installation: cd /Developer/qt/pyqt-mac-source/PyQt-mac-gpl-3.1.3 sudo make install That first directory should be PyQt-mac-gpl-3.13 When I had done all that I tried Eric 3, but it quit after bouncing a few times. Then I tried it from the command line, with: QTDIR=/Developer/qt PATH=$QTDIR/bin:$PATH DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH /Applications/Eric\ 3.app/Contents/MacOS/Eric\ 3 but it still complained about not being able to find libqt-mt.3.dylib. Inspection of /Developer/qt/lib indeed did not reveal this file: libqt-mt.a and libqt-mt.la are available, but the dylib is missing. -- 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 sw at wordtech-software.com Fri Nov 12 14:21:45 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Fri Nov 12 14:21:49 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac installer available In-Reply-To: References: <4191EAFB.3050801@wordtech-software.com> Message-ID: <4194B8E9.60705@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Yes, I'm aware of that problem--a lot of bug reports. :-) I've spent the past 12 hours recompiling Qt with threading support. I hope to have another installer ready to go today. I'll fix the typo in the instructions. Thanks. Jack Jansen wrote: | | On 10 Nov 2004, at 11:18, Kevin Walzer wrote: | |> -----BEGIN PGP SIGNED MESSAGE----- |> Hash: SHA1 |> |> PyQt-Mac is a binary installer of the various components of Qt and PyQt |> for Mac OS X. Included are the following: |> ? |> * A complete build of Qt/Mac with QScintilla support. |> ? |> * A compiled binary of Sip, the application that converts Qt's C++ base |> into Python bindings. |> ? |> * PyQt. |> ? |> * Eric 3, an integrated development environment (IDE) for Python written |> with the PyQt toolkit. | | | It doesn't seem to work for me:-( | | First, and least important, there's a typo in the instructions. You say | to do the following after installation: | cd /Developer/qt/pyqt-mac-source/PyQt-mac-gpl-3.1.3 | sudo make install | That first directory should be PyQt-mac-gpl-3.13 | | When I had done all that I tried Eric 3, but it quit after bouncing a | few times. Then I tried it from the command line, with: | QTDIR=/Developer/qt | PATH=$QTDIR/bin:$PATH | DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH | /Applications/Eric\ 3.app/Contents/MacOS/Eric\ 3 | but it still complained about not being able to find libqt-mt.3.dylib. | | Inspection of /Developer/qt/lib indeed did not reveal this file: | libqt-mt.a and libqt-mt.la are available, but the dylib is missing. | | -- | Jack Jansen, , http://www.cwi.nl/~jack | If I can't dance I don't want to be part of your revolution -- Emma Goldman | | | - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBlLjpJmdQs+6YVcoRAm9vAJ9KSZNN66Mj6ed/NZMxyx309yk76wCeMBX/ dnlAW2k5rtIU7+s1CTFkeZg= =MeAZ -----END PGP SIGNATURE----- From bob at redivi.com Fri Nov 12 18:39:58 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Nov 12 18:40:35 2004 Subject: [Pythonmac-SIG] Numeric 23.6 and vecLib (Apple's optimized implementation of BLAS) Message-ID: I've patched Numeric 23.6's setup.py to link against Apple's BLAS implementation. It shouldn't cause any problems for other platforms: http://undefined.org/python/mpkg/patch/Numeric-23.6/setup.py A Numeric 23.6 installer for Mac OS X 10.3 and later (using the stock Python 2.3 interpreter), built with py2app 0.1.5's bdist_mpkg command: http://undefined.org/python/mpkg/python2.3/Numeric-23.6.mpkg.zip -bob From Ludger.Humbert at uni-dortmund.de Fri Nov 12 20:06:57 2004 From: Ludger.Humbert at uni-dortmund.de (Dr. Ludger Humbert) Date: Fri Nov 12 20:06:54 2004 Subject: [Pythonmac-SIG] Looking for OpenOffice driven by python 2.3 Message-ID: <419509D1.5010106@uni-dortmund.de> Hi, is there anyone out there, who had success in replacing the delivered python, which comes with OpenOffice? If you don't know what I'm taking about, you may look at: http://udk.openoffice.org/python/python-bridge.html#replacing Why do we need it? We are running ponto to enable pupils (6 grades) to work with python and to realize, that there are concepts (which may turn in "mental models" - we hope) http://ddi.cs.uni-dortmund.de/projekte/ponto [it will be published in the next few days - at the moment you'll find a description of the project] But there is a main drwaback: pupils should be enabled to use rlcompleter when they are working with python to create their documents. So we need python, which supports py uno bridge on one side, but readline too. Pls help us the pupils need our support Ludger Humbert From bob at redivi.com Fri Nov 12 20:13:52 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Nov 12 20:14:26 2004 Subject: [Pythonmac-SIG] Looking for OpenOffice driven by python 2.3 In-Reply-To: <419509D1.5010106@uni-dortmund.de> References: <419509D1.5010106@uni-dortmund.de> Message-ID: On Nov 12, 2004, at 2:06 PM, Dr. Ludger Humbert wrote: > is there anyone out there, who had success in > replacing the delivered python, which comes with OpenOffice? How are you installing OOo in the first place? -bob From Ludger.Humbert at uni-dortmund.de Fri Nov 12 20:35:23 2004 From: Ludger.Humbert at uni-dortmund.de (Dr. Ludger Humbert) Date: Fri Nov 12 20:35:14 2004 Subject: [Pythonmac-SIG] Looking for OpenOffice driven by python 2.3 In-Reply-To: References: <419509D1.5010106@uni-dortmund.de> Message-ID: <4195107B.5060706@uni-dortmund.de> Bob Ippolito wrote: > How are you installing OOo in the first place? As mentioned on http://porting.openoffice.org/mac/ooo-osx_downloads.html#download we got OpenOffice.org 1.1.2 MacOS X (X11) | 155 MB and installed it, as suggested. Ludger From twl at sauria.com Sat Nov 13 00:05:35 2004 From: twl at sauria.com (Ted Leung) Date: Sat Nov 13 00:05:40 2004 Subject: [Pythonmac-SIG] multiple pythons on one machine Message-ID: <5C43BC04-34FF-11D9-B4C3-000A959A114E@sauria.com> Okay, I'm getting to the point where I think I'm going to end up with multiple Python's on my system (not including the chandler one): 1. Apple's 2. the one from fink -- i've been trying not to install this one because I wasn't sure about bad interactions 3. 2.4b2 Right now I only have #1 installed. Are there any issues I need to be aware of before I try and install 2 and 3 (I expect to have to build this one). I'm also under the impression that 2.4b2 will build as a framework by default, so does that mean I should apply Bob's patch: in order to not mess up the Apple Python? I assume that I can install distutils based packages into the various pythons by using the correct python to run setup.py I know that this is a FAQ, and I looked through some old messages and the FAQ, but I still feel a bit uncomfortable. (I'd be happy to try to improve the FAQ on the wiki). ---- Ted Leung Blog: PGP Fingerprint: 1003 7870 251F FA71 A59A CEE3 BEBA 2B87 F5FC 4B42 From Chris.Barker at noaa.gov Sat Nov 13 00:11:12 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Sat Nov 13 00:13:16 2004 Subject: [Pythonmac-SIG] Numeric 23.6 and vecLib (Apple's optimized implementation of BLAS) In-Reply-To: References: Message-ID: <41954310.2050003@noaa.gov> Bob Ippolito wrote: > I've patched Numeric 23.6's setup.py to link against Apple's BLAS > implementation. It shouldn't cause any problems for other platforms: > http://undefined.org/python/mpkg/patch/Numeric-23.6/setup.py cool! Have you sent this to the Numeric folks? the setup.py has beena bit broken in the last couple of releases anyway, I don't know who's supposed to be maintaining it, but I"d love to see this get into the next release. -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 bob at redivi.com Sat Nov 13 14:44:07 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Nov 13 14:44:49 2004 Subject: [Pythonmac-SIG] multiple pythons on one machine In-Reply-To: <5C43BC04-34FF-11D9-B4C3-000A959A114E@sauria.com> References: <5C43BC04-34FF-11D9-B4C3-000A959A114E@sauria.com> Message-ID: <171AEBD4-357A-11D9-B683-000A9567635C@redivi.com> On Nov 13, 2004, at 12:05 AM, Ted Leung wrote: > Okay, > > I'm getting to the point where I think I'm going to end up with > multiple Python's on my system (not including the chandler one): > > 1. Apple's > 2. the one from fink -- i've been trying not to install this one > because I wasn't sure about bad interactions I'd recommend against using any Python from fink or darwinports from experience, but if some other package needs it.. then just make sure that /usr/bin comes before /sw/bin or /opt/local/bin in your path. > 3. 2.4b2 > > Right now I only have #1 installed. Are there any issues I need to be > aware of before I try and install 2 and 3 (I expect to have to build > this one). I'm also under the impression that 2.4b2 will build as a > framework by default, so does that mean I should apply Bob's patch: > 011695.html> in order to not mess up the Apple Python? > > I assume that I can install distutils based packages into the various > pythons by using the correct python to run setup.py If you don't apply the patch, then installing #3 will DEFINITELY break building extensions for #1. Note that you also need to set the "MACOSX_DEPLOYMENT_TARGET" environment variable to "10.3" when using this patch. After applying the patch, you should probably rebuild all of your third party extension modules just to be safe. I have #1 and #3 coexisting peacefully on three machines (patch applied).. one of the machines also has a darwinports python installed, but /opt/local/bin comes late in the path. -bob From bob at redivi.com Sat Nov 13 14:46:01 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Nov 13 14:46:41 2004 Subject: [Pythonmac-SIG] Numeric 23.6 and vecLib (Apple's optimized implementation of BLAS) In-Reply-To: <41954310.2050003@noaa.gov> References: <41954310.2050003@noaa.gov> Message-ID: <5AF89E8C-357A-11D9-B683-000A9567635C@redivi.com> On Nov 13, 2004, at 12:11 AM, Chris Barker wrote: > Bob Ippolito wrote: >> I've patched Numeric 23.6's setup.py to link against Apple's BLAS >> implementation. It shouldn't cause any problems for other platforms: >> http://undefined.org/python/mpkg/patch/Numeric-23.6/setup.py > > cool! Have you sent this to the Numeric folks? the setup.py has beena > bit broken in the last couple of releases anyway, I don't know who's > supposed to be maintaining it, but I"d love to see this get into the > next release. No, I have not.. but feel free to do it for me. I'm currently out of the country and will probably forget to do it when I get back in two weeks. You're right though, the setup.py looks like it pretty much assumes you have ATLAS, so I'm sure it would be broken for quite a few people (where it would previously work just fine without it). -bob From fgranger at fgranger.com Sat Nov 13 16:11:47 2004 From: fgranger at fgranger.com (Fran=?ISO-8859-1?B?5w==?=ois Granger) Date: Sat Nov 13 16:11:53 2004 Subject: [Pythonmac-SIG] IDLE Message-ID: I am on MacOSX 10.3.6 I installed TclTkAqua 8.4.7 from SourceForge http://sourceforge.net/project/showfiles.php?group_id=86100&release_id=21946 0 I launched IDLE and played with the font preferences and menu commands with just a small script opened. It crashed after five minutes. Is IDLE usable on Mac ? If the answer is yes, which versions of the various components are recommended ? -- Fran?ois Granger fgranger@fgranger.com + 33 6 61 36 96 17 (mobile) + 33 1 47 35 00 16 (home) From enrike at altern.org Sun Nov 14 11:16:52 2004 From: enrike at altern.org (altern) Date: Sun Nov 14 11:16:26 2004 Subject: [Pythonmac-SIG] wx + opengl weirdness In-Reply-To: <5C43BC04-34FF-11D9-B4C3-000A959A114E@sauria.com> References: <5C43BC04-34FF-11D9-B4C3-000A959A114E@sauria.com> Message-ID: <41973094.2090506@altern.org> hi I am getting some strange error on an application i am porting from windows. I am creating a menu and the window that contains the opengl displays an empty many frame like if it was trying to have the menu in the top of it, like it does in Windows. i also get an strange empty area whitin the opengl area that displays the background color i set but i cannot draw on it please check the arrows on this screenshot http://www.ixi-software.net/alpha/wx_gl_app.gif I was wondering if this is a normal bug of the menu or if i am doing something wrong. This was working perfetly under windows. I was checking a bug list on mac wx but this was not mentioned. thanks -- enrike From brad.allen at omsdal.com Mon Nov 15 18:06:05 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Mon Nov 15 18:07:07 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks Message-ID: I read somewhere that the "mv" command doesn't properly handle files with resource forks. Is this likely to be true with Python's os.rename ? If so, what is the recommended method to move or rename files? I'd prefer not to use MvMac since most of the computers I administer do not have the Apple developer tools installed. Thanks! From bob at redivi.com Mon Nov 15 18:14:08 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Nov 15 18:14:18 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: References: Message-ID: On Nov 15, 2004, at 7:06 PM, brad.allen@omsdal.com wrote: > I read somewhere that the "mv" command doesn't properly handle files > with > resource forks. Is this likely to be true with Python's os.rename ? If > so, > what is the recommended method to move or rename files? I'd prefer not > to > use MvMac since most of the computers I administer do not have the > Apple > developer tools installed. > > Thanks! No POSIX functions handle files with resource forks, and Python's os module on OS X and several other operating systems is all POSIX code. You have three options: 1. Use command line tools that understand forks (MvMac, etc.), this is a bad idea 2. Use NSFileManager from PyObjC 3. Use the Carbon functions (probably in the Carbon.File module). #2 is definitely the easiest, #3 works on a stock installation. -bob From berkowit at silcom.com Mon Nov 15 18:15:51 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Mon Nov 15 18:15:57 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: Message-ID: On 11/15/04 9:06 AM, "brad.allen@omsdal.com" wrote: > I read somewhere that the "mv" command doesn't properly handle files with > resource forks. Is this likely to be true with Python's os.rename ? If so, > what is the recommended method to move or rename files? I'd prefer not to > use MvMac since most of the computers I administer do not have the Apple > developer tools installed. ditto -rsrc will copy files complete with resource forks, on all Macs - no special tools required. Then rm the original. -- Paul Berkowitz From brad.allen at omsdal.com Mon Nov 15 18:23:16 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Mon Nov 15 18:24:20 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: Message-ID: Bob Ippolito wrote on 11/15/2004 11:14:08 AM: > No POSIX functions handle files with resource forks, and Python's os > module on OS X and several other operating systems is all POSIX code. > > You have three options: > 1. Use command line tools that understand forks (MvMac, etc.), this is > a bad idea > 2. Use NSFileManager from PyObjC > 3. Use the Carbon functions (probably in the Carbon.File module). > > #2 is definitely the easiest, #3 works on a stock installation. All roads lead to PyObjC. Learning a little Cocoa keeps climbing higher and higher on my to-do list. From brad.allen at omsdal.com Mon Nov 15 18:36:40 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Mon Nov 15 18:37:40 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: Message-ID: Paul Berkowitz wrote: > ditto -rsrc > > will copy files complete with resource forks, on all Macs - no special tools > required. Then rm the original. Yes, that's great for copying, but not for move/rename. In this case, until I have implemented a better way, I'm using ditto as a very inefficient "move" by deleting files from one directory and using ditto -rsrc to copy to a different directory. From berkowit at silcom.com Mon Nov 15 18:44:26 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Mon Nov 15 18:44:53 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: Message-ID: On 11/15/04 9:36 AM, "brad.allen@omsdal.com" wrote: > > Paul Berkowitz wrote: > >> ditto -rsrc >> >> will copy files complete with resource forks, on all Macs - no special > tools >> required. Then rm the original. > > Yes, that's great for copying, but not for move/rename. In this case, until > I have implemented a better way, I'm using ditto as a very inefficient > "move" by deleting files from one directory and using ditto -rsrc to copy > to a different directory. But that's exactly what 'move' commands do behind the scenes anyway - copy and delete original. It's not in the least inefficient doing it explicitly yourself - it's just one more line of code to rm. It's a minor nuisance for renaming. -- Paul Berkowitz From mark.asbach at post.rwth-aachen.de Mon Nov 15 18:49:28 2004 From: mark.asbach at post.rwth-aachen.de (Mark Asbach) Date: Mon Nov 15 18:49:35 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: References: Message-ID: <4198EC28.6090800@post.rwth-aachen.de> Hi Brad, hi list, >>ditto -rsrc > Yes, that's great for copying, but not for move/rename. In this case, until > I have implemented a better way, I'm using ditto as a very inefficient > "move" by deleting files from one directory and using ditto -rsrc to copy > to a different directory. You could just use the 'mv' command or its python equivalent to move the resource fork: it's accessible transparently via 'filename/RSRC' throughout the whole Mac OS posix APIs. That means mv somefile newdirectory/ test -d somefile/RSRC || mv somefile/RSRC newdirectory/ will do everything necessary on Mac OS X and just ignore the rest of the second line on other systems. Didn't try with Python, but it should work fine. Mark From bob at redivi.com Mon Nov 15 18:51:44 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Nov 15 18:51:55 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: References: Message-ID: <03641036-372F-11D9-8F3E-000A9567635C@redivi.com> On Nov 15, 2004, at 7:44 PM, Paul Berkowitz wrote: > On 11/15/04 9:36 AM, "brad.allen@omsdal.com" > wrote: > >> >> Paul Berkowitz wrote: >> >>> ditto -rsrc >>> >>> will copy files complete with resource forks, on all Macs - no >>> special >> tools >>> required. Then rm the original. >> >> Yes, that's great for copying, but not for move/rename. In this case, >> until >> I have implemented a better way, I'm using ditto as a very inefficient >> "move" by deleting files from one directory and using ditto -rsrc to >> copy >> to a different directory. > > But that's exactly what 'move' commands do behind the scenes anyway - > copy > and delete original. It's not in the least inefficient doing it > explicitly > yourself - it's just one more line of code to rm. It's a minor > nuisance for > renaming. Uh, wrong. At least not if the target and destination are on the same filesystem. Copy/Remove breaks aliases and hard links. Move does not. -bob From mark.asbach at post.rwth-aachen.de Mon Nov 15 18:56:41 2004 From: mark.asbach at post.rwth-aachen.de (Mark Asbach) Date: Mon Nov 15 18:57:15 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: <4198EC28.6090800@post.rwth-aachen.de> References: <4198EC28.6090800@post.rwth-aachen.de> Message-ID: <4198EDD9.7040203@post.rwth-aachen.de> Hi again, > mv somefile newdirectory/ > test -d somefile/RSRC || mv somefile/RSRC newdirectory/ Sorry, it should be: mv somefile newdirectory/ test -e somefile/RSRC || mv somefile/RSRC newdirectory/ Yours, Mark From bob at redivi.com Mon Nov 15 18:57:59 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Nov 15 18:58:08 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: <4198EC28.6090800@post.rwth-aachen.de> References: <4198EC28.6090800@post.rwth-aachen.de> Message-ID: On Nov 15, 2004, at 7:49 PM, Mark Asbach wrote: > Hi Brad, hi list, > >>> ditto -rsrc > >> Yes, that's great for copying, but not for move/rename. In this case, >> until >> I have implemented a better way, I'm using ditto as a very inefficient >> "move" by deleting files from one directory and using ditto -rsrc to >> copy >> to a different directory. > > You could just use the 'mv' command or its python equivalent to move > the resource fork: it's accessible transparently via 'filename/RSRC' > throughout the whole Mac OS posix APIs. That means > > mv somefile newdirectory/ > test -d somefile/RSRC || mv somefile/RSRC newdirectory/ > > will do everything necessary on Mac OS X and just ignore the rest of > the second line on other systems. > > Didn't try with Python, but it should work fine. I'm pretty sure that method is only supposed to work with HFS filesystems, and you're not supposed to do it (especially like that). The correct way is to use fn/..namedfork/rsrc - but in any case it is a private implementation detail, not a public API that you should use. (this is in an #ifdef __APPLE_API_PRIVATE) ./sys/paths.h:#define _PATH_RSRCFORKSPEC "/..namedfork/rsrc" -bob From berkowit at silcom.com Mon Nov 15 19:14:12 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Mon Nov 15 19:14:15 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: <4198EC28.6090800@post.rwth-aachen.de> Message-ID: On 11/15/04 9:49 AM, "Mark Asbach" wrote: > You could just use the 'mv' command or its python equivalent to move the > resource fork: it's accessible transparently via 'filename/RSRC' throughout > the whole Mac OS posix APIs. That means > > mv somefile newdirectory/ > test -d somefile/RSRC || mv somefile/RSRC newdirectory/ > > will do everything necessary on Mac OS X and just ignore the rest of the > second line on other systems. Can you explain the first part (I don't know how this works on straight Unix)? It looks to me as if this means that on non-Mac OS X systems all files would be expected to have RSRC directories?? Or is it just that even if the first part is false, the second part doesn't raise an error even though somefile/RSRC doesn't exist? No need to test without the -d switch? -- Paul Berkowitz From berkowit at silcom.com Mon Nov 15 19:14:53 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Mon Nov 15 19:14:58 2004 Subject: [Pythonmac-SIG] move/rename files w resource forks In-Reply-To: <4198EDD9.7040203@post.rwth-aachen.de> Message-ID: On 11/15/04 9:56 AM, "Mark Asbach" wrote: > Hi again, > >> mv somefile newdirectory/ >> test -d somefile/RSRC || mv somefile/RSRC newdirectory/ > > Sorry, it should be: > > mv somefile newdirectory/ > test -e somefile/RSRC || mv somefile/RSRC newdirectory/ Ah. OK. -- Paul Berkowitz From Chris.Barker at noaa.gov Mon Nov 15 21:40:27 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Mon Nov 15 21:42:32 2004 Subject: [Pythonmac-SIG] Where did Python.h come from? Message-ID: <4199143B.8060801@noaa.gov> Hi all, I'm trying to help a friend install Scientific Python on his OS-X 10.3 box, and it can't find Python.h. On my system, I have a whole bunch of stuff (including Python.h) in my: /System/Library/Frameworks/Python.Framework/Versions/2.3/include directory, but he doesn't. Where did all those *.h files come from? How do I install them on his machine? I don't remember doing anything special on mine. -thanks, 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 cmeesters at ucdavis.edu Tue Nov 16 01:15:44 2004 From: cmeesters at ucdavis.edu (Christian Meesters) Date: Tue Nov 16 01:15:28 2004 Subject: [Pythonmac-SIG] installing Numeric Message-ID: Hi I was about to install the Numeric module (not Numarray!) and for that LPACK is missing. Now, for installing LPACK one needs a f77-Compiler. Does anybody know how to rewrite the make.inc if you have gcc? I've seen a few older examples, but after checking them I'm completely confused. Thanks a lot in advance, Christian From bob at redivi.com Tue Nov 16 05:07:57 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 16 05:08:36 2004 Subject: [Pythonmac-SIG] Where did Python.h come from? In-Reply-To: <4199143B.8060801@noaa.gov> References: <4199143B.8060801@noaa.gov> Message-ID: <18FEA5EC-3785-11D9-9BE2-000A9567635C@redivi.com> On Nov 15, 2004, at 10:40 PM, Chris Barker wrote: > I'm trying to help a friend install Scientific Python on his OS-X 10.3 > box, and it can't find Python.h. > > On my system, I have a whole bunch of stuff (including Python.h) in my: > > /System/Library/Frameworks/Python.Framework/Versions/2.3/include > > directory, but he doesn't. Where did all those *.h files come from? > How do I install them on his machine? I don't remember doing anything > special on mine. Did he forget to install Xcode? :) -bob From bob at redivi.com Tue Nov 16 05:09:30 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 16 05:09:34 2004 Subject: [Pythonmac-SIG] installing Numeric In-Reply-To: References: Message-ID: <506989AE-3785-11D9-9BE2-000A9567635C@redivi.com> On Nov 16, 2004, at 2:15 AM, Christian Meesters wrote: > I was about to install the Numeric module (not Numarray!) and for that > LPACK is missing. Now, for installing LPACK one needs a f77-Compiler. > Does anybody know how to rewrite the make.inc if you have gcc? I've > seen a few older examples, but after checking them I'm completely > confused. See http://mail.python.org/pipermail/pythonmac-sig/2004-November/ 012077.html -bob From Chris.Barker at noaa.gov Tue Nov 16 06:04:00 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Tue Nov 16 06:04:02 2004 Subject: [Pythonmac-SIG] Where did Python.h come from? Message-ID: <2f2cc2a915.2a9152f2cc@hermes.nos.noaa.gov> ----- Original Message ----- From: Bob Ippolito > On Nov 15, 2004, at 10:40 PM, Chris Barker wrote: > > > I'm trying to help a friend install Scientific Python on his OS- > X 10.3 > > box, and it can't find Python.h. > Did he forget to install Xcode? :) well, he's got gcc, so I assumed he's installed the developer tools, but it wounds like we need to re-visit that one. He's also got who knows what from fink, so I suppose it's possible we've been using a fink gcc. Back to Developer connection. thanks, -Chris From janssen at parc.com Tue Nov 16 18:54:47 2004 From: janssen at parc.com (Bill Janssen) Date: Tue Nov 16 18:55:13 2004 Subject: [Pythonmac-SIG] Shark for Python? Message-ID: <04Nov16.095449pst."58617"@synergy1.parc.xerox.com> So how do we get Apple's nifty performance monitoring tool, Shark, to support Python? Anyone working on this? Bill From bob at redivi.com Tue Nov 16 19:04:51 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 16 19:05:01 2004 Subject: [Pythonmac-SIG] Shark for Python? In-Reply-To: <04Nov16.095449pst."58617"@synergy1.parc.xerox.com> References: <04Nov16.095449pst."58617"@synergy1.parc.xerox.com> Message-ID: <02D887F4-37FA-11D9-AE74-000A9567635C@redivi.com> On Nov 16, 2004, at 7:54 PM, Bill Janssen wrote: > So how do we get Apple's nifty performance monitoring tool, Shark, to > support Python? Anyone working on this? Get a job at Apple and ask really nicely to work on such a project? It's closed source, and I'm pretty sure it doesn't really have any public API. -bob From berkowit at silcom.com Tue Nov 16 19:24:24 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Tue Nov 16 19:24:29 2004 Subject: [Pythonmac-SIG] Shark for Python? In-Reply-To: <02D887F4-37FA-11D9-AE74-000A9567635C@redivi.com> Message-ID: On 11/16/04 10:04 AM, "Bob Ippolito" wrote: > On Nov 16, 2004, at 7:54 PM, Bill Janssen wrote: > >> So how do we get Apple's nifty performance monitoring tool, Shark, to >> support Python? Anyone working on this? > > Get a job at Apple and ask really nicely to work on such a project? > It's closed source, and I'm pretty sure it doesn't really have any > public API. Maybe someone could ask Bill Bumgarner (your man on the inside) if he might know whom to ask in the Tools division? -- Paul Berkowitz From janssen at parc.com Tue Nov 16 19:25:28 2004 From: janssen at parc.com (Bill Janssen) Date: Tue Nov 16 19:25:52 2004 Subject: [Pythonmac-SIG] Shark for Python? In-Reply-To: Your message of "Tue, 16 Nov 2004 10:04:51 PST." <02D887F4-37FA-11D9-AE74-000A9567635C@redivi.com> Message-ID: <04Nov16.102530pst."58617"@synergy1.parc.xerox.com> > Get a job at Apple and ask really nicely to work on such a project? Really? That seems kind of pessimistic. > It's closed source, and I'm pretty sure it doesn't really have any > public API. Sure, but perhaps they'd expose some of it. I notice that the Java support puts an extra flag on the Java command line, -XsharkMode, or some such thing. Perhaps something similar could be done for the Python interpreter on Macs. I wonder if Apple would tell us what needs to be done, if we were to ask nicely? Bill From njriley at uiuc.edu Tue Nov 16 19:41:37 2004 From: njriley at uiuc.edu (Nicholas Riley) Date: Tue Nov 16 19:41:41 2004 Subject: [Pythonmac-SIG] Shark for Python? In-Reply-To: <04Nov16.095449pst."58617"@synergy1.parc.xerox.com> References: <04Nov16.095449pst."58617"@synergy1.parc.xerox.com> Message-ID: <20041116184137.GA53425@uiuc.edu> On Tue, Nov 16, 2004 at 09:54:47AM -0800, Bill Janssen wrote: > So how do we get Apple's nifty performance monitoring tool, Shark, to > support Python? Anyone working on this? One of the Shark engineers came and talked here a few weeks ago - he said that they're interested in adding additional language support and handling things like JITed code, and there are already some APIs for it (which I never looked into) - send them email and ask. -- Nicholas Riley | From bob at redivi.com Tue Nov 16 23:40:38 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 16 23:41:23 2004 Subject: [Pythonmac-SIG] Shark for Python? In-Reply-To: <04Nov16.102530pst."58617"@synergy1.parc.xerox.com> References: <04Nov16.102530pst."58617"@synergy1.parc.xerox.com> Message-ID: <89EC3530-3820-11D9-85A6-000A9567635C@redivi.com> On Nov 16, 2004, at 8:25 PM, Bill Janssen wrote: >> Get a job at Apple and ask really nicely to work on such a project? > > Really? That seems kind of pessimistic. I've tried to get APIs out of them for just the Xcode debugger, I think Shark is much less likely.. Try all you want :) -bob From rroberts at adobe.com Wed Nov 17 06:29:12 2004 From: rroberts at adobe.com (Read Roberts) Date: Wed Nov 17 06:29:24 2004 Subject: [Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji unicode values. Message-ID: Has any one else seen the following? Mac OSX 10.3.6, standard Python from 10.3.4 installation + tkAqua Tkinter.tkinter.TK_VERSION is '8.4' I set a unicode string into a tKinter widget. Some kanji display correctly, some do no. The ones that don't show up as a white square followed by a black square. Both the Unicode values for the kanji that work and the ones that don't are present in the font used by the widget. Example: from Tkinter import * from tkFont import Font as TKFont root = Tk() root.font = TKFont(root, font = (u'\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 Pro W3', 12)) print root.font.actual() myFrame = Frame(root) root.resizable(1, 1) root.rowconfigure(0,weight=1) root.columnconfigure(0,weight=1) myFrame.grid() myFrame.rowconfigure(0,weight=1) myFrame.columnconfigure(0,weight=1) myEntry = Entry(myFrame, borderwidth = 10, font=root.font) testString = u"\u8146, \u500e, \u440c" myEntry.insert(0, testString) myEntry.grid() print repr(myEntry.get()) myFrame.mainloop() The font is used in this example is Hiragino Kaku Gothic-W3. FontBook shows that it has glyphs for all three Unicode values in the test string. u8146 shows up correctly, the others do not. Works fine on Windows. From Dave.Opstad at monotypeimaging.com Wed Nov 17 16:24:06 2004 From: Dave.Opstad at monotypeimaging.com (Opstad, Dave) Date: Wed Nov 17 16:24:17 2004 Subject: [Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji unicodevalues. In-Reply-To: Message-ID: Hmmm, the same thing is also happening for the Mincho. I'm able to display those Unicodes fine in TextEdit in both Gothic and Mincho, so this is something that's happening in the Python side of things, it looks like. I get the same results you get using python 2.3.4 and TclTkAqua 8.4.7 under OS X 10.3.6. Dave From crasch at openknowledge.org Wed Nov 17 16:30:48 2004 From: crasch at openknowledge.org (Christopher rasch) Date: Wed Nov 17 16:30:52 2004 Subject: [Pythonmac-SIG] Problems installing MacPython add-ons for 10.3 Message-ID: Hi, I'm trying to install the IDE and the Package Manager on Mac OS X 10.3.5. According to the MacPython on Mac OS X 10.3 page here: http://homepages.cwi.nl/~jack/macpython/macpython-osx.html Mac OS X 10.3.x already includes a MacPython 2.3 engine. So "...the only thing the MacPython distribution for 10.3 contains are the IDE, the Package Manager and the waste module on which they depend. You can get this distribution from the [16]download page." I downloaded the MacPython 2.3 for Pather addons installer from here: http://ftp.cwi.nl/jack/python/mac/MacPython-Panther-2.3-2.dmg I then installed it. The installallation seemed to go okay. However, when I clicked on the PackageManager icon, it appeared to start to launch, then shut down immediately. Same with the IDE. As you can see from the screenshot below, contrary to instructions above, the MacPython distribution does not appear to include the waste module. If I tried to run the PackageManager from the command line in the following directory: /Applications/MacPython-2.3/PackageManager.app/Contents/Resources I got the following error: chris:/Applications/MacPython-2.3/PackageManager.app/Contents/Resources chris$ python PackageManager.py Traceback (most recent call last): File "PackageManager.py", line 35, in ? import W File "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/ IDE/W.py", line 7, in ? from Wtext import * File "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/ IDE/Wtext.py", line 6, in ? import waste ImportError: No module named waste I then searched the pythonmac-SIG archives, for site:mail.python.org waste And found this email: http://mail.python.org/pipermail/pythonmac-sig/2003-June/007958.html Which gave the following instruction for installing waste: get waste from http://www.merzwaren.com/bin/waste/waste-21b1.sit unstuff waste-21b1.sit mount the WASTE disk image ( waste-21b1-distribution.img ) sudo python2.3 setup.py install I got to the point that the WASTE disk image was install. However this file (required for the last step): http://undefined.org/python/waste_for_python2.3.tgz No longer appears to be available at that site. Ther merzwaren doesn't contain installation instructions for waste either. (At least that I could find). So I'm a bit stuck. Any ideas what I should try next? Thanks for any help you may wish to provide. Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 2.pdf Type: application/pdf Size: 12115 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041117/6ec79b64/Picture2.pdf -------------- next part -------------- From rroberts at adobe.com Wed Nov 17 23:13:12 2004 From: rroberts at adobe.com (Read Roberts) Date: Wed Nov 17 23:13:22 2004 Subject: [Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji unicode values. Message-ID: Thanks for confirming that it is not just my system! I'm pretty sure that it the problem is in Tk rather than Python/Tkinter , as I can do Entry_widget.cget('txt') and get the right string back, and can even cut and paste from the Entry widget to other apps and still get the original Unicode back ( well, UTF-8, but it is still correct). Looks like I will have to go spelunking in TK to find the cause - anyone have suggestions about where to start? - Read >Hmmm, the same thing is also happening for the Mincho. I'm able to display >those Unicodes fine in TextEdit in both Gothic and Mincho, so this is >something that's happening in the Python side of things, it looks like. > >I get the same results you get using python 2.3.4 and TclTkAqua 8.4.7 under >OS X 10.3.6. > >Dave > From Zsolt.Putnoky at alcatel.fr Thu Nov 18 08:38:52 2004 From: Zsolt.Putnoky at alcatel.fr (Zsolt.Putnoky@alcatel.fr) Date: Thu Nov 18 08:39:00 2004 Subject: [Pythonmac-SIG] Problems installing Python 2.3.4 over standard Apple Python installation Message-ID: Hi All, I have a project based on Zope3 which requires to have Python 2.3.4 on my Mac (OS X 10.3.6). The machine has the default Apple provided Python installed. I had tried several times but never managed to get it work, and after reading all available information on how to install Python on Mac, I am still not able to do it. I issued the ./configure command (even tried with ./configure --with-suffix=.exe --with-dyld). At the middle I had received the following message (the one marked with ##) ... checking locale.h presence... yes checking for locale.h... yes checking ncurses.h usability... no checking ncurses.h presence... yes configure: WARNING: ncurses.h: present but cannot be compiled configure: WARNING: ncurses.h: check for missing prerequisite headers? configure: WARNING: ncurses.h: proceeding with the preprocessor's result configure: WARNING: ## ------------------------------------ ## configure: WARNING: ## Report this to bug-autoconf@gnu.org. ## configure: WARNING: ## ------------------------------------ ## checking for ncurses.h... yes checking poll.h usability... no checking poll.h presence... no checking for poll.h... no checking pthread.h usability... yes ... configure: creating ./config.status config.status: creating Makefile.pre config.status: creating Modules/Setup.config config.status: creating pyconfig.h config.status: pyconfig.h is unchanged creating Setup creating Setup.local creating Makefile The ./configure ended with no special error message. After issuing the make command, I had received the following message (actually repeated several times) ... cc1: warning: changing search order for system directory "/usr/local/include" cc1: warning: as it has already been specified as a non-system directory ... Then issued the "make clean", followed by "make" again .... and received ... Objects/fileobject.c: In function `file_tell': Objects/fileobject.c:668: warning: implicit declaration of function `getc_unlocked' Objects/fileobject.c: In function `get_line': Objects/fileobject.c:1134: warning: implicit declaration of function `flockfile' Objects/fileobject.c:1169: warning: implicit declaration of function `funlockfile' ... /Users/zsoltputnoky/Temp/Python-2.3.4/Modules/expat/xmlparse.c:1719: warning: `cdecl' attribute directive ignored /Users/zsoltputnoky/Temp/Python-2.3.4/Modules/expat/xmlparse.c:1731: warning: `cdecl' attribute directive ignored ... I would really appreciate if someone can tell me what I did wrong or what can be the problem. Thanks alot, Zsolt Putnoky -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20041118/f45cf173/attachment-0001.html From bob at redivi.com Thu Nov 18 09:42:48 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Nov 18 09:43:03 2004 Subject: [Pythonmac-SIG] Problems installing Python 2.3.4 over standard Apple Python installation In-Reply-To: References: Message-ID: On Nov 18, 2004, at 9:38 AM, Zsolt.Putnoky@alcatel.fr wrote: > I have a project based on Zope3 which requires to have Python 2.3.4 on > my Mac (OS X 10.3.6). The machine has the > default Apple provided Python installed. I had tried several times but > never managed to get it work, and after reading all available > information > on how to install Python on Mac, I am still not able to do it. > > I issued the ./configure command (even tried with ./configure > --with-suffix=.exe --with-dyld). At the middle I had received > the following message (the one marked with ##) Just use the Python 2.3.4 from Darwinports or Fink for Zope3. It'll be easier. Everything you posted sounds like a warnings, not errors, though.. so I'm not sure what your problem is (if you do even have a problem in the first place). -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 930 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041118/777feaba/attachment.bin From bob at redivi.com Thu Nov 18 10:17:04 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Nov 18 10:17:39 2004 Subject: [Pythonmac-SIG] Problems installing Python 2.3.4 over standard Apple Python installation In-Reply-To: References: Message-ID: <9D0CA618-3942-11D9-AAFD-000A9567635C@redivi.com> When you compile and install something, it will go to /usr/local/bin. Add this early to your PATH, or use it directly. Try "/usr/local/bin/python" instead of just typing "python". Consolidating packages for Darwinports or Fink for offline installation is probably somewhat difficult. On Nov 18, 2004, at 11:08 AM, Zsolt.Putnoky@alcatel.fr wrote: > Thanks for your reply. There is no net at home at this moment, so I > will try to download the files from DarwinPort to see if it works. > Even if these are only warnings, when I start Python from the CLI, I > see only 2.3 by Apple and not 2.3.4. > > Have a good day, > > Zsolt > > > > > To: ? ? ? ?Zsolt PUTNOKY/FR/ALCATEL@ALCATEL > cc: ? ? ? ?pythonmac-sig@python.org > Subject: ? ? ? ?Re: [Pythonmac-SIG] Problems installing Python 2.3.4 > over standard Apple Python installation > > > > > On Nov 18, 2004, at 9:38 AM, Zsolt.Putnoky@alcatel.fr wrote: > > I have a project based on Zope3 which requires to have Python 2.3.4 on > my Mac (OS X 10.3.6). The machine has the > default Apple provided Python installed. I had tried several times but > never managed to get it work, and after reading all available > information > on how to install Python on Mac, I am still not able to do it. > > I issued the ./configure command (even tried with ./configure > --with-suffix=.exe --with-dyld). At the middle I had received > the following message (the one marked with ##) > > Just use the Python 2.3.4 from Darwinports or Fink for Zope3. ?It'll > be easier. > > Everything you posted sounds like a warnings, not errors, though.. so > I'm not sure what your problem is (if you do even have a problem in > the first place). > > -bob > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2715 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041118/352ed38b/attachment.bin From bob at redivi.com Thu Nov 18 10:26:23 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Nov 18 10:26:36 2004 Subject: [Pythonmac-SIG] Problems installing Python 2.3.4 over standard Apple Python installation In-Reply-To: References: Message-ID: Did you forget to "sudo make install" after "make" completed? On Nov 18, 2004, at 11:19 AM, Zsolt.Putnoky@alcatel.fr wrote: > > The change in the path was done already. Yes, u're right about the > DarwinPort download. I do not have time in the office to play around, > so I will find another solution. > > To: ? ? ? ?Zsolt PUTNOKY/FR/ALCATEL@ALCATEL > cc: ? ? ? ?pythonmac-sig@python.org > Subject: ? ? ? ?Re: [Pythonmac-SIG] Problems installing Python 2.3.4 > over standard Apple Python installation > > > > When you compile and install something, it will go to /usr/local/bin. > ?Add this early to your PATH, or use it directly. ?Try > "/usr/local/bin/python" instead of just typing "python". > > Consolidating packages for Darwinports or Fink for offline > installation is probably somewhat difficult. > > On Nov 18, 2004, at 11:08 AM, Zsolt.Putnoky@alcatel.fr wrote: > > Thanks for your reply. There is no net at home at this moment, so I > will try to download the files from DarwinPort to see if it works. > Even if these are only warnings, when I start Python from the CLI, I > see only 2.3 by Apple and not 2.3.4. > > Have a good day, > > Zsolt > > > > > To: ? ? ? ?Zsolt PUTNOKY/FR/ALCATEL@ALCATEL > ? > cc: ? ? ? ?pythonmac-sig@python.org > ? > Subject: ? ? ? ?Re: [Pythonmac-SIG] Problems installing Python 2.3.4 > over standard Apple Python installation > ? > > > > > On Nov 18, 2004, at 9:38 AM, Zsolt.Putnoky@alcatel.fr wrote: > > I have a project based on Zope3 which requires to have Python 2.3.4 on > my Mac (OS X 10.3.6). The machine has the > default Apple provided Python installed. I had tried several times but > never managed to get it work, and after reading all available > information > on how to install Python on Mac, I am still not able to do it. ? > > I issued the ./configure command (even tried with ./configure > --with-suffix=.exe --with-dyld). At the middle I had received > the following message (the one marked with ##) > > Just use the Python 2.3.4 from Darwinports or Fink for Zope3. ?It'll > be easier. > > Everything you posted sounds like a warnings, not errors, though.. so > I'm not sure what your problem is (if you do even have a problem in > the first place). > > -bob > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 4022 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041118/fd419939/attachment.bin From charles.hartman at conncoll.edu Thu Nov 18 15:17:02 2004 From: charles.hartman at conncoll.edu (Charles Hartman) Date: Thu Nov 18 15:17:08 2004 Subject: [Pythonmac-SIG] The where's-my-app problem Message-ID: <84A609C8-396C-11D9-8A27-000D933C27EA@conncoll.edu> Over on the wxPython-users list, there has been endless discussion of this problem (see http://lists.wxwidgets.org/cgi-bin/ezmlm-cgi?11:sss:33832: fkbngdnmdfjfdjpcdndi#b): I want to know the directory from which my app was launched, so as to locate a couple of data files that need to be editable and therefore separate from the bundle, painlessly and without dialog boxes in the normal case (the files haven't been moved, the app is started by double-clicking or whatever is most obvious to a casual user). It turns out to be strangely difficult to do this in a way that works for (a) apps launched from the Terminal and (b) apps frozen by py2app on Mac and (c) py2exe apps on Windows. In several of the approaches proposed, the py2app "frozen" app seems to be the odd one out. IF I've got this straight, these are the two that work on Win2K running from Python and in a py2exe app, and on OS/X running from Python, but not from a bundlebuilder (or, I think, py2app) app: Method 1: programDir, programName = os.path.split(sys.argv[0]) if programDir == '': programDir = os.getcwd() Method 2: programDir2 = os.path.abspath(sys.path[0]) if os.path.isfile(programDir2): programDir2 = os.path.dirname(programDir2) So I guess the question people have been suggesting be asked is, is there any way for py2app to make either of those work? (I can't say I understand all this; I started the thread with what I thought was a foolishly simple question, and in 35 messages it's shown me all kinds of thngs I never saw before.) Charles Hartman Professor of English, Poet in Residence http://cherry.conncoll.edu/cohar http://villex.blogspot.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1741 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041118/d81fc87d/attachment.bin From jf at ai.univ-paris8.fr Thu Nov 18 15:24:33 2004 From: jf at ai.univ-paris8.fr (Feat) Date: Thu Nov 18 15:33:08 2004 Subject: [Pythonmac-SIG] Python IDE 2.3.2 problems Message-ID: Hi list! ~~~~~~~~~~ Background ~~~~~~~~~~ I need to use Python IDE (http://homepages.cwi.nl/~jack/macpython/) to teach programming fundamentals to beginners at the university of Paris 8, France. When moving from Jaguar to Panther I downloaded the "MacPython 2.3 for Panther addons" from : http://ftp.cwi.nl/jack/python/mac/MacPython-Panther-2.3-2.dmg ~~~~~~~~~~ Problems ~~~~~~~~~~ 1. Even the simplest code won't work in the IDE if I don't check the "Run as __main__" option, else it wouldn't find the interpreter, displaying an alert: "can't find command line Python", although there's a "Python interactive" window that behaves as expected. How do I patch the program so it searches /usr/local/bin/ to find either the python interpreter -- or the pythonw interpreter, which I actually want to use? 2. When I need to run a program that should use the "Tkinter" module (I'm running Tickle 8.4.4) I can only briefly see the widgets I've created -- then the IDE, and my application as well, vanish, quit with no alert, no warning, no nothing... However, when I use the Python Launcher (v2.3 by Jack Jansen) to launch that very same program, everything works okay. What's wrong with my installation? 3. A quick search for Tkinter will yield: Name Where _tkinter.so /Library/Python/2.3/ _tkinter.so /Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/ Tkinter.py /Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/ Tkinter.pyc /Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/ Tkinter.pyo /Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/ Tkinter.py /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/ Tkinter.pyc /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/ Tkinter.pyo /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/ So obviously, migrating from Jaguar to Panther had the side effect of duplicating some files from my previous installation. How shall I clean that mess, what should I remove, and where do these files really belong? I tried to install a fresh system (no Python IDE) on another partition and the Tkinter files only exist in the /System/Library/Frameworks/... path, but installing the IDE there doesn't make it work as expected either (and there's no "_tkinter.so" file any longer). Can anybody, please, help me to solve problems 1, 2 and 3? Thanks in advance. PowerBook Titanium G4-7410 500 MHz - running 1O.3.6 in 512 MB RAM -- Jym Feat Paris FR 75018 From bob at redivi.com Thu Nov 18 17:02:09 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Nov 18 17:02:29 2004 Subject: [Pythonmac-SIG] Python IDE 2.3.2 problems In-Reply-To: References: Message-ID: <33D051C6-397B-11D9-AAFD-000A9567635C@redivi.com> On Nov 18, 2004, at 4:24 PM, Feat wrote: > I need to use Python IDE (http://homepages.cwi.nl/~jack/macpython/) to > teach programming fundamentals to beginners at the university of Paris > 8, France. > > When moving from Jaguar to Panther I downloaded the "MacPython 2.3 for > Panther addons" from : > > http://ftp.cwi.nl/jack/python/mac/MacPython-Panther-2.3-2.dmg Do this before installing the add-ons (or re-install them after performing this step): http://homepages.cwi.nl/~jack/macpython/uninstall.html -bob From bob at redivi.com Thu Nov 18 17:47:52 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Nov 18 17:48:07 2004 Subject: [Pythonmac-SIG] The where's-my-app problem In-Reply-To: <84A609C8-396C-11D9-8A27-000D933C27EA@conncoll.edu> References: <84A609C8-396C-11D9-8A27-000D933C27EA@conncoll.edu> Message-ID: <96815E38-3981-11D9-AAFD-000A9567635C@redivi.com> On Nov 18, 2004, at 4:17 PM, Charles Hartman wrote: > Over on the wxPython-users list, there has been endless discussion of > this problem (see > http://lists.wxwidgets.org/cgi-bin/ezmlm-cgi?11:sss:33832: > fkbngdnmdfjfdjpcdndi#b): > > I want to know the directory from which my app was launched, so as to > locate a couple of data files that need to be editable and therefore > separate from the bundle, painlessly and without dialog boxes in the > normal case (the files haven't been moved, the app is started by > double-clicking or whatever is most obvious to a casual user). It > turns out to be strangely difficult to do this in a way that works for > (a) apps launched from the Terminal and (b) apps frozen by py2app on > Mac and (c) py2exe apps on Windows. > > In several of the approaches proposed, the py2app "frozen" app seems > to be the odd one out. IF I've got this straight, these are the two > that work on Win2K running from Python and in a py2exe app, and on > OS/X running from Python, but not from a bundlebuilder (or, I think, > py2app) app: I'm just going to spew a short article's worth of information about this topic. A subset of this will certainly answer your question. Feel free to reproduce this in any way you see fit (i.e. a FAQ or Wiki would be a good place for this information), but be warned that this code is written from Mail.app and is untested, so it may have typos. == Mac OS X and paths == From a Mac OS X application's perspective, the "directory from which your app was launched" is completely ambiguous. Is is so ambiguous, in fact, that when a Mac OS X application starts up by way of LaunchServices (i.e. Finder, /usr/bin/open, etc.) it will have a current directory of /. Yes, that's right. It starts in the root of your filesystem, a completely useless place. The reason for this is that on Mac OS X, you should always always always always ALWAYS ALWAYS find files in one of the following ways: - Inside your application bundle (via CFBundle or NSBundle functions) - A predefined system path (via FSFindFolder or NSSearchPathForDirectoriesInDomains, NOT by hardcoding something) or a subdirectory of one (i.e. ~/Library/Application Support/MyApplication) - Chosen by the user with some kind of system dialog - A "remembered" (using an alias) location that was chosen by the user with some kind of dialog at one point another (system dialogs do this, so that they remember where the user last chose files from) That's it. You should ALMOST NEVER use any other way to find stuff. ALL data files of a correctly constructed Mac OS X application should be in the Resources folder of the bundle. If you want to have user editable versions of these files, then on startup you should make copies of the in-Resources files somewhere like ~/Library/Application Support/MyApplication if they do not exist and use those. You may also add functionality to your application to reveal this path to the user. For example, the Scripts menu in Mail.app has an "Open Scripts Folder" menu. == Canonical way of detecting py2app, py2exe == def find_packager(): import sys frozen = getattr(sys, 'frozen', None) if not frozen: # COULD be certain cx_Freeze options or bundlebuilder, nothing to worry about though return None elif frozen in ('dll', 'console_exe', 'windows_exe'): return 'py2exe' elif frozen in ('macosx_app',): return 'py2app' elif frozen is True: # it doesn't ALWAYS set this return 'cx_Freeze' else: return '' % (frozen,) It's possible to build cx_Freeze-frozen applications that are not picked up by this (i.e. ConsoleKeepPath). Bundlebuilder is never really detectable, but you should NEVER use bundlebuilder. py2app is capable of performing all of the operations that bundlebuilder can do (and then some), with the added bonus that its implementation is more correct. I hope to deprecate bundlebuilder in Python 2.5. == Canonical way of finding your main script == import os def mainScriptDir(): import __main__ return os.path.dirname(os.path.abspath(__main__.__file__)) Finding your main script should be done in the same way that your main script determines if it is main or not! For applications frozen with py2exe, there IS effectively no on-disk main script (the bytecode is shoved into the executable). Finding your main script is not a useful thing to do from a packaged application anyway, so only use this when find_packager() returns None. == Default invariants for py2app == - sys.frozen == 'macosx_app' - os.getcwd() is the Resources directory of your application's bundle when the application starts. This is a convenience to make most scripts work "out of the box" (but probably after using the argv_emulation option). - os.environ['RESOURCEPATH'] is the absolute path to the Resources directory of your application's bundle when it started - The user's "site-packages" directory WILL NOT be considered by default, so you - Any Python code, dynamic libraries, and frameworks that are determined to be used, aren't explicitly excluded, and aren't located in a system path (/usr/lib or /System) WILL end up somewhere accessible from the runtime in your application bundle. You SHOULD ONLY depend on the fact that the code can be located at runtime, NOT where it is in the application bundle. - NO non-code will be included from packages UNLESS the package is explicitly included using the "packages" option. This can also happen implicitly by way of a recipe. - Such explicitly included packages are included as-is, but may be stripped of 'CVS' and '.svn' subdirectories. You CAN depend on data files that are in such packages, but you should ONLY reference them relative to the dirname of the package's __file__. == Don't use bundlebuilder == bundlebuilder does a number of things incorrectly and incompletely. Don't use it anymore, ever. A typical py2app setup script is quite a bit simpler than the bundlebuilder version, anyway. == Using Python packages as data file containers == It's common to include necessary data files inside of packages, for example: mypackage/ __init__.py mydatafile To locate such data files, you should always do something equivalent to the following: import mypackage mydatafilepath = os.path.join(os.path.dirname(os.path.abspath(mypackage.__file__)), 'mydatafile') This method will not work in the face of zip imports, so such packages must be explicitly included as-is with packaging solutions such as py2app or py2exe. == If you *actually* want to find something relative to the "application" == Note that this code only belongs in a poorly designed OS X application, but I'm going to tell you anyway since this seems to be what you asked for after a painful reading of the referenced wxPython-users thread: # use find_packager() above import os def getApplicationPath(): packager = find_packager() if packager == 'py2exe': # note that another approach is return os.path.dirname(os.path.abspath(sys.argv[0])) elif packager == 'py2app': # from path/Foo.app/Contents/Resources -> path, even if something in your application chdir'ed in the meantime return os.path.dirname(os.path.dirname(os.path.dirname(os.environ['RESOURCEPATH ']))) else: import __main__ return os.path.dirname(__main__.__file__) Also note that this isn't bulletproof. For example, in one of my applications, I use NSIS on top of py2exe to provide a "single file executable" (for which the above code would return a nonsense temporary directory). In the Mac OS X version of this application all of my resources are located in the Resources folder of the application bundle, and I locate them using OS X specific APIs (NSBundle, etc.) since the application is written with PyObjC. In the Win32 version, NSIS sets the current directory to the location of the "single file executable", and the windows version searches that directory for the Mac OS X application, and uses the resources folder of its application bundle for data files. I emulate many of the localization and file-finding capabilities of Cocoa in the Windows code. This is of course a strange way to do things on Windows, since the canonical way is to use an installer, but in this case the application *is* an installer (to put data on a peripheral device, not more software for the machine) and is rarely executed, so it makes perfect sense to do it in this manner. Hopefully this covers everything you need. Feel free to ask additional questions, but I'm pretty busy with the pypy sprint and I'm in a weird timezone (gmt+2) for the next week, so it may take a while to respond. -bob From Jack.Jansen at cwi.nl Thu Nov 18 22:04:47 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Nov 18 22:04:47 2004 Subject: [Pythonmac-SIG] Problems installing MacPython add-ons for 10.3 In-Reply-To: References: Message-ID: <7A93F9F8-39A5-11D9-BCA2-000D934FF6B4@cwi.nl> On 17-nov-04, at 16:30, Christopher rasch wrote: > Hi, > > I'm trying to install the IDE and the Package Manager on Mac OS X > 10.3.5. > [...] > However, when I clicked on the PackageManager icon, it appeared to > start to launch, then shut down immediately. Same with the IDE. > [...] > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/ > IDE/Wtext.py", line 6, in ? > import waste > ImportError: No module named waste Somehow the waste module can't be found. And it has been installed (or, at least, it should have been). The instructions for installing waste you've been reading are old, from the time Panther was still in Beta (and under NDA, hence the roundabout description about Python without waste). Anyway, what is usually the reason for this problem is that a symlink has gone missing, possibly due to some other installer zapping it (I think old wxPython installers could sometimes do this, but it could be something else, I'm not sure). First, check that /Library/Python/2.3/waste.so exists. If it doesn't then you really don't have waste. In that case try re-running the MacPython Panther Additions installer, keep the log and send it to me. If you do have that file then check that /System/Library/Frameworks/Python.framework/Versions/Current/lib/ python2.3/site-packages exists, and is a symlink to ../../../../../../../../Library/Python/2.3. In other words, to the /Library/Python/2.3 directory mentioned above. If this isn't the case you can fix it by removing whatever is at that place and re-creating the symlink (all with sudo). If the symlink is there and intact then I haven't a clue what is going on;-) -- 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 at cwi.nl Thu Nov 18 22:06:45 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Nov 18 22:06:46 2004 Subject: [Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji unicode values. In-Reply-To: References: Message-ID: On 17-nov-04, at 23:13, Read Roberts wrote: > Thanks for confirming that it is not just my system! > > I'm pretty sure that it the problem is in Tk rather than > Python/Tkinter , as I can do Entry_widget.cget('txt') and get the > right string back, and can even cut and paste from the Entry widget to > other apps and still get the original Unicode back ( well, UTF-8, but > it is still correct). > > Looks like I will have to go spelunking in TK to find the cause - > anyone have suggestions about where to start? First ask on the mailing list for Mac Tcl/Tk developers, . It may be a known problem. And they're friendly to Python/Tkinter users over there, 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 Jack.Jansen at cwi.nl Thu Nov 18 22:24:07 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Nov 18 22:24:08 2004 Subject: [Pythonmac-SIG] Python IDE 2.3.2 problems In-Reply-To: References: Message-ID: <2E507B90-39A8-11D9-BCA2-000D934FF6B4@cwi.nl> On 18-nov-04, at 15:24, Feat wrote: > 1. Even the simplest code won't work in the IDE if I don't check the > "Run as __main__" option, else it wouldn't find the interpreter, > displaying an alert: "can't find command line Python", although > there's a "Python interactive" window that behaves as expected. How do > I patch the program so it searches /usr/local/bin/ to find either the > python interpreter -- or the pythonw interpreter, which I actually > want to use? This I don't understand. If you don't check the "Run with commandline Python" it should run in the IDE internally. > 2. When I need to run a program that should use the "Tkinter" module > (I'm running Tickle 8.4.4) I can only briefly see the widgets I've > created -- then the IDE, and my application as well, vanish, quit with > no alert, no warning, no nothing... However, when I use the Python > Launcher (v2.3 by Jack Jansen) to launch that very same program, > everything works okay. What's wrong with my installation? This is an intrinsic shortcoming of the IDE. Or, actually, it's a fact of life the IDE cannot hide from you. You cannot mix two GUI toolkits in one application, and the IDE uses Carbon, so you cannot use it to run Tkinter programs (or wxPython programs, Cocoa programs, etc). Incidentally, this is in the FAQ, along with lots of other often-asked questions. You'll find it through the homepage. You could try using Idle for your development. > 3. A quick search for Tkinter will yield: Bob answered the first half of the question (uninstall your old Jaguar Python). And then to install a fresh copy of _tkinter.so use the Package Manager. -- 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 just at letterror.com Thu Nov 18 22:28:03 2004 From: just at letterror.com (Just van Rossum) Date: Thu Nov 18 22:28:07 2004 Subject: [Pythonmac-SIG] Python IDE 2.3.2 problems In-Reply-To: <2E507B90-39A8-11D9-BCA2-000D934FF6B4@cwi.nl> Message-ID: Jack Jansen wrote: > On 18-nov-04, at 15:24, Feat wrote: > > > 1. Even the simplest code won't work in the IDE if I don't check > > the "Run as __main__" option, else it wouldn't find the > > interpreter, displaying an alert: "can't find command line Python", > > although there's a "Python interactive" window that behaves as > > expected. How do I patch the program so it searches /usr/local/bin/ > > to find either the python interpreter -- or the pythonw > > interpreter, which I actually want to use? > > This I don't understand. If you don't check the "Run with commandline > Python" it should run in the IDE internally. > > > 2. When I need to run a program that should use the "Tkinter" > > module (I'm running Tickle 8.4.4) I can only briefly see the > > widgets I've created -- then the IDE, and my application as well, > > vanish, quit with no alert, no warning, no nothing... However, when > > I use the Python Launcher (v2.3 by Jack Jansen) to launch that very > > same program, everything works okay. What's wrong with my > > installation? > > This is an intrinsic shortcoming of the IDE. Actually, I would think that the "Run with commandline Python" option was designed to work around that shortcoming... Just From Jack.Jansen at cwi.nl Fri Nov 19 00:13:17 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Nov 19 00:13:19 2004 Subject: [Pythonmac-SIG] Python IDE 2.3.2 problems In-Reply-To: References: Message-ID: <6DF79660-39B7-11D9-BCA2-000D934FF6B4@cwi.nl> On 18-nov-04, at 22:28, Just van Rossum wrote: >>> 2. When I need to run a program that should use the "Tkinter" >>> module (I'm running Tickle 8.4.4) I can only briefly see the >>> widgets I've created -- then the IDE, and my application as well, >>> vanish, quit with no alert, no warning, no nothing... However, when >>> I use the Python Launcher (v2.3 by Jack Jansen) to launch that very >>> same program, everything works okay. What's wrong with my >>> installation? >> >> This is an intrinsic shortcoming of the IDE. > > Actually, I would think that the "Run with commandline Python" option > was designed to work around that shortcoming... Indeed (was it you or me who put it in?:-), but you lose debugging and introspection, so you're really only able to use the editor portion of the IDE. If I understand things correctly Idle has solved this issue, and allows you to run your program in a different process than the IDE but still allowing you to debug. At some point we should probably steal this code. -- 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 bob at redivi.com Fri Nov 19 00:21:50 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Nov 19 00:22:42 2004 Subject: [Pythonmac-SIG] Python IDE 2.3.2 problems In-Reply-To: <6DF79660-39B7-11D9-BCA2-000D934FF6B4@cwi.nl> References: <6DF79660-39B7-11D9-BCA2-000D934FF6B4@cwi.nl> Message-ID: On Nov 19, 2004, at 1:13 AM, Jack Jansen wrote: > > On 18-nov-04, at 22:28, Just van Rossum wrote: >>>> 2. When I need to run a program that should use the "Tkinter" >>>> module (I'm running Tickle 8.4.4) I can only briefly see the >>>> widgets I've created -- then the IDE, and my application as well, >>>> vanish, quit with no alert, no warning, no nothing... However, when >>>> I use the Python Launcher (v2.3 by Jack Jansen) to launch that very >>>> same program, everything works okay. What's wrong with my >>>> installation? >>> >>> This is an intrinsic shortcoming of the IDE. >> >> Actually, I would think that the "Run with commandline Python" option >> was designed to work around that shortcoming... > > Indeed (was it you or me who put it in?:-), but you lose debugging and > introspection, so you're really only able to use the editor portion of > the IDE. > > If I understand things correctly Idle has solved this issue, and allows > you to run your program in a different process than the IDE but still > allowing you to debug. At some point we should probably steal this > code. This code is quite frightening, seems to be quite dependent on idle, and uses threads all over the place... I've considered rewriting it in a somewhat more sane manner for an out of process version of PyInterpreter (with the idea that it would also be used for a debugger), but have not had the time or need yet. -bob From gandreas at gandreas.com Fri Nov 19 00:47:22 2004 From: gandreas at gandreas.com (glenn andreas) Date: Fri Nov 19 00:49:26 2004 Subject: [Pythonmac-SIG] Python IDE 2.3.2 problems In-Reply-To: <6DF79660-39B7-11D9-BCA2-000D934FF6B4@cwi.nl> References: <6DF79660-39B7-11D9-BCA2-000D934FF6B4@cwi.nl> Message-ID: At 12:13 AM +0100 11/19/04, Jack Jansen wrote: >On 18-nov-04, at 22:28, Just van Rossum wrote: >>>>2. When I need to run a program that should use the "Tkinter" >>>>module (I'm running Tickle 8.4.4) I can only briefly see the >>>>widgets I've created -- then the IDE, and my application as well, >>>>vanish, quit with no alert, no warning, no nothing... However, when >>>>I use the Python Launcher (v2.3 by Jack Jansen) to launch that very >>>>same program, everything works okay. What's wrong with my >>>>installation? >>> >>>This is an intrinsic shortcoming of the IDE. >> >>Actually, I would think that the "Run with commandline Python" option >>was designed to work around that shortcoming... > >Indeed (was it you or me who put it in?:-), but you lose debugging and >introspection, so you're really only able to use the editor portion >of the IDE. > >If I understand things correctly Idle has solved this issue, and allows >you to run your program in a different process than the IDE but still >allowing you to debug. At some point we should probably steal this code. PyOXIDE supports this (debugging & introspection of "external" processes), using a scheme that looks much like Distributed Objects. It also doesn't use threads or anything funky (yet), though requires explicit handling on the external side (there's a debugging stub that does this when you launch as "remote" under PyOXIDE). The goal was to be able to add that "nub" to an app that embedded python (say, a MMRPG that used Python as a scripting language) and then one can debug from PyOXIDE, though saddly that will require redoing stuff in PyOXIDE to use threads in strange and fearful ways... -- Glenn Andreas gandreas@gandreas.com oh my! Mad, Bad, and Dangerous to Know From Zsolt.Putnoky at alcatel.fr Fri Nov 19 08:25:55 2004 From: Zsolt.Putnoky at alcatel.fr (Zsolt.Putnoky@alcatel.fr) Date: Fri Nov 19 08:26:01 2004 Subject: [Pythonmac-SIG] Problems installing Python 2.3.4 over standard Apple Python installation In-Reply-To: Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 239 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041119/8f561082/attachment-0002.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 170 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041119/8f561082/attachment-0003.gif From jf at ai.univ-paris8.fr Fri Nov 19 13:00:09 2004 From: jf at ai.univ-paris8.fr (Feat) Date: Fri Nov 19 13:02:03 2004 Subject: [Pythonmac-SIG] Python IDE 2.3.2 problems In-Reply-To: <2E507B90-39A8-11D9-BCA2-000D934FF6B4@cwi.nl> References: <2E507B90-39A8-11D9-BCA2-000D934FF6B4@cwi.nl> Message-ID: >> 1. Even the simplest code won't work in the IDE if I don't check the "Run as __main__" option, else it wouldn't find the interpreter. >This I don't understand. If you don't check the "Run with commandline Python" it should run in the IDE internally. You're right, I've been too far; it only happened once. >> 2. When I need to run a program that should use the "Tkinter" module (I'm running Tickle 8.4.4) I can only briefly see the widgets I've created... >You cannot mix two GUI toolkits in one application, and the IDE uses Carbon, so you cannot use it to run Tkinter programs (or wxPython programs, Cocoa programs, etc). Incidentally, this is in the FAQ, along with lots of other often-asked questions. You'll find it through the homepage. I didn't know there was one, sorry... >You could try using Idle for your development. Thanks for the advice! >> 3. A quick search for Tkinter will yield: >Bob answered the first half of the question (uninstall your old Jaguar Python). And then to install a fresh copy of _tkinter.so use the Package Manager. I'll do that, thanks a lot for your patience! -- Jym Feat Paris FR 75018 From enrike at altern.org Fri Nov 19 16:29:30 2004 From: enrike at altern.org (altern) Date: Fri Nov 19 16:28:55 2004 Subject: [Pythonmac-SIG] terminal launches python on it own. In-Reply-To: <96815E38-3981-11D9-AAFD-000A9567635C@redivi.com> References: <84A609C8-396C-11D9-8A27-000D933C27EA@conncoll.edu> <96815E38-3981-11D9-AAFD-000A9567635C@redivi.com> Message-ID: <419E115A.9010500@altern.org> hi i am not sure how this happened but suddenly everytime i lauch a shell in the terminal python launches automaticly opening a file i have been working on recently. If i use the python launcher then i get two instances of the file running, one for the one that the terminal opens up and another one for the one i am trying to launch. i dont really understand this, i didnt do anything special as far as i can remember. -- enrike From huaicai at nanorex.com Fri Nov 19 16:56:50 2004 From: huaicai at nanorex.com (Huaicai Mo) Date: Fri Nov 19 16:56:55 2004 Subject: [Pythonmac-SIG] Py2app working with PyQt, PyOpenGL applications? Message-ID: <20041119155653.BA0C61E4009@bag.python.org> Hello, I am trying to use py2app to build an application bundle distribution on Mac OS X. I got some problems, I wonder if any one has similar experiences or any ideas for these? My Mac OS X is 10.2.8. I built py2app from source, since the py2app-0.1.5 installation package needs 10.3 installer. My software uses PyQt, PyOpenGL packages. Same as py2exe, py2app can't find the "sip" module, which is used by PyQt, so I add the option: "--includes sip", this works fine, but the problem is when I run the application, I got an error: IOError: [Errno20] Not a directory: '../Contents/Resources/Python/site-packages.zip/OpenGL/version'. I tried to add the file 'version' from OpenGL directory to site-packages.zip and extract the zip file into a directory called site-packages.zip, the above error disappeared, but I got an new error: QPaintDevice: Must construct a Qapplication before a QPaintDevice. My application works fine and doesn't have such errors if I just start it from a shell window like: pythonw ../myapp.py. I also tried "--excludes OpenGL" module and then manually copy the OpenGL directory from Python.frameworks to "site-pakcages.zip" and "lib-dynload" directories, the trick that I used for py2exe on Windows, but it seems this is not working here: " Fatal Python error: Interpreter not initialized (Version mismatch?) " Please share your experience or ideas if you may have some for those problems. Thanks a lot. huaicai -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20041119/7decd3a1/attachment.html From bob at redivi.com Fri Nov 19 17:21:21 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Nov 19 17:21:40 2004 Subject: [Pythonmac-SIG] Py2app working with PyQt, PyOpenGL applications? In-Reply-To: <20041119155653.BA0C61E4009@bag.python.org> References: <20041119155653.BA0C61E4009@bag.python.org> Message-ID: <0C949AAE-3A47-11D9-8651-000A9567635C@redivi.com> On Nov 19, 2004, at 5:56 PM, Huaicai Mo wrote: > I am trying to use py2app to build an application bundle distribution > on Mac OS X. I got some problems, I wonder if any one has similar > experiences or any ideas for these? > > My Mac OS X is 10.2.8. I built py2app from source, since the > py2app-0.1.5 installation package needs 10.3 installer. My software > uses PyQt, PyOpenGL packages. Same as py2exe, py2app can't find the > "sip" module, which is used by PyQt,? so I add the option: "--includes > sip", this works fine, but the problem is when I run the application, > I got an error: The next version of py2app will include workarounds for PyQt and PyOpenGL, assuming that an easy-ish to install version of PyQt is available by the time I do it. I'll probably release a new version of py2app in two or three weeks. Until then, PyQt is completely untested and I can't really help you with anything PyQt specific. > IOError: [Errno20] Not a directory: > '?./Contents/Resources/Python/site-packages.zip/OpenGL/version'.? > > I tried to add the file 'version' from OpenGL directory to > site-packages.zip and extract the zip file into a directory called > site-packages.zip, the above error disappeared, but I got an new > error: Don't do that. > QPaintDevice: Must construct a Qapplication before a QPaintDevice.? > My application works fine and doesn't have such errors if I just start > it from a shell window like: pythonw ?./myapp.py. This sounds like an error in your script or something, I can't help you with that. Maybe using --packages for sip and PyQt (whatever the package names are called) will fix this? I haven't looked at PyQt in quite some time and have no idea what nasty hacks it uses. > I also tried? "--excludes OpenGL" module and then manually copy the > OpenGL directory? from Python.frameworks to "site-pakcages.zip" and > "lib-dynload" directories, the trick that I used for py2exe on > Windows, but it seems this is not Either hack the OpenGL __init__ to use a sane method to acquire its version, or use --packages OpenGL to include the package as-is (out of the zip) > working here: " Fatal Python error: Interpreter not initialized > (Version mismatch?) " This is because Python itself is included in your application, but the OpenGL extension links directly to your /LIbrary/Frameworks/Python.framework. It explodes because once you load that extension, you have *TWO* Python libraries in your process. When using py2app correctly (i.e. not hacking around the application bundles on your own!) it will automatically take care of this for you by rewriting the Mach-O load commands to point to your in-bundle Python. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 3189 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041119/f0c10933/attachment.bin From huaicai at nanorex.com Fri Nov 19 20:05:35 2004 From: huaicai at nanorex.com (Huaicai Mo) Date: Fri Nov 19 20:05:39 2004 Subject: FW: [Pythonmac-SIG] Py2app working with PyQt, PyOpenGL applications? Message-ID: <20041119190538.2DD641E4009@bag.python.org> Bob, Thank you very much for the reply. As you suggested, I tried "--packages OpenGL", which will solve the OpenGL version problem, but I still got the error: "QPaintDevice: Must construct a Qapplication before a QPaintDevice." I don't think it's any problem of my scripts, it works without any problem if I start it manually in a shell window, and the same program works on Linux and Windows too. I suspect the problem is the way how py2app deals with PyQt/Qt modules. I noticed in the result package, it includes qt.so, qtgl.so, sip.so in the lib-dynload directory, and qt.pyc, qtgl.pyc, sip.pyc in the site-packages.zip file, but no where I can find anything about libqt.3.dylib and libqui.1.dylib in the package, I guess they are Qt libraries, which are needed to run my program. In the package that I created on Windows using py2exe, similar files exist: *.pyc in a zip file, and corresponding *.dll files outside, but there is one more dll file called: qt-mt333.dll, the Qt library file on Windows. I tried to copy those *.dylib files into the lib-dyload directory, but no success. I wonder if you have any work around for this problem at present? Thanks a lot, Regards, Huaicai _____ From: Bob Ippolito [mailto:bob@redivi.com] Sent: Friday, November 19, 2004 11:21 AM To: Huaicai Mo Cc: pythonmac-sig@python.org Subject: Re: [Pythonmac-SIG] Py2app working with PyQt, PyOpenGL applications? On Nov 19, 2004, at 5:56 PM, Huaicai Mo wrote: I am trying to use py2app to build an application bundle distribution on Mac OS X. I got some problems, I wonder if any one has similar experiences or any ideas for these? My Mac OS X is 10.2.8. I built py2app from source, since the py2app-0.1.5 installation package needs 10.3 installer. My software uses PyQt, PyOpenGL packages. Same as py2exe, py2app can't find the "sip" module, which is used by PyQt, so I add the option: "--includes sip", this works fine, but the problem is when I run the application, I got an error: The next version of py2app will include workarounds for PyQt and PyOpenGL, assuming that an easy-ish to install version of PyQt is available by the time I do it. I'll probably release a new version of py2app in two or three weeks. Until then, PyQt is completely untested and I can't really help you with anything PyQt specific. IOError: [Errno20] Not a directory: '../Contents/Resources/Python/site-packages.zip/OpenGL/version'. I tried to add the file 'version' from OpenGL directory to site-packages.zip and extract the zip file into a directory called site-packages.zip, the above error disappeared, but I got an new error: Don't do that. QPaintDevice: Must construct a Qapplication before a QPaintDevice. My application works fine and doesn't have such errors if I just start it from a shell window like: pythonw ../myapp.py. This sounds like an error in your script or something, I can't help you with that. Maybe using --packages for sip and PyQt (whatever the package names are called) will fix this? I haven't looked at PyQt in quite some time and have no idea what nasty hacks it uses. I also tried "--excludes OpenGL" module and then manually copy the OpenGL directory from Python.frameworks to "site-pakcages.zip" and "lib-dynload" directories, the trick that I used for py2exe on Windows, but it seems this is not Either hack the OpenGL __init__ to use a sane method to acquire its version, or use --packages OpenGL to include the package as-is (out of the zip) working here: " Fatal Python error: Interpreter not initialized (Version mismatch?) " This is because Python itself is included in your application, but the OpenGL extension links directly to your /LIbrary/Frameworks/Python.framework. It explodes because once you load that extension, you have *TWO* Python libraries in your process. When using py2app correctly (i.e. not hacking around the application bundles on your own!) it will automatically take care of this for you by rewriting the Mach-O load commands to point to your in-bundle Python. -bob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20041119/f47d5d77/attachment.htm From rtjohan at syspres.com Fri Nov 19 20:22:48 2004 From: rtjohan at syspres.com (rtjohan@syspres.com) Date: Fri Nov 19 20:23:17 2004 Subject: [Pythonmac-SIG] Python + iChat In-Reply-To: <20041119190538.2DD641E4009@bag.python.org> References: <20041119190538.2DD641E4009@bag.python.org> Message-ID: <65C8382E-3A60-11D9-BB8A-000A95A89CC8@syspres.com> Hello Python Fans, Is there a way to use Python to call the iChat API? Thanks, Richard From sw at wordtech-software.com Fri Nov 19 20:24:02 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Fri Nov 19 20:24:06 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac binary installer, 11-2004-fix, available Message-ID: <419E4852.20003@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A new verison of the PyQt-Mac binary installer is available. This version, PyQt-Mac-11-2004-fix, includes a rebuilt version of Qt 3.3.3 with threading support, and adds symlinks to Qt libraries in /usr/lib/ (required by Qt) and /usr/local/lib (required by PyQt). This should address problems with installation that some users were previously reported. This package also includes the Eric 3 IDE, written in PyQt and packaged in a Mac application bundle. For more information and a download link, please see http://www.wordtech-software.com/pyqt-html . A mailing list for PyQt-Mac has also been established. To join the mailing list, see http://lists.sourceforge.net/lists/listinfo/pyqt-mac-list . - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBnkhSJmdQs+6YVcoRAhgqAJ9XS9Ct1J5GD2ErbDXwwnCu+Mn9rACeME+u 7qXhLYfY6qD1JqYKRapUrck= =RSVf -----END PGP SIGNATURE----- From sw at wordtech-software.com Fri Nov 19 20:29:50 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Fri Nov 19 20:29:54 2004 Subject: [Pythonmac-SIG] Re: [PyKDE] ANN: PyQt-Mac binary installer, 11-2004-fix, available In-Reply-To: <419E4852.20003@wordtech-software.com> References: <419E4852.20003@wordtech-software.com> Message-ID: <419E49AE.2080605@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Correction: the link to download is http://www.wordtech-software.com/pyqt-mac.html Kevin Walzer wrote: | A new verison of the PyQt-Mac binary installer is available. This | version, PyQt-Mac-11-2004-fix, includes a rebuilt version of Qt 3.3.3 | with threading support, and adds symlinks to Qt libraries in /usr/lib/ | (required by Qt) and /usr/local/lib (required by PyQt). This should | address problems with installation that some users were previously | reported. This package also includes the Eric 3 IDE, written in PyQt and | packaged in a Mac application bundle. | | For more information and a download link, please see | http://www.wordtech-software.com/pyqt-html . | | A mailing list for PyQt-Mac has also been established. To join the | mailing list, see | http://lists.sourceforge.net/lists/listinfo/pyqt-mac-list . | | _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD4DBQFBnkmuJmdQs+6YVcoRAsG+AJ4hzklJRW2gL95A6RTZqyBGukNOYACVFCRH kj8jY5X+R6m2wpERA33K5A== =Nr3P -----END PGP SIGNATURE----- From bob at redivi.com Fri Nov 19 23:05:20 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Nov 19 23:06:10 2004 Subject: [Pythonmac-SIG] Python + iChat In-Reply-To: <65C8382E-3A60-11D9-BB8A-000A95A89CC8@syspres.com> References: <20041119190538.2DD641E4009@bag.python.org> <65C8382E-3A60-11D9-BB8A-000A95A89CC8@syspres.com> Message-ID: <1A502D7D-3A77-11D9-925A-000A9567635C@redivi.com> On Nov 19, 2004, at 9:22 PM, rtjohan@syspres.com wrote: > Is there a way to use Python to call the iChat API? Of course, but which iChat API are you talking about? The Apple Events API that you can get at from AppleScript, or the undocumented private Objective C implementation? Both are accessible, but you probably won't get any help for the latter. appscript is probably a good place to start for the Apple Events API. -bob From mdavids at bantha.org Sat Nov 20 00:48:39 2004 From: mdavids at bantha.org (Michael Davidson) Date: Sat Nov 20 00:48:46 2004 Subject: [Pythonmac-SIG] IDE crash Message-ID: <20041119234839.GA13130@bantha.org> I have installed the Nov 7,2003 add ins from http://homepages.cwi.nl/~jack/macpython/. My IDE used to work. I foolishly was playing with menu options that I should not have played with, and now my IDE crashes immediately after starting. The menu option I changed was the location of my scripts directory. I set it to a directory with no python scripts, and the IDE crashed. It wouldn't restart. I deleted my prefs file; I reinstalled the IDE. No luck. This is the traceback from the console. If anyone can send me a prefs file that will fix my IDE, I would be much obliged. Traceback (most recent call last): File "/Applications/MacPython-2.3/PythonIDE.app/Contents/Resources/PythonIDE.py", line 59, in ? _PythonIDEMain.PythonIDE() File "/Applications/MacPython-2.3/PythonIDE.app/Contents/Resources/PythonIDEMain.py", line 41, in __init__ Wapplication.Application.__init__(self, 'Pide') File "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/IDE/Wapplication.py", line 28, in __init__ FrameWork.Application.__init__(self) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/FrameWork.py", line 115, in __init__ self.makemenubar() File "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/IDE/Wapplication.py", line 275, in makemenubar self.makeusermenus() File "/Applications/MacPython-2.3/PythonIDE.app/Contents/Resources/PythonIDEMain.py", line 159, in makeusermenus self.makescriptsmenu() File "/Applications/MacPython-2.3/PythonIDE.app/Contents/Resources/PythonIDEMain.py", line 261, in makescriptsmenu self.scriptswalk(fsr.as_pathname(), self.scriptsmenu) File "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/IDE/Wapplication.py", line 309, in scriptswalk self.scriptswalk(path, submenu, done) File "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/IDE/Wapplication.py", line 309, in scriptswalk self.scriptswalk(path, submenu, done) File "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/IDE/Wapplication.py", line 309, in scriptswalk self.scriptswalk(path, submenu, done) File "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/IDE/Wapplication.py", line 308, in scriptswalk submenu = FrameWork.SubMenu(menu, name) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/FrameWork.py", line 708, in SubMenu return menu.addsubmenu(label, title) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/FrameWork.py", line 595, in addsubmenu sub = Menu(self.bar, title, -1) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/FrameWork.py", line 545, in __init__ self.id, self.menu = self.bar.addmenu(title, after, id) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/FrameWork.py", line 479, in addmenu id = self.getnextid() File "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/IDE/Wapplication.py", line 433, in getnextid id = self.possibleIDs[0] IndexError: list index out of range thanks, Michael From bob at redivi.com Sat Nov 20 12:31:13 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Nov 20 12:31:32 2004 Subject: [Pythonmac-SIG] Py2app working with PyQt, PyOpenGL applications? In-Reply-To: <20041119190538.2DD641E4009@bag.python.org> References: <20041119190538.2DD641E4009@bag.python.org> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: sip.py Type: application/octet-stream Size: 1913 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041120/bd1686f4/sip.obj -------------- next part -------------- Skipped content of type multipart/alternative From sw at wordtech-software.com Sat Nov 20 15:49:37 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Sat Nov 20 16:07:01 2004 Subject: [Pythonmac-SIG] ANN: New build of wxGlade for OS X available Message-ID: <419F5981.5050100@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A new build of wxGlade for OS X is available. This build of wxGladeOSX (version 0.3.5.1-cvs, November 2004) requires a separate installation of wxPython. This version allows the documentation to be viewed in the Apple Help Viewer, and also patches a bug that prevented the menu editor from responding to mouse clicks. Unzip the archive and place the wxGlade folder in your /Applications directory. To download, go to http://www.wordtech-software.com/wxglade.html - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBn1mAJmdQs+6YVcoRApkzAJsFQ+Y6P+tekS1EdeoHVRQZHxw1jQCfU433 KhhsydRSttUEQ0cztNfLfYU= =8MWt -----END PGP SIGNATURE----- From bob at redivi.com Sat Nov 20 16:45:19 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Nov 20 16:45:32 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac binary installer, 11-2004-fix, available In-Reply-To: <419E4852.20003@wordtech-software.com> References: <419E4852.20003@wordtech-software.com> Message-ID: <2E857620-3B0B-11D9-925A-000A9567635C@redivi.com> On Nov 19, 2004, at 9:24 PM, Kevin Walzer wrote: > A new verison of the PyQt-Mac binary installer is available. This > version, PyQt-Mac-11-2004-fix, includes a rebuilt version of Qt 3.3.3 > with threading support, and adds symlinks to Qt libraries in /usr/lib/ > (required by Qt) and /usr/local/lib (required by PyQt). This should > address problems with installation that some users were previously > reported. This package also includes the Eric 3 IDE, written in PyQt > and > packaged in a Mac application bundle. Not sure if this is your fault or theirs, but the #! for Eric 3 should not be: #!/Applications/MacPython-2.3/PythonIDE.app/Contents/MacOS/Python It should be: #!/System/Library/Frameworks/Python.framework/Versions/2.3/Resources/ Python.app/Contents/MacOS/Python This works even if the MacPython additions were never installer or have been moved/removed. Perhaps you should also consider putting it somewhere other than /Applications. /Developer/qt/somewhere or /Developer/Applications/Qt Tools/ would probably be more appropriate. -bob From sw at wordtech-software.com Sat Nov 20 17:48:19 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Sat Nov 20 17:48:24 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac binary installer, 11-2004-fix, available In-Reply-To: <2E857620-3B0B-11D9-925A-000A9567635C@redivi.com> References: <419E4852.20003@wordtech-software.com> <2E857620-3B0B-11D9-925A-000A9567635C@redivi.com> Message-ID: <419F7553.3020208@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bob Ippolito wrote: | | Not sure if this is your fault or theirs, but the #! for Eric 3 should | not be: | | #!/Applications/MacPython-2.3/PythonIDE.app/Contents/MacOS/Python | | It should be: | | #!/System/Library/Frameworks/Python.framework/Versions/2.3/Resources/ | Python.app/Contents/MacOS/Python | | This works even if the MacPython additions were never installer or have | been moved/removed. Thanks for clarifying this. I used PythonIDE to generate the applet bundle, and never noticed that it created this dependency. I'm assuming that since it's only being maintained, not developed, that there are probably no plans to change this. I notice that PyOXIDE sets things up the way you suggest, so I will probably switch to that in the next version. Question, though: aren't PythonLauncher and pythonw part of the MacPython distribution? Would a Python app bundle launch correctly if these tools weren't installed? Or are they part of the stock Apple build of Python? I realize that using applets as the basis for my app bundles isn't really the best way to do it, but it does work if the supporting libraries (PyQt, tkinter, wxPython, whatever) are installed. I do plan to spend more time with py2app learning its ins and outs--a lot of it is over my head right now--because I know, overall, that it's a better way to distibute Python applications (more complexity on the developer end, but a lot less on the end user). | | Perhaps you should also consider putting it somewhere other than | /Applications. /Developer/qt/somewhere or /Developer/Applications/Qt | Tools/ would probably be more appropriate. | I'll keep that in mind for the next release of this package (probably when Qt 4.0 is released). There are some things that are hard-coded in this version of Eric3, so I'll leave it as is for now. - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBn3VTJmdQs+6YVcoRAlRUAJ0YtLcZkLDGY1eFf51msgZHx1rFUwCeNaO+ ZthC14DfXptX//51WbVOdLU= =QVFg -----END PGP SIGNATURE----- From bob at redivi.com Sat Nov 20 18:11:51 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Nov 20 18:12:05 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac binary installer, 11-2004-fix, available In-Reply-To: <419F7553.3020208@wordtech-software.com> References: <419E4852.20003@wordtech-software.com> <2E857620-3B0B-11D9-925A-000A9567635C@redivi.com> <419F7553.3020208@wordtech-software.com> Message-ID: <45654F95-3B17-11D9-925A-000A9567635C@redivi.com> On Nov 20, 2004, at 6:48 PM, Kevin Walzer wrote: > Bob Ippolito wrote: > > |Thanks for clarifying this. I used PythonIDE to generate the applet > bundle, and never noticed that it created this dependency. I'm assuming > that since it's only being maintained, not developed, that there are > probably no plans to change this. I notice that PyOXIDE sets things up > the way you suggest, so I will probably switch to that in the next > version. > > Question, though: aren't PythonLauncher and pythonw part of the > MacPython distribution? Would a Python app bundle launch correctly if > these tools weren't installed? Or are they part of the stock Apple > build > of Python? They are included on a stock Mac OS X 10.3+ machine: /System/Library/Frameworks/Python.framework/Versions/2.3/Resources/ PythonLauncher.app /usr/bin/pythonw The MacPython additions mostly just install the _waste extension module and creates a bunch of application bundles or aliases in your application folder. The code behind these applications is basically already installed, though. > I realize that using applets as the basis for my app bundles isn't > really the best way to do it, but it does work if the supporting > libraries (PyQt, tkinter, wxPython, whatever) are installed. I do plan > to spend more time with py2app learning its ins and outs--a lot of it > is > over my head right now--because I know, overall, that it's a better way > to distibute Python applications (more complexity on the developer end, > but a lot less on the end user). Using py2app is only as complex as your requirements. py2app comes with a BuildApplet equivalent where you just drag a source file, icon, Info.plist, resources, etc. and it figures out a reasonable thing to do from there. I can't imagine how it could get any easier. The most important feature, of course, is that it actually does what you want a heck of a lot more often than BuildApplet will. This applet is installed as: /Developer/Applications/Python\ Tools/py2app/py2applet.app (if you are using the .pkg installer of 0.1.5 that I posted). If you want to distribute applications that *require* preinstalled components, then you would do something like python setup.py --site-packages --excludes=wx,wxPython (UNTESTED).. but that's obviously not useful very often. By default, the user's site-packages is removed from sys.path, so that your application launches in a deterministic environment that's much easier to test against (you'll quickly see if it missed anything due to hidden imports). --site-packages turns this feature off, which is necessary when you want to depend on existing components (that are installed to the normal place, anyway). Incidentally, PyQt would be a lot harder to exclude, because it's poorly designed and just throws a whole mess of modules into the root of your site-packages. -bob From sw at wordtech-software.com Sat Nov 20 18:29:46 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Sat Nov 20 18:29:49 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac binary installer, 11-2004-fix, available In-Reply-To: <45654F95-3B17-11D9-925A-000A9567635C@redivi.com> References: <419E4852.20003@wordtech-software.com> <2E857620-3B0B-11D9-925A-000A9567635C@redivi.com> <419F7553.3020208@wordtech-software.com> <45654F95-3B17-11D9-925A-000A9567635C@redivi.com> Message-ID: <419F7F0A.3040406@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bob Ippolito wrote: | Using py2app is only as complex as your requirements. py2app comes | with a BuildApplet equivalent where you just drag a source file, icon, | Info.plist, resources, etc. and it figures out a reasonable thing to do | from there. I can't imagine how it could get any easier. The most | important feature, of course, is that it actually does what you want a | heck of a lot more often than BuildApplet will. This applet is | installed as: | /Developer/Applications/Python\ Tools/py2app/py2applet.app (if you are | using the .pkg installer of 0.1.5 that I posted). | | Wow! I didn't even know this was there: my experience had been working with the sample setup scripts, which I wasn't always getting to work successfully. I'll be sure to take a closer look at this. Thanks for pointing it out. - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBn38JJmdQs+6YVcoRAiG6AJ41HKVcLhsQPwsgvVm43LpWVX/2VACcCKds LPMa5MjQRJBQVsdhuOnGBiA= =n2bN -----END PGP SIGNATURE----- From sw at wordtech-software.com Sat Nov 20 19:35:41 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Sat Nov 20 19:35:47 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac binary installer, 11-2004-fix, available In-Reply-To: <45654F95-3B17-11D9-925A-000A9567635C@redivi.com> References: <419E4852.20003@wordtech-software.com> <2E857620-3B0B-11D9-925A-000A9567635C@redivi.com> <419F7553.3020208@wordtech-software.com> <45654F95-3B17-11D9-925A-000A9567635C@redivi.com> Message-ID: <419F8E7D.1030404@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bob Ippolito wrote: | This applet is installed as: | /Developer/Applications/Python\ Tools/py2app/py2applet.app (if you are | using the .pkg installer of 0.1.5 that I posted). I found this and tried to run it, but got an error: it says: "you cannot open application py2applet because it may be damaged or incomplete." I checked the package contents and while there is a MacOS directory and Resources directory, there are no files in them. Did I do something wrong in installation? (I used the pkg installer.) - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBn458JmdQs+6YVcoRArpDAJ0eVV+LvDQs5PQCJPXxoNFp7i++XQCfQtb7 v8hECG2QnDiyEinYfpgxKVw= =Z8rt -----END PGP SIGNATURE----- From bob at redivi.com Sat Nov 20 19:41:50 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Nov 20 19:42:00 2004 Subject: [Pythonmac-SIG] ANN: PyQt-Mac binary installer, 11-2004-fix, available In-Reply-To: <419F8E7D.1030404@wordtech-software.com> References: <419E4852.20003@wordtech-software.com> <2E857620-3B0B-11D9-925A-000A9567635C@redivi.com> <419F7553.3020208@wordtech-software.com> <45654F95-3B17-11D9-925A-000A9567635C@redivi.com> <419F8E7D.1030404@wordtech-software.com> Message-ID: On Nov 20, 2004, at 8:35 PM, Kevin Walzer wrote: > Bob Ippolito wrote: > > | This applet is installed as: > | /Developer/Applications/Python\ Tools/py2app/py2applet.app (if you > are > | using the .pkg installer of 0.1.5 that I posted). > > I found this and tried to run it, but got an error: it says: "you > cannot > open application py2applet because it may be damaged or incomplete." I > checked the package contents and while there is a MacOS directory and > Resources directory, there are no files in them. Did I do something > wrong in installation? (I used the pkg installer.) Strange, looks like bdist_mpkg didn't end up including them for some reason.. If you get the source package and type python setup.py py2app from the tools/py2applet directory, it will build a working one. -bob From mgaiman at gwu.edu Sun Nov 21 03:41:00 2004 From: mgaiman at gwu.edu (Michael Gaiman) Date: Sun Nov 21 03:41:08 2004 Subject: [Pythonmac-SIG] Embedded Python compiling help Message-ID: Hi All, I'm getting started embedding python for a school project. I am starting by getting the program listed in http://docs.python.org/ext/pure-embedding.html. The next step is compiling. I've tried quite a few gcc commands, but no dice. The latest command I've tried is gcc -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ python2.3 -L/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/config -o runfunc run-func.c which fails due to undefined symbols. If anybody could take a minute and list the correct gcc command to compile and link this program, I would be very grateful. I'm using MacOSX 10.3.6 with the built in python. From bob at redivi.com Sun Nov 21 09:39:35 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Nov 21 09:40:26 2004 Subject: [Pythonmac-SIG] Embedded Python compiling help In-Reply-To: References: Message-ID: On Nov 21, 2004, at 4:41 AM, Michael Gaiman wrote: > Hi All, > > I'm getting started embedding python for a school project. I am > starting by getting the program listed in > http://docs.python.org/ext/pure-embedding.html. The next step is > compiling. I've tried quite a few gcc commands, but no dice. The > latest command I've tried is > > gcc > -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ > python2.3 > -L/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/config -o runfunc run-func.c which fails due to undefined > symbols. > > If anybody could take a minute and list the correct gcc command to > compile and link this program, I would be very grateful. > > I'm using MacOSX 10.3.6 with the built in python. gcc -o runfunc run-func.c `python -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('PY_CFLAGS')"` -bob From bob at redivi.com Sun Nov 21 09:50:01 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Nov 21 09:50:47 2004 Subject: [Pythonmac-SIG] Embedded Python compiling help In-Reply-To: References: Message-ID: <54A90352-3B9A-11D9-82AB-000A9567635C@redivi.com> On Nov 21, 2004, at 10:39 AM, Bob Ippolito wrote: > > On Nov 21, 2004, at 4:41 AM, Michael Gaiman wrote: > >> Hi All, >> >> I'm getting started embedding python for a school project. I am >> starting by getting the program listed in >> http://docs.python.org/ext/pure-embedding.html. The next step is >> compiling. I've tried quite a few gcc commands, but no dice. The >> latest command I've tried is >> >> gcc >> -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ >> python2.3 >> -L/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ >> python2.3/config -o runfunc run-func.c which fails due to undefined >> symbols. >> >> If anybody could take a minute and list the correct gcc command to >> compile and link this program, I would be very grateful. >> >> I'm using MacOSX 10.3.6 with the built in python. > > gcc -o runfunc run-func.c `python -c "import distutils.sysconfig;print > distutils.sysconfig.get_config_var('PY_CFLAGS')"` er.. that's not it, but it's close.. you probably also need the output of print '-I' + distutils.sysconfig.get_config_var('INCLUDEPY') -bob From ronaldoussoren at mac.com Sun Nov 21 12:54:22 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun Nov 21 12:54:40 2004 Subject: Fwd: [Pythonmac-SIG] ANN: PyQt-Mac binary installer, 11-2004-fix, available References: Message-ID: Forgot to cc the group... Begin forwarded message: > From: Ronald Oussoren > Date: 21 november 2004 9:26:26 GMT+01:00 > To: Bob Ippolito > Subject: Re: [Pythonmac-SIG] ANN: PyQt-Mac binary installer, > 11-2004-fix, available > > > On 20-nov-2004, at 16:45, Bob Ippolito wrote: > > >> >> >> Perhaps you should also consider putting it somewhere other than >> /Applications. /Developer/qt/somewhere or /Developer/Applications/Qt >> Tools/ would probably be more appropriate. >> > > /Developer would not be a good choice either. Older versions of the > developer tools installer would remove /Developer before installing a > new version. I haven't checked if the latest installer still does > that. > > Ronald > > > > From mgaiman at gwu.edu Sun Nov 21 15:52:42 2004 From: mgaiman at gwu.edu (Michael Gaiman) Date: Sun Nov 21 15:52:46 2004 Subject: [Pythonmac-SIG] Embedded Python compiling help In-Reply-To: <54A90352-3B9A-11D9-82AB-000A9567635C@redivi.com> References: <54A90352-3B9A-11D9-82AB-000A9567635C@redivi.com> Message-ID: Thanks for your help, Bob. The gcc command it had me gave me is gcc -o runfunc run-func.c -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/private/var/tmp/python/python-7.obj~4/python/Include -DPy_BUILD_CORE -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ python2.3 which produces the following output: ld: Undefined symbols: _PyCallable_Check _PyDict_GetItemString _PyErr_Occurred _PyErr_Print _PyImport_Import _PyInt_AsLong _PyInt_FromLong _PyModule_GetDict _PyObject_CallObject _PyString_FromString _PyTuple_New _PyTuple_SetItem _Py_Finalize _Py_Initialize Sorry if I'm missing something super obvious, I've not really spend too much time with gcc. Thanks, Mike On Nov 21, 2004, at 3:50 AM, Bob Ippolito wrote: > > On Nov 21, 2004, at 10:39 AM, Bob Ippolito wrote: > >> >> On Nov 21, 2004, at 4:41 AM, Michael Gaiman wrote: >> >>> Hi All, >>> >>> I'm getting started embedding python for a school project. I am >>> starting by getting the program listed in >>> http://docs.python.org/ext/pure-embedding.html. The next step is >>> compiling. I've tried quite a few gcc commands, but no dice. The >>> latest command I've tried is >>> >>> gcc >>> -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ >>> python2.3 >>> -L/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ >>> python2.3/config -o runfunc run-func.c which fails due to undefined >>> symbols. >>> >>> If anybody could take a minute and list the correct gcc command to >>> compile and link this program, I would be very grateful. >>> >>> I'm using MacOSX 10.3.6 with the built in python. >> >> gcc -o runfunc run-func.c `python -c "import >> distutils.sysconfig;print >> distutils.sysconfig.get_config_var('PY_CFLAGS')"` > > er.. that's not it, but it's close.. you probably also need the output > of print '-I' + distutils.sysconfig.get_config_var('INCLUDEPY') > > -bob > From huaicai at nanorex.com Mon Nov 22 18:02:23 2004 From: huaicai at nanorex.com (Huaicai Mo) Date: Mon Nov 22 18:02:28 2004 Subject: [Pythonmac-SIG] Py2app working with PyQt, PyOpenGL applications? In-Reply-To: Message-ID: <20041122170226.91D211E4002@bag.python.org> Bob, Thank you so much. It works for me now. Regards, Huaicai ________________________________ From: Bob Ippolito [mailto:bob@redivi.com] Sent: Saturday, November 20, 2004 6:31 AM To: Huaicai Mo Cc: pythonmac-sig@python.org Subject: Re: [Pythonmac-SIG] Py2app working with PyQt, PyOpenGL applications? Thanks to Kevin's latest PyQt package I have thrown together a recipe that should generate PyQt applications correctly (it seems to generate aclock.py correctly, anyway). sip, the tool used to generate PyQt, does some REALLY AWFUL THINGS FROM C that can't reasonably be analyzed, so this py2app recipe must include *all* sip-built modules when ANY sip-built module is included (in practice, "sip-built" probably means PyQt). You should be able to trim this by explicitly specifying excludes for the sip-built you know that you do not need. Put this sip.py in py2app/recipes/ and add "import sip" to py2app/recipes/__init__.py From pecora at anvil.nrl.navy.mil Mon Nov 22 18:34:48 2004 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Mon Nov 22 18:34:24 2004 Subject: [Pythonmac-SIG] In panther where are Python Carbon files Qd, Quickdraw, etc? Message-ID: <41A22338.7030109@anvil.nrl.navy.mil> I switched to Panther (archive and install) and installed MacPython Addons. But there are files missing. I tried to use the Piddle plotting library (which worked in Jaguar), but now Qd.py, Quickdraw.py and a host of other files are 'missing' . A search shows that the older versions were archived in /Previous Systems/Previous System 1/Library/Frameworks/...blah blah/python2.3/plat-mac/Carbon/ (whew! what a pathname!), but no new versions appear in my /Library or any other folders. Is there a way to reinstall them? I really don't want to try manually moving them. I'd probably screw something up. And I'm probably missing other things, too. Any ideas appreciated. I miss that plotting package. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora@anvil.nrl.navy.mil From bob at redivi.com Mon Nov 22 19:04:37 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Nov 22 19:04:53 2004 Subject: [Pythonmac-SIG] In panther where are Python Carbon files Qd, Quickdraw, etc? In-Reply-To: <41A22338.7030109@anvil.nrl.navy.mil> References: <41A22338.7030109@anvil.nrl.navy.mil> Message-ID: On Nov 22, 2004, at 7:34 PM, Louis Pecora wrote: > I switched to Panther (archive and install) and installed MacPython > Addons. But there are files missing. I tried to use the Piddle > plotting library (which worked in Jaguar), but now Qd.py, Quickdraw.py > and a host of other files are 'missing' . A search shows that the > older versions were archived in > /Previous Systems/Previous System 1/Library/Frameworks/...blah > blah/python2.3/plat-mac/Carbon/ (whew! what a pathname!), but no new > versions appear in my /Library or any other folders. > > Is there a way to reinstall them? I really don't want to try manually > moving them. I'd probably screw something up. And I'm probably > missing other things, too. > > Any ideas appreciated. I miss that plotting package. Maybe you need to install the latest Xcode as well? I sure have them here, on my laptop, which has a relatively untouched and fresh (formatted before install) installation of OS X 10.3 and Xcode. -bob From Chris.Barker at noaa.gov Mon Nov 22 21:08:22 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Mon Nov 22 21:10:44 2004 Subject: [Pythonmac-SIG] setup.py for Numeric/Numarray Message-ID: <41A24736.7050903@noaa.gov> Hi all, Bob's patch to the Numeric setup.py made it's way to the numaray CVS, and there is a little discussion about improvements. I really don't know what to say but if some if the OS-X experts (Bob and Jack, anyway!) on this list could weigh in, the would be great. Here is a consolidation of the thread: Andrea Riciputi wrote: > I've noticed your patch for MacOS X, and I think that a better solution > should use sys.platform instead of a path search, since Apple could > always change its framework location. I've also removed the > VECLIB_PATH/Headers from the include path because AFAIK Apple gcc > already knows where to search for the vecLib framework. Here it is a > diff output between my addons.py and the CVS one. >> ! if sys.platform == "darwin": >> ! lapack_include_dirs = >> ["Packages/LinearAlgebra2/Src",'Include/numarray'] >> - lapack_link_args = ['-framework', 'vecLib'] >> ! VECLIB_PATH = '/System/Library/Frameworks/vecLib.framework' >> ! if os.path.exists(VECLIB_PATH): >> ! lapack_link_args = ['-framework', 'vecLib'] >> ! lapack_include_dirs.append( os.path.join(VECLIB_PATH, >> 'Headers')) >> lapack_libs = [] >> lapack_dirs = [] Todd Miller wrote: > Not to look a patch-horse in the mouth, but IMHO, the sys.platform idea > is good but the VECLIB_PATH elimination maybe less so. The reason I > question the VECLIB_PATH change is that we're removing explicit and > generally harmless extra information in exchange for two assumptions: > (1) gcc knows the path already (2) the numarray Mac user is using gcc. > Other opinions? Mac users please speak up if you think the VECLIB_PATH > change is a good one or it won't get done. Andrea Riciputi wrote: > I see your point but AFAIK the links option "-framework vecLib" will > work *only* with Apple gcc (ld) and Apple gcc (ld) does know where > frameworks are. From Apple ld man page: > > >> -framework name[,suffix] >> Specifies a framework to link against. Frameworks are dynamic >> shared libraries, but they are stored in different locations, >> and therefore must be searched for differently. When this option >> is specified, ld searches for framework `name.framework/name' >> first in any directories specified with the -F option, then in >> the standard framework directories /Library/Frameworks, /Net- >> work/Library/Frameworks, and /System/Library/Frameworks. The >> placement of the -framework option is significant, as it deter- >> mines when and how the framework is searched. If the optional >> suffix is specified the framework is first searched for the name >> with the suffix and then without. > > > >> -Fdir >> In Apple's version of GCC only, add the directory dir to the head >> of the list of directories to be searched for frameworks. >> >> The framework search algorithm is, for an inclusion of >> , to look for files named path/Fmwk.framework/Head- >> ers/Header.h or path/Fmwk.framework/PrivateHeaders/Header.h where >> path includes /System/Library/Frameworks/ /Library/Frameworks/, and >> /Local/Library/Frameworks/, plus any additional paths specified by >> -F. Robert Kern wrote: > IBM's xlc will also find the appropriate framework, but as you can see > this is only a link-time option and has nothing to do with finding headers. > > Using > > #include > > will find the appropriate header without any command-line options. Using > > #include > > will not. > > Fortunately, neither one is used nor needed by lapack_litemodule.c, so > for this case, no include-path needs to be specified. If you don't want to post tot he NumPy list directly, I'd be glad to forward comments on. -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 bob at redivi.com Mon Nov 22 23:37:23 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Nov 22 23:38:12 2004 Subject: [Pythonmac-SIG] setup.py for Numeric/Numarray In-Reply-To: <41A24736.7050903@noaa.gov> References: <41A24736.7050903@noaa.gov> Message-ID: <13DB298D-3CD7-11D9-A3C9-000A9567635C@redivi.com> Two things: 1) Apple can't (or rather, won't ever) change their framework location. 2) Darwin might be Darwin and not Mac OS X, which won't have vecLib. 3) Checking for both is silly, because you won't reasonably ever have the path to vecLib on a non-Darwin platform.. and if you somehow do, it'll probably work anyway. I can give more flexible code with regard to locating frameworks in an identical manner to what gcc and dyld do, but that is only going to be applicable if you work at Apple, or you are building against an SDK, neither of which happen very often in practice. With regard to building against a SDK, the API used by Numeric that is provided by vecLib isn't going to change, ever, unless Numeric wants more stuff that is provided only in OS X 10.4+, for example. This would be an issue when and if it happens, but in that case you would probably link against the NEW name (Accelerate.framework). I'm not sure if the vecLib API is supported by OS X 10.1, but someone else is going to have to care about that because I sure don't. Alternate linkers isn't really a concern because the three command-line compilers that matter probably all support the -framework flag. Apple's GCC (obviously..) and IBM's XLC (according to Robert) certainly do, and more likely than not, MetroWerks CodeWarrior also does (someone else would have to confirm this). If Fink or Gentoo ships some purely GNU-based compiler/linker that doesn't support -framework, I'd consider that a bug. I'm not sure how they'd get many things to compile correctly without it, unless they're emulating it by specifying paths directly to the Mach-O MH_DYLIB files (/System/Library/Frameworks/vecLib.framework/vecLib, for example) PLUS using non-framework-style header paths everywhere, since would never work if you -I to anywhere in the framework tree. Does an unpatched GNU toolchain even understand Mach-O in the first place? Most likely a non-issue in any case, but I'm not about to Finkify any machine to test that theory. In summary, I wrote the patch in that way for the specific reason of doing it as correctly as possible without overcomplicating things. I hope that people would trust that I know what I'm doing. [not cross-posted because the message I'm replying to isn't cross-posted, too lazy to figure out where it should be CC'ed to] -bob On Nov 22, 2004, at 10:08 PM, Chris Barker wrote: > Hi all, > > Bob's patch to the Numeric setup.py made it's way to the numaray CVS, > and there is a little discussion about improvements. I really don't > know what to say but if some if the OS-X experts (Bob and Jack, > anyway!) on this list could weigh in, the would be great. Here is a > consolidation of the thread: > > Andrea Riciputi wrote: >> I've noticed your patch for MacOS X, and I think that a better >> solution should use sys.platform instead of a path search, since >> Apple could always change its framework location. I've also removed >> the VECLIB_PATH/Headers from the include path because AFAIK Apple >> gcc already knows where to search for the vecLib framework. Here it >> is a diff output between my addons.py and the CVS one. > > > >>> ! if sys.platform == "darwin": >>> ! lapack_include_dirs = >>> ["Packages/LinearAlgebra2/Src",'Include/numarray'] > >>> - lapack_link_args = ['-framework', 'vecLib'] > >>> ! VECLIB_PATH = '/System/Library/Frameworks/vecLib.framework' >>> ! if os.path.exists(VECLIB_PATH): >>> ! lapack_link_args = ['-framework', 'vecLib'] >>> ! lapack_include_dirs.append( os.path.join(VECLIB_PATH, >>> 'Headers')) >>> lapack_libs = [] >>> lapack_dirs = [] > > Todd Miller wrote: > >> Not to look a patch-horse in the mouth, but IMHO, the sys.platform >> idea >> is good but the VECLIB_PATH elimination maybe less so. The reason I >> question the VECLIB_PATH change is that we're removing explicit and >> generally harmless extra information in exchange for two assumptions: >> (1) gcc knows the path already (2) the numarray Mac user is using >> gcc. Other opinions? Mac users please speak up if you think the >> VECLIB_PATH >> change is a good one or it won't get done. > > Andrea Riciputi wrote: >> I see your point but AFAIK the links option "-framework vecLib" will >> work *only* with Apple gcc (ld) and Apple gcc (ld) does know where >> frameworks are. From Apple ld man page: >>> -framework name[,suffix] >>> Specifies a framework to link against. Frameworks are dynamic >>> shared libraries, but they are stored in different locations, >>> and therefore must be searched for differently. When this option >>> is specified, ld searches for framework `name.framework/name' >>> first in any directories specified with the -F option, then in >>> the standard framework directories /Library/Frameworks, /Net- >>> work/Library/Frameworks, and /System/Library/Frameworks. The >>> placement of the -framework option is significant, as it deter- >>> mines when and how the framework is searched. If the optional >>> suffix is specified the framework is first searched for the name >>> with the suffix and then without. >>> -Fdir >>> In Apple's version of GCC only, add the directory dir to the head >>> of the list of directories to be searched for frameworks. >>> >>> The framework search algorithm is, for an inclusion of >>> , to look for files named >>> path/Fmwk.framework/Head- >>> ers/Header.h or path/Fmwk.framework/PrivateHeaders/Header.h where >>> path includes /System/Library/Frameworks/ /Library/Frameworks/, >>> and >>> /Local/Library/Frameworks/, plus any additional paths specified >>> by >>> -F. > > Robert Kern wrote: >> IBM's xlc will also find the appropriate framework, but as you can >> see this is only a link-time option and has nothing to do with >> finding headers. >> Using >> #include >> will find the appropriate header without any command-line options. >> Using >> #include >> will not. >> Fortunately, neither one is used nor needed by lapack_litemodule.c, >> so for this case, no include-path needs to be specified. > > If you don't want to post tot he NumPy list directly, I'd be glad to > forward comments on. > > -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 > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From Dave.Opstad at monotypeimaging.com Tue Nov 23 00:32:42 2004 From: Dave.Opstad at monotypeimaging.com (Opstad, Dave) Date: Tue Nov 23 00:33:38 2004 Subject: [Pythonmac-SIG] Error message: no module named PyShell Message-ID: Hi, all. I just did a clean install of 10.3.6 on an erased disk, and then XCode 1.5, and then the MacPython-Panther-2.3-2 installer. All the installers ran fine, but when I try to double-click the newly installed IDLE nothing happens, and the Console logs the error message "no module named PyShell." Since this was a clean install there are no older installations here. What do I need to do? I've restarted but that didn't help, and there wasn't anything in the MacPython wiki with the word "PyShell". Thanks for any help! Dave Opstad From sw at wordtech-software.com Tue Nov 23 14:33:17 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Tue Nov 23 14:33:20 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 19, Issue 27 In-Reply-To: <20041123110005.036CA1E4010@bag.python.org> References: <20041123110005.036CA1E4010@bag.python.org> Message-ID: <41A33C1D.2030909@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 IDLE needs Tk/Aqua and tkinter. Go to http://tcltkaqua.sourceforge.net to get Tk Aqua, then use Package Manager to install tkinter (the Python bindings). | | Hi, all. I just did a clean install of 10.3.6 on an erased disk, and then | XCode 1.5, and then the MacPython-Panther-2.3-2 installer. All the | installers ran fine, but when I try to double-click the newly installed IDLE | nothing happens, and the Console logs the error message "no module named | PyShell." | | Since this was a clean install there are no older installations here. What | do I need to do? I've restarted but that didn't help, and there wasn't | anything in the MacPython wiki with the word "PyShell". | | Thanks for any help! | Dave Opstad | | - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBozwcJmdQs+6YVcoRAjrgAJ9VeyOnqrZr22XJWp9W/B8fbyuKWACfd+1c tjKvV4oeuVIDGulfP84/EQs= =I1Sc -----END PGP SIGNATURE----- From pecora at anvil.nrl.navy.mil Tue Nov 23 15:42:58 2004 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Tue Nov 23 15:42:35 2004 Subject: [Pythonmac-SIG] In panther where are Python Carbon files Qd, Quickdraw, etc? In-Reply-To: References: <41A22338.7030109@anvil.nrl.navy.mil> Message-ID: <41A34C72.1090906@anvil.nrl.navy.mil> Bob Ippolito wrote: > > On Nov 22, 2004, at 7:34 PM, Louis Pecora wrote: > >> I switched to Panther (archive and install) and installed MacPython >> Addons. But there are files missing. I tried to use the Piddle >> plotting library (which worked in Jaguar), but now Qd.py, >> Quickdraw.py and a host of other files are 'missing' . A search >> shows that the older versions were archived in >> /Previous Systems/Previous System 1/Library/Frameworks/...blah >> blah/python2.3/plat-mac/Carbon/ (whew! what a pathname!), but no >> new versions appear in my /Library or any other folders. >> >> Is there a way to reinstall them? I really don't want to try >> manually moving them. I'd probably screw something up. And I'm >> probably missing other things, too. >> >> Any ideas appreciated. I miss that plotting package. > > > Maybe you need to install the latest Xcode as well? I sure have them > here, on my laptop, which has a relatively untouched and fresh > (formatted before install) installation of OS X 10.3 and Xcode. > > -bob > > I already have Xcode 1.5 installed (the latest, I think). I did a file search and they don't show up. Where are your Qd.py, etc. files located? Maybe there's an option to install them from Xcode and I missed that. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora@anvil.nrl.navy.mil From bob at redivi.com Tue Nov 23 15:49:06 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 23 15:49:22 2004 Subject: [Pythonmac-SIG] In panther where are Python Carbon files Qd, Quickdraw, etc? In-Reply-To: <41A34C72.1090906@anvil.nrl.navy.mil> References: <41A22338.7030109@anvil.nrl.navy.mil> <41A34C72.1090906@anvil.nrl.navy.mil> Message-ID: On Nov 23, 2004, at 4:42 PM, Louis Pecora wrote: > Bob Ippolito wrote: > >> >> On Nov 22, 2004, at 7:34 PM, Louis Pecora wrote: >> >>> I switched to Panther (archive and install) and installed MacPython >>> Addons. But there are files missing. I tried to use the Piddle >>> plotting library (which worked in Jaguar), but now Qd.py, >>> Quickdraw.py and a host of other files are 'missing' . A search >>> shows that the older versions were archived in >>> /Previous Systems/Previous System 1/Library/Frameworks/...blah >>> blah/python2.3/plat-mac/Carbon/ (whew! what a pathname!), but no >>> new versions appear in my /Library or any other folders. >>> >>> Is there a way to reinstall them? I really don't want to try >>> manually moving them. I'd probably screw something up. And I'm >>> probably missing other things, too. >>> >>> Any ideas appreciated. I miss that plotting package. >> >> >> Maybe you need to install the latest Xcode as well? I sure have them >> here, on my laptop, which has a relatively untouched and fresh >> (formatted before install) installation of OS X 10.3 and Xcode. >> > I already have Xcode 1.5 installed (the latest, I think). I did a > file search and they don't show up. Where are your Qd.py, etc. files > located? Maybe there's an option to install them from Xcode and I > missed that. Standard place: /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/Carbon/Qd.py Not sure whether it was your Xcode or OS X upgrade, but at least one of the two did the wrong thing. -bob From Dave.Opstad at monotypeimaging.com Tue Nov 23 16:27:06 2004 From: Dave.Opstad at monotypeimaging.com (Opstad, Dave) Date: Tue Nov 23 16:26:43 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 19, Issue 27 In-Reply-To: <41A33C1D.2030909@wordtech-software.com> Message-ID: On 11/23/04 5:33 AM, "Kevin Walzer" wrote: > IDLE needs Tk/Aqua and tkinter. Go to http://tcltkaqua.sourceforge.net > to get Tk Aqua, then use Package Manager to install tkinter (the Python > bindings). Unfortunately, that didn't help. I installed the TclTkAqua package, but launching Package Manager results in an error window with the message "Cannot open http://www.python.org/packman/version-0.3/darwin-7.6.0-Power_Macintosh.plist : HTTP Error 404: Not Found" I know the machine is connected to the network fine, as I can browse in Safari with no problems. I'd appreciate any help! Thanks, Dave From bob at redivi.com Tue Nov 23 17:02:52 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 23 17:03:06 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 19, Issue 27 In-Reply-To: References: Message-ID: <219BAE0A-3D69-11D9-B93C-000A9567635C@redivi.com> On Nov 23, 2004, at 5:27 PM, Opstad, Dave wrote: > On 11/23/04 5:33 AM, "Kevin Walzer" wrote: > >> IDLE needs Tk/Aqua and tkinter. Go to http://tcltkaqua.sourceforge.net >> to get Tk Aqua, then use Package Manager to install tkinter (the >> Python >> bindings). > > Unfortunately, that didn't help. I installed the TclTkAqua package, but > launching Package Manager results in an error window with the message > "Cannot open > http://www.python.org/packman/version-0.3/darwin-7.6.0- > Power_Macintosh.plist > : HTTP Error 404: Not Found" > > I know the machine is connected to the network fine, as I can browse in > Safari with no problems. I'd appreciate any help! Tell PackageManager to use the URL http://www.python.org/packman/version-0.3/darwin-7.5.0- Power_Macintosh.plist .. there should be some way in the GUI to do this, hopefully it doesn't just quit if the main database is not found. -bob From Dave.Opstad at monotypeimaging.com Tue Nov 23 17:15:36 2004 From: Dave.Opstad at monotypeimaging.com (Opstad, Dave) Date: Tue Nov 23 17:15:15 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 19, Issue 27 In-Reply-To: <219BAE0A-3D69-11D9-B93C-000A9567635C@redivi.com> Message-ID: On 11/23/04 8:02 AM, "Bob Ippolito" wrote: > Tell PackageManager to use the URL > http://www.python.org/packman/version-0.3/darwin-7.5.0- > Power_Macintosh.plist .. there should be some way in the GUI to do > this, hopefully it doesn't just quit if the main database is not found. That did the trick; thanks! I typed in that URL to the Open URL dialog, and it worked. Dave From Chris.Barker at noaa.gov Tue Nov 23 19:06:15 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Tue Nov 23 19:08:39 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 19, Issue 27 In-Reply-To: <219BAE0A-3D69-11D9-B93C-000A9567635C@redivi.com> References: <219BAE0A-3D69-11D9-B93C-000A9567635C@redivi.com> Message-ID: <41A37C17.5080401@noaa.gov> Bob Ippolito wrote: > Tell PackageManager to use the URL > http://www.python.org/packman/version-0.3/darwin-7.5.0- > Power_Macintosh.plist .. there should be some way in the GUI to do > this, hopefully it doesn't just quit if the main database is not found. no, it doesn't quite, but it gives absolutely no clue what to do. Last time, I went to Bob's database instead. This really does point out a flaw in the Packman concept. Jack, could you either: A) have Packman look for older versions when the latest isn't found or B) put in a link from darwin-7.6.0 to darwin-7.5.0 Is there any reason to think that we need to be tracking the minor version number anyway? -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 delza at livingcode.org Tue Nov 23 22:34:34 2004 From: delza at livingcode.org (Dethe Elza) Date: Tue Nov 23 22:34:33 2004 Subject: [Pythonmac-SIG] Categories and runtime functions Message-ID: <784CD99E-3D97-11D9-ACCB-0003939B59E8@livingcode.org> Can PyObjC be used to extend existing Objective-C classes, either via Categories or class_addMethods() (or in any other way)? What are the requirements to do so? For instance, I believe Categories require the headers to be available. --Dethe "And you think you're so clever and classless and free" ? John Lennon on prototype-based programming -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2488 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041123/e0f29ae4/smime.bin From mww at opendarwin.org Wed Nov 24 01:36:44 2004 From: mww at opendarwin.org (Markus W.Weissmann) Date: Wed Nov 24 01:36:56 2004 Subject: [Pythonmac-SIG] setup.py for Numeric/Numarray In-Reply-To: <13DB298D-3CD7-11D9-A3C9-000A9567635C@redivi.com> References: <41A24736.7050903@noaa.gov> <13DB298D-3CD7-11D9-A3C9-000A9567635C@redivi.com> Message-ID: On Nov 22, 2004, at 23:37, Bob Ippolito wrote: > Two things: > > 1) Apple can't (or rather, won't ever) change their framework location. > 2) Darwin might be Darwin and not Mac OS X, which won't have vecLib. this is a mistake that I see quite often: implying MacOS-X or just PPC from "darwin" I have to second Bob on that one - please don't do that! It's quite a pain to fix this kind of bugs so stuff will work on OpenDarwin or even OpenDarwin/x86; -Markus > 3) Checking for both is silly, because you won't reasonably ever have > the path to vecLib on a non-Darwin platform.. and if you somehow do, > it'll probably work anyway. > > I can give more flexible code with regard to locating frameworks in an > identical manner to what gcc and dyld do, but that is only going to be > applicable if you work at Apple, or you are building against an SDK, > neither of which happen very often in practice. With regard to > building against a SDK, the API used by Numeric that is provided by > vecLib isn't going to change, ever, unless Numeric wants more stuff > that is provided only in OS X 10.4+, for example. This would be an > issue when and if it happens, but in that case you would probably link > against the NEW name (Accelerate.framework). I'm not sure if the > vecLib API is supported by OS X 10.1, but someone else is going to > have to care about that because I sure don't. > > Alternate linkers isn't really a concern because the three > command-line compilers that matter probably all support the -framework > flag. Apple's GCC (obviously..) and IBM's XLC (according to Robert) > certainly do, and more likely than not, MetroWerks CodeWarrior also > does (someone else would have to confirm this). If Fink or Gentoo > ships some purely GNU-based compiler/linker that doesn't support > -framework, I'd consider that a bug. I'm not sure how they'd get many > things to compile correctly without it, unless they're emulating it by > specifying paths directly to the Mach-O MH_DYLIB files > (/System/Library/Frameworks/vecLib.framework/vecLib, for example) PLUS > using non-framework-style header paths everywhere, since > would never work if you -I to anywhere in the > framework tree. Does an unpatched GNU toolchain even understand > Mach-O in the first place? Most likely a non-issue in any case, but > I'm not about to Finkify any machine to test that theory. > > In summary, I wrote the patch in that way for the specific reason of > doing it as correctly as possible without overcomplicating things. I > hope that people would trust that I know what I'm doing. > > [not cross-posted because the message I'm replying to isn't > cross-posted, too lazy to figure out where it should be CC'ed to] > > -bob > > On Nov 22, 2004, at 10:08 PM, Chris Barker wrote: > >> Hi all, >> >> Bob's patch to the Numeric setup.py made it's way to the numaray CVS, >> and there is a little discussion about improvements. I really don't >> know what to say but if some if the OS-X experts (Bob and Jack, >> anyway!) on this list could weigh in, the would be great. Here is a >> consolidation of the thread: >> >> Andrea Riciputi wrote: >>> I've noticed your patch for MacOS X, and I think that a better >>> solution should use sys.platform instead of a path search, since >>> Apple could always change its framework location. I've also removed >>> the VECLIB_PATH/Headers from the include path because AFAIK Apple >>> gcc already knows where to search for the vecLib framework. Here it >>> is a diff output between my addons.py and the CVS one. >> >> >> >>>> ! if sys.platform == "darwin": >>>> ! lapack_include_dirs = >>>> ["Packages/LinearAlgebra2/Src",'Include/numarray'] >> >>>> - lapack_link_args = ['-framework', 'vecLib'] >> >>>> ! VECLIB_PATH = '/System/Library/Frameworks/vecLib.framework' >>>> ! if os.path.exists(VECLIB_PATH): >>>> ! lapack_link_args = ['-framework', 'vecLib'] >>>> ! lapack_include_dirs.append( os.path.join(VECLIB_PATH, >>>> 'Headers')) >>>> lapack_libs = [] >>>> lapack_dirs = [] >> >> Todd Miller wrote: >> >>> Not to look a patch-horse in the mouth, but IMHO, the sys.platform >>> idea >>> is good but the VECLIB_PATH elimination maybe less so. The reason I >>> question the VECLIB_PATH change is that we're removing explicit and >>> generally harmless extra information in exchange for two >>> assumptions: (1) gcc knows the path already (2) the numarray Mac >>> user is using gcc. Other opinions? Mac users please speak up if you >>> think the VECLIB_PATH >>> change is a good one or it won't get done. >> >> Andrea Riciputi wrote: >>> I see your point but AFAIK the links option "-framework vecLib" will >>> work *only* with Apple gcc (ld) and Apple gcc (ld) does know where >>> frameworks are. From Apple ld man page: >>>> -framework name[,suffix] >>>> Specifies a framework to link against. Frameworks are dynamic >>>> shared libraries, but they are stored in different locations, >>>> and therefore must be searched for differently. When this option >>>> is specified, ld searches for framework `name.framework/name' >>>> first in any directories specified with the -F option, then in >>>> the standard framework directories /Library/Frameworks, /Net- >>>> work/Library/Frameworks, and /System/Library/Frameworks. The >>>> placement of the -framework option is significant, as it deter- >>>> mines when and how the framework is searched. If the optional >>>> suffix is specified the framework is first searched for the name >>>> with the suffix and then without. >>>> -Fdir >>>> In Apple's version of GCC only, add the directory dir to the >>>> head >>>> of the list of directories to be searched for frameworks. >>>> >>>> The framework search algorithm is, for an inclusion of >>>> , to look for files named >>>> path/Fmwk.framework/Head- >>>> ers/Header.h or path/Fmwk.framework/PrivateHeaders/Header.h >>>> where >>>> path includes /System/Library/Frameworks/ /Library/Frameworks/, >>>> and >>>> /Local/Library/Frameworks/, plus any additional paths specified >>>> by >>>> -F. >> >> Robert Kern wrote: >>> IBM's xlc will also find the appropriate framework, but as you can >>> see this is only a link-time option and has nothing to do with >>> finding headers. >>> Using >>> #include >>> will find the appropriate header without any command-line options. >>> Using >>> #include >>> will not. >>> Fortunately, neither one is used nor needed by lapack_litemodule.c, >>> so for this case, no include-path needs to be specified. >> >> If you don't want to post tot he NumPy list directly, I'd be glad to >> forward comments on. >> >> -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 >> _______________________________________________ >> 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 > --- Markus W. Weissmann http://www.mweissmann.de/ http://www.opendarwin.org/~mww/ From ronaldoussoren at mac.com Wed Nov 24 07:31:52 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed Nov 24 07:32:07 2004 Subject: [Pythonmac-SIG] Categories and runtime functions In-Reply-To: <784CD99E-3D97-11D9-ACCB-0003939B59E8@livingcode.org> References: <784CD99E-3D97-11D9-ACCB-0003939B59E8@livingcode.org> Message-ID: <87160BAA-3DE2-11D9-B06A-000D93AD379E@mac.com> On 23-nov-04, at 22:34, Dethe Elza wrote: > Can PyObjC be used to extend existing Objective-C classes, either via > Categories or class_addMethods() (or in any other way)? What are the > requirements to do so? For instance, I believe Categories require the > headers to be available. See the documentation for objc.classAddMethods: classAddMethods(targetClass, methodsArray) Adds methods in methodsArray to class. The effect is similar to how categories work. If class already implements a method as defined in methodsArray, the original implementation will be replaced by the implementation from methodsArray. In the unreleased SVN version you can also use objc.Category: class NSObject (objc.Category(NSObject)): def myMethod(self): pass objc.Category is syntactic suguar for objc.classAddMethods. Ronald > > --Dethe > > "And you think you're so clever and classless and free" > ? John Lennon on prototype-based > programming_______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From ch.pingel at web.de Tue Nov 23 12:24:18 2004 From: ch.pingel at web.de (Christoph Pingel) Date: Wed Nov 24 16:16:12 2004 Subject: [Pythonmac-SIG] please help: python crashes when I try to import orange lib (OS X) Message-ID: Hello, can anybody tell me what's going on here (or give me a pointer where to start looking): Nov 22 18:05:03 localhost crashdump: Unable to determine CPSProcessSerNum pid: 1230 name: python This is form python.crash.log ------ Command: python Path: /usr/bin/python Version: ??? (???) PID: 1230 Thread: 0 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000004 Thread 0 Crashed: 0 org.python.python 0x10094c4c PyErr_NewException + 0x18c (errors.c:544) 1 orange.so 0x020223b8 makeExceptionClass(char*, char*, _object*) + 0x94 2 orange.so 0x021c8c74 initorange + 0x30 3 org.python.Python.framework 0x95fc1bc4 _PyImport_LoadDynamicModule + 0xcc 4 org.python.Python.framework 0x95fbf7a4 PyImport_ExecCodeModuleEx + 0x17b8 5 org.python.Python.framework 0x95fc08c4 PyImport_ImportModuleEx + 0x930 6 org.python.Python.framework 0x95fc02e0 PyImport_ImportModuleEx + 0x34c 7 org.python.Python.framework 0x95fbfe00 PyImport_ImportModule + 0xc8 8 org.python.Python.framework 0x95fbffd4 PyImport_ImportModuleEx + 0x40 9 org.python.Python.framework 0x95f9cbf0 _PyUnicodeUCS2_IsAlpha + 0x90 10 org.python.Python.framework 0x95f4a8d0 PyObject_Call + 0x30 11 org.python.Python.framework 0x95fa91ec PyEval_CallObjectWithKeywords + 0x100 12 org.python.Python.framework 0x95fa6984 PyEval_EvalCode + 0x2280 13 org.python.Python.framework 0x95fa7e30 PyEval_EvalCodeEx + 0x850 14 org.python.Python.framework 0x95fa4734 PyEval_EvalCode + 0x30 15 org.python.Python.framework 0x95fc85f0 PyRun_FileExFlags + 0xe4 16 org.python.Python.framework 0x95fc7354 PyRun_InteractiveOneFlags + 0x1f0 17 org.python.Python.framework 0x95fc713c PyRun_InteractiveLoopFlags + 0x10c 18 org.python.Python.framework 0x95fc6fd4 PyRun_AnyFileExFlags + 0x54 19 org.python.Python.framework 0x95fd1ec0 Py_Main + 0x7cc 20 python 0x00003c78 start + 0x1bc 21 python 0x00003aec start + 0x30 ------ I'm afraid that something's wrong with my system, but I had a hard time googling for getCPSProcessSerNum: it returned 0 results. Same at Apple's site... What does CPS mean? Thanks for any input, best, Christoph From chalsey2 at earthlink.net Wed Nov 24 06:40:34 2004 From: chalsey2 at earthlink.net (Cricket Halsey) Date: Wed Nov 24 16:16:13 2004 Subject: [Pythonmac-SIG] Embedded Python compiling help Message-ID: Dear Michael: Do you know there's another Michael Gaiman, a dear friend, who manages rock bands? As a Mac person, but a bit of a Luddite, I don't know what an embedded python might be. I have a vivid imagination, so I'm worried about your needing help. Are you a college student? Your namesake is 50 years old, a mensch, lives in L.A., and is a terrific dad to an amazingly bright & sweet toddler nammed Emmett. Whoever you are, may you have a happy Thanksgiving... Cricket From bob at redivi.com Wed Nov 24 16:48:17 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed Nov 24 16:49:05 2004 Subject: [Pythonmac-SIG] please help: python crashes when I try to import orange lib (OS X) In-Reply-To: References: Message-ID: <424BD4BA-3E30-11D9-BE89-000A9567635C@redivi.com> On Nov 23, 2004, at 1:24 PM, Christoph Pingel wrote: > can anybody tell me what's going on here (or give me a pointer where > to start looking): > > Nov 22 18:05:03 localhost crashdump: Unable to determine > CPSProcessSerNum pid: 1230 name: python ... > Thread 0 Crashed: > 0 org.python.python 0x10094c4c PyErr_NewException + 0x18c > (errors.c:544) > 1 orange.so 0x020223b8 makeExceptionClass(char*, > char*, _object*) + 0x94 > 2 orange.so 0x021c8c74 initorange + 0x30 ... CPS, as far as I know, is an Apple SPI used to talk to the WindowServer. The traceback looks like this "orange" extension module you're using is crashing on initialization, and the default signal handler that deals with crashes via crashdump is trying to find out what WindowServer connection that process is using, and it doesn't find one. This is just a warning message and has no real relevance to your application's crash. If your application is supposed to use the GUI, you might want to try starting the application with the pythonw script, rather than the python interpreter directly, because pythonw sets up the environment such that a WindowServer connection will work correctly. Otherwise, it sounds like "orange" has bugs, and you'll need to whoever wrote it. -bob From delza at livingcode.org Wed Nov 24 17:26:34 2004 From: delza at livingcode.org (Dethe Elza) Date: Wed Nov 24 17:26:32 2004 Subject: [Pythonmac-SIG] Categories and runtime functions In-Reply-To: <87160BAA-3DE2-11D9-B06A-000D93AD379E@mac.com> References: <784CD99E-3D97-11D9-ACCB-0003939B59E8@livingcode.org> <87160BAA-3DE2-11D9-B06A-000D93AD379E@mac.com> Message-ID: <9B692E22-3E35-11D9-BBCE-0003939B59E8@livingcode.org> Ronald, Thanks for the pointers and info. I'll try working with that. I'm trying to write up some tutorials for PyObjC, and this is for one of them. --Dethe "There's a little bit of God in every truck driver and a little bit of truck driver in every God." -- Blayne Horner -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2488 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041124/b786360c/smime.bin From sw at wordtech-software.com Thu Nov 25 03:23:32 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Thu Nov 25 03:23:35 2004 Subject: [Pythonmac-SIG] Better Aqua support for Tkinter apps via Tile extension Message-ID: <41A54224.5090806@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi--just wanted to call everyone's attention to this link if you're using Tkinter: http://tkinter.unpythonic.net/wiki/UsingTile This describes how to call the Tk Tile extension from Python. The relevance of Tile is that it offers improved theming support for Tk widgets, and it makes a dramatic difference with Aqua. With Tile, Tk picks up the Aqua "pinstripe" background, adds a native progressbar and notebook widget, and a few other things. I use Tile in a Tcl application I'm developing, and it's a godsend. (See http://wiki.tcl.tk/11075, http://wiki.tcl.tk/12565, and http://wiki.tcl.tk/12786 for more information and screenshots on how Tile Aqua looks.) If you have the latest TkAqua Batteries Included distribution, v. 8.4.7(see http://tcltkaqua.sourceforge.net), then you have Tile on your machine. Briefly speaking, here's the code to use with Tkinter (adapted from the Tkinter wiki site): root = Tk() root.tk.call('package', 'require', 'tile') root.tk.call('namespace', 'import', '-force', 'ttk::*') root.tk.call('tile::setTheme', 'aqua') v = IntVar() Radiobutton(root, text="Hello", variable=v, value=1).pack() Radiobutton(root, text="There", variable=v, value=2).pack() root.mainloop() This does indeed work: it creates a little Aqua window with the "pinstripe" background that is lacking in standard TkAqua windows. I don't want to overstate the value of Tile. It simply brings TkAqua to where it should be in terms of native look and feel, so that it's no longer lagging behind. (Tile will be included in the core Tk distribution coming next year.) And it's not complete, at least for Aqua: it doesn't get scrollbars right, so when I'm working in Tcl/Tk, I use a mix of Tile and standard Tk widgets (esp. scrollbars) to get the best combination. If you're using PyObjC, wxPython, or even PyQt, you get better, more sophisticated Aqua support out of the box. But if you're working with Tkinter, then take a closer look at Tile. You'll see a pretty big difference in how your applications look. Kevin - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBpUIkJmdQs+6YVcoRAu4+AJ96xYE3uVzzfcS4+XgBahzJUK2rmwCggr3b SfYXOZsJ1Y7O28Mve/hgX84= =tI3V -----END PGP SIGNATURE----- From Zsolt.Putnoky at alcatel.fr Fri Nov 26 08:39:21 2004 From: Zsolt.Putnoky at alcatel.fr (Zsolt.Putnoky@alcatel.fr) Date: Fri Nov 26 08:39:25 2004 Subject: [Pythonmac-SIG] Problem during installing MySQL module in Python Message-ID: Dear All, I had tried to install MySQLdba-1.0.0 to be able to talk to MySQL 4 databases. I cd-ed into the MySQLdba-1.0.0 folder then issued the following command /usr/local/bin/python setup.py install # /usr/local/bin/python is to select the custom installation (Python 2.3.4) and not the Apple provided one. At the end of the installation, had received the following message _mysql.c: In function `_mysql_ConnectionObject_shutdown': _mysql.c:1545: error: too few arguments to function `mysql_shutdown' error: command 'gcc' failed with exit status 1 Does anyone has any ideas what can be the problem? Any help appreciated. Have a good weekend, Zsolt Putnoky -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20041126/1a515182/attachment.htm From takaanna at hotmail.com Fri Nov 26 12:04:37 2004 From: takaanna at hotmail.com (Paul Taka) Date: Fri Nov 26 12:06:10 2004 Subject: [Pythonmac-SIG] Mac OS 10.3.5 and tkinter. Message-ID: Hi list, I'm new in Macintosh environment, and I'd like to begin development with python and Tk. OS 10.3.5 comes with part of MacPython, so I looked on Internet and found the FAQ which says to install tcl/tk (I installed version BI 8.4.7), then install Panther addons. Once done, when I launch Package Manager to install _tkinter, I get this message: cannot open http://www.python.org/packman/version-0.3/darwin-7.5.1-Power_Macintosh.plist: HTTP error 404: Not found. And the PackageManager window stays white... I looked on Internet again, and found archive of this list, which said it was because version number of darwin change everytime, but it was fixed now.. So I really don't understand what I've done wrong... Is there any bundle of Python with tk included anymore? Or a way to install tk without Package Manager? Thank you.. Paul From pecora at anvil.nrl.navy.mil Fri Nov 26 14:02:47 2004 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Fri Nov 26 14:02:20 2004 Subject: [Pythonmac-SIG] In panther where are Python Carbon files Qd, Quickdraw, etc? In-Reply-To: References: <41A22338.7030109@anvil.nrl.navy.mil> <41A34C72.1090906@anvil.nrl.navy.mil> <41A38A26.8010506@anvil.nrl.navy.mil> Message-ID: <41A72977.1050407@anvil.nrl.navy.mil> Bob Ippolito wrote: > > On Nov 23, 2004, at 9:06 PM, Louis Pecora wrote: > >> Bob Ippolito wrote: >> >>> >>> Standard place: >>> >>> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ >>> python2.3/ plat-mac/Carbon/Qd.py >>> >>> Not sure whether it was your Xcode or OS X upgrade, but at least >>> one of the two did the wrong thing. >>> >>> -bob >> >> >> >> Yikes! They're there! On my machine. >> Why didn't Find find them? Strange. I guess I need to add a path >> to them. I would have thought that the usual MacPython IDE would >> have that built in. >> >> Thanks. Let's see if I can get the IDE to find the files. > > > Maybe you have more than one Python installed? A tell would be if > there is a /usr/local/bin/python, or maybe a Fink Python. Missing > the Carbon modules leads me to believe that it might be some > non-framework Python lying around? > > -bob No Python, but some python 'things'. Here's what's in that directory: ls -F cisco_cert_mgr* img2png* pyalacarte.py pyshell* xrced* cvpnd* img2py* pyalamode* pyshell.py xrced.py genaxmodule* img2xpm* pyalamode.py pywrap* helpviewer* ipseclog* pycrust* pywxrc* helpviewer.py pyalacarte* pycrust.py vpnclient* -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora@anvil.nrl.navy.mil From takaanna at hotmail.com Fri Nov 26 14:09:19 2004 From: takaanna at hotmail.com (Paul Taka) Date: Fri Nov 26 14:10:50 2004 Subject: [Pythonmac-SIG] Mac OS 10.3.5 and tkinter. In-Reply-To: <1415D742-3FAA-11D9-B70F-000D933C27EA@conncoll.edu> Message-ID: Yes, in fact, I've just noticed it before check my mail... But I used darwin-7.5.0 instead... (It doesn't matter?) When I tried to launch the python scripts I wrote under linux, I got an encoding problem. So as it is written on python.org, I added # -*- enconding: utf-8 -*- And replaced #!/usr/bin/python with #!/usr/bin/pythonw But I still have problems :( My HelloWorld is like this: ==================================== from Tkinter import * fen1=Tk() tex1= Label(fen1, text="Hello World!", fg='red') tex1.pack() tex2= Label(fen1, text="Bonjour ? tous !", fg="blue") tex2.pack() bou1= Button(fen1, text="Quit", command=fen1.destroy) bou1.pack() fen1.mainloop() ========================================= And I get: syntax error near unexpected token `(' `fen1=Tk()' Are there compatibility problem with python programs using TK? Thanks a lot again. Paul >In PackageManager select File | Open URL in PackMan and try: > >http://www.python.org/packman/version-0.3/darwin-7.0.0- >Power_Macintosh.plist > >Ignore the warning message! > >If you go to www.python.org/packman you'll find more info. From takaanna at hotmail.com Fri Nov 26 15:00:02 2004 From: takaanna at hotmail.com (Paul Taka) Date: Fri Nov 26 15:01:06 2004 Subject: [Pythonmac-SIG] Mac OS 10.3.5 and tkinter. In-Reply-To: Message-ID: Oh, I forgot... If I keep #!/usr/bin/python instead of pythonw, it seems to work (almost) I get "SetFrontProcess failed,-606" error each time I click on my TK window. I thought pythonw would fix the problem, but the script doesn't launch and just say from: can't read /var/mail/Tkinter ./hello.py: line 21: syntax error near unexpected token `(' ./hello.py: line 21: `fen1=Tk()' where line 21 is: fen1=Tk() I don't understand.. Paul >From: "Paul Taka" >To: charles.hartman@conncoll.edu, pythonmac-sig@python.org >Subject: Re: [Pythonmac-SIG] Mac OS 10.3.5 and tkinter. >Date: Fri, 26 Nov 2004 13:09:19 +0000 > > >Yes, in fact, I've just noticed it before check my mail... >But I used darwin-7.5.0 instead... (It doesn't matter?) > >When I tried to launch the python scripts I wrote under linux, I got an >encoding problem. So as it is written on python.org, I added ># -*- enconding: utf-8 -*- > >And replaced #!/usr/bin/python with #!/usr/bin/pythonw > >But I still have problems :( > >My HelloWorld is like this: > >==================================== >from Tkinter import * > >fen1=Tk() > >tex1= Label(fen1, text="Hello World!", fg='red') >tex1.pack() > >tex2= Label(fen1, text="Bonjour ? tous !", fg="blue") >tex2.pack() > >bou1= Button(fen1, text="Quit", command=fen1.destroy) >bou1.pack() > >fen1.mainloop() >========================================= > >And I get: >syntax error near unexpected token `(' >`fen1=Tk()' > > >Are there compatibility problem with python programs using TK? > >Thanks a lot again. > >Paul From stefan.kirchberg at web.de Fri Nov 26 17:15:46 2004 From: stefan.kirchberg at web.de (Stefan Kirchberg) Date: Fri Nov 26 17:15:50 2004 Subject: [Pythonmac-SIG] PackageManager / Twisted & fpconst Problems -- was: Problems installing MacPython add-ons for 10.3 In-Reply-To: References: Message-ID: <6E12F58E-3FC6-11D9-BF3C-000A95DF1A38@web.de> Installing the add-ons was no problem on my system, which is a freshly re-installed 10.3.6 (after a HD failure) with the latest online updates. But the Package Manager fails to load to the packet list (version-0.3/darwin-7.6.0-.... ist not found, giving a HTTP 404 error). So I tried to use 7.5.0 instead, which seems to work (but only as an admin, ok). Btw, the scrollbar in the package list widget is broken, it snaps back to the list head. Next, I tried to install Twisted by using the URL http://undefined.org/python/pimp/darwin-7.2.0-Power_Macintosh.plist. Here I had a problem with the dependency package 'fpconst-0.6.0-source', which gave a MD5 checksum error and refused to install. What to do now?? Thank you, regards Stefan From cookedm at physics.mcmaster.ca Fri Nov 26 21:56:09 2004 From: cookedm at physics.mcmaster.ca (David M.Cooke) Date: Fri Nov 26 21:57:34 2004 Subject: [Pythonmac-SIG] Mac OS 10.3.5 and tkinter. In-Reply-To: References: Message-ID: <99143D76-3FED-11D9-B99E-000A95BE5E0A@physics.mcmaster.ca> On Nov 26, 2004, at 08:09, Paul Taka wrote: > Yes, in fact, I've just noticed it before check my mail... > But I used darwin-7.5.0 instead... (It doesn't matter?) > > When I tried to launch the python scripts I wrote under linux, I got > an encoding problem. So as it is written on python.org, I added > # -*- enconding: utf-8 -*- encoding, I presume > And replaced #!/usr/bin/python with #!/usr/bin/pythonw > > But I still have problems :( > > My HelloWorld is like this: Exactly like the below? It doesn't have a #! or encoding line like you were saying. > ==================================== > from Tkinter import * > > fen1=Tk() > > tex1= Label(fen1, text="Hello World!", fg='red') > tex1.pack() > > tex2= Label(fen1, text="Bonjour ? tous !", fg="blue") > tex2.pack() > > bou1= Button(fen1, text="Quit", command=fen1.destroy) > bou1.pack() > > fen1.mainloop() > ========================================= > > And I get: > syntax error near unexpected token `(' > `fen1=Tk()' > How, _exactly_, are you executing this program? That's a bash error (the shell): $ fe=Tk() -bash: syntax error near unexpected token `(' This suggests to me that the #!/usr/bin/pythonw line is not the _first_ line in your script. If you save the above program as helloworld.py (with the #! and encoding line), and execute it at the prompt: $ pythonw helloworld.py If that works, you can make your script executable and run it directly: $ chmod +x helloworld.py $ ./helloworld.py -- |>|\/|< /------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca From rkern at ucsd.edu Fri Nov 26 23:16:14 2004 From: rkern at ucsd.edu (Robert Kern) Date: Fri Nov 26 23:16:19 2004 Subject: [Pythonmac-SIG] Mac OS 10.3.5 and tkinter. In-Reply-To: References: Message-ID: <41A7AB2E.9060605@ucsd.edu> Paul Taka wrote: > > Oh, I forgot... > If I keep #!/usr/bin/python instead of pythonw, it seems to work (almost) > I get "SetFrontProcess failed,-606" error each time I click on my TK > window. > > I thought pythonw would fix the problem, but the script doesn't launch > and just say > > from: can't read /var/mail/Tkinter > ./hello.py: line 21: syntax error near unexpected token `(' > ./hello.py: line 21: `fen1=Tk()' /usr/bin/pythonw is a shell script, so it can't be directly called by the #! (it will try to interpret hello.py as a shell script, too, not a Python script; thus the syntax errors). Use #!/usr/bin/env /usr/bin/pythonw -- Robert Kern rkern@ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From sw at wordtech-software.com Sat Nov 27 04:23:02 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Sat Nov 27 04:23:04 2004 Subject: [Pythonmac-SIG] Appscript/administrator privileges Message-ID: <41A7F316.4070208@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Does appscript support anything analogous to AppleScript's ability to execute a command with administrator privileges (hooks into Authorization Services)? Couldn't find anything in the documentation about that. Of course, with Bob's authorization services wrapper, perhaps this isn't even necessary. - -- Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.smallbizmac.com http://www.kevin-walzer.com mailto:sw@wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBp/MVJmdQs+6YVcoRAshMAJsERFz6E8kUqomE9SeDhVCPHDeOBQCdGsGl gtrighGdpI43JvkT+bmX06c= =LCfI -----END PGP SIGNATURE----- From hengist.podd at virgin.net Sat Nov 27 11:33:27 2004 From: hengist.podd at virgin.net (has) Date: Sat Nov 27 11:33:39 2004 Subject: [Pythonmac-SIG] Appscript/administrator privileges Message-ID: Kevin Walzer wrote: >Does appscript support anything analogous to AppleScript's ability to >execute a command with administrator privileges (hooks into >Authorization Services)? Couldn't find anything in the documentation >about that. Of course, with Bob's authorization services wrapper, >perhaps this isn't even necessary. Can you give an example? Thanks, has -- http://freespace.virgin.net/hamish.sanderson/ From bob at redivi.com Sat Nov 27 11:38:53 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Nov 27 11:39:02 2004 Subject: [Pythonmac-SIG] Appscript/administrator privileges In-Reply-To: References: Message-ID: <88C5CBFF-4060-11D9-87C6-000A9567635C@redivi.com> On Nov 27, 2004, at 5:33 AM, has wrote: > Kevin Walzer wrote: > >> Does appscript support anything analogous to AppleScript's ability to >> execute a command with administrator privileges (hooks into >> Authorization Services)? Couldn't find anything in the documentation >> about that. Of course, with Bob's authorization services wrapper, >> perhaps this isn't even necessary. > > Can you give an example? (from one of Kevin's posts on the darwinports list) -- set theLauncher to "sudo -b /Applications/DarwinPorts/TkDarwinPorts.app/Contents/MacOS/Wish\\ Shell" do shell script theLauncher with administrator privileges -- -bob From hengist.podd at virgin.net Sat Nov 27 12:17:27 2004 From: hengist.podd at virgin.net (has) Date: Sat Nov 27 12:17:29 2004 Subject: [Pythonmac-SIG] Appscript/administrator privileges In-Reply-To: <88C5CBFF-4060-11D9-87C6-000A9567635C@redivi.com> References: <88C5CBFF-4060-11D9-87C6-000A9567635C@redivi.com> Message-ID: Bob Ippolito wrote: >>>Does appscript support anything analogous to AppleScript's ability to >>>execute a command with administrator privileges (hooks into >>>Authorization Services)? >> >>Can you give an example? > >(from one of Kevin's posts on the darwinports list) > >-- >set theLauncher to "sudo -b >/Applications/DarwinPorts/TkDarwinPorts.app/Contents/MacOS/Wish\\ >Shell" > >do shell script theLauncher with administrator privileges Ah, right. The Python equivalent to 'do shell script' is os.system() so it's not an appscript issue. One for Python's Unix experts, I think. [1] has [1] Though if you had to, you could call the 'do shell script' osax from MacPython using the osax module . -- http://freespace.virgin.net/hamish.sanderson/ From bob at redivi.com Sat Nov 27 12:47:07 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Nov 27 12:47:19 2004 Subject: [Pythonmac-SIG] Appscript/administrator privileges In-Reply-To: References: <88C5CBFF-4060-11D9-87C6-000A9567635C@redivi.com> Message-ID: <10E4AE18-406A-11D9-87C6-000A9567635C@redivi.com> On Nov 27, 2004, at 6:17 AM, has wrote: > Bob Ippolito wrote: > >>>> Does appscript support anything analogous to AppleScript's ability >>>> to >>>> execute a command with administrator privileges (hooks into >>>> Authorization Services)? >>> >>> Can you give an example? >> >> (from one of Kevin's posts on the darwinports list) >> >> -- >> set theLauncher to "sudo -b >> /Applications/DarwinPorts/TkDarwinPorts.app/Contents/MacOS/Wish\\ >> Shell" >> >> do shell script theLauncher with administrator privileges > > Ah, right. The Python equivalent to 'do shell script' is os.system() > so it's not an appscript issue. One for Python's Unix experts, I > think. [1] > [1] Though if you had to, you could call the 'do shell script' osax > from MacPython using the osax module > . , The typical unix way would be via Authorization Services, which can be done with the Authorization extension that I wrote, as he mentioned. His question was specifically if he could use the same facility that AppleScript uses for this via appscript, which you answered in the footnote. FWIW, "do shell script" is a lot more like os.popen[1]. [1] Not that you should ever use popen, because the subprocess module is a much better way of handling said situations. It's sad that "do shell script" won't take a list of arguments. -bob From hengist.podd at virgin.net Sat Nov 27 16:49:02 2004 From: hengist.podd at virgin.net (has) Date: Sat Nov 27 16:49:04 2004 Subject: [Pythonmac-SIG] Appscript/administrator privileges In-Reply-To: <10E4AE18-406A-11D9-87C6-000A9567635C@redivi.com> References: <88C5CBFF-4060-11D9-87C6-000A9567635C@redivi.com> <10E4AE18-406A-11D9-87C6-000A9567635C@redivi.com> Message-ID: Bob Ippolito wrote: >>>do shell script theLauncher with administrator privileges >> >>Ah, right. The Python equivalent to 'do shell script' is >>os.system() so it's not an appscript issue. One for Python's Unix >>experts, I think. [1] >>[1] Though if you had to, you could call the 'do shell script' osax >>from MacPython using the osax module >>. >, >The typical unix way would be via Authorization Services, which can >be done with the Authorization extension that I wrote, as he >mentioned. His question was specifically if he could use the same >facility that AppleScript uses for this via appscript, which you >answered in the footnote. Right you are. BTW & FWIW, a minor clarification: appscript sole purpose is to construct and send Apple events to applications using high-level scripting terminology. It has no support for calling osaxen - nor is any planned. To call osaxen from MacPython, use the osax package (note that this requires the aem package), which supplies wrapper functions for some of the more useful handlers along with a lower level osax() call that uses raw AE codes. Though personally I don't recommend using the osax package when there's a Python alternative as osaxen are pretty stinky. Cheers, has -- http://freespace.virgin.net/hamish.sanderson/ From majcher at mac.com Sat Nov 27 22:05:17 2004 From: majcher at mac.com (Edward Majcher) Date: Sat Nov 27 22:05:22 2004 Subject: [Pythonmac-SIG] Keystroke/mouse events Message-ID: <0A4A8EA3-40B8-11D9-A23B-000A95AFD464@mac.com> Hi, I need to intercept keystrokes and mouse events at the system level, basically like a keystroke logger, not being familiar enough with the apple frameworks, can anyone point me in the right direction as far as a python package? I thought maybe "Events" in the Carbon package but from reading the apple api documentation this leads me to believe this will only work for events in the current application, vs system wide. Thanks, Ed Majcher From kranki at mac.com Sun Nov 28 05:02:27 2004 From: kranki at mac.com (Robert White) Date: Sun Nov 28 05:02:33 2004 Subject: [Pythonmac-SIG] Embedding Python in applications under MacOSX and Darwin. Message-ID: <518A41EE-40F2-11D9-96FE-000A95A94FC8@mac.com> I am wondering if someone can answer this question for me. Is Python installed as a framework under Darwin? If so, is there an easy way to know within a "configure" script (autoconf, libtool, et al) whether you are in MacOSX or Darwin? I do not run Darwin, just MacOSX. The reason that I ask this is that there are several programs that embed python within the Darwinports system and I would like to develop a common routine that would allow a "configure" script to properly compile and link against the Python Framework in MacOSX yet work in Darwin as well. I have not looked at a lot of ports, but the ones that I have looked at don't get it right and I am too new to the libtool system to provide a proper response. So any information or pointers are greatly appreciated. Thanks, Bob. From cookedm at physics.mcmaster.ca Sun Nov 28 09:45:13 2004 From: cookedm at physics.mcmaster.ca (David M.Cooke) Date: Sun Nov 28 09:45:14 2004 Subject: [Pythonmac-SIG] Embedding Python in applications under MacOSX and Darwin. In-Reply-To: <518A41EE-40F2-11D9-96FE-000A95A94FC8@mac.com> References: <518A41EE-40F2-11D9-96FE-000A95A94FC8@mac.com> Message-ID: On Nov 27, 2004, at 23:02, Robert White wrote: > I am wondering if someone can answer this question for me. Is Python > installed as a framework under Darwin? If so, is there an easy way to > know within a "configure" script (autoconf, libtool, et al) whether > you are in MacOSX or Darwin? I do not run Darwin, just MacOSX. The > reason that I ask this is that there are several programs that embed > python within the Darwinports system and I would like to develop a > common routine that would allow a "configure" script to properly > compile and link against the Python Framework in MacOSX yet work in > Darwin as well. I have not looked at a lot of ports, but the ones > that I have looked at don't get it right and I am too new to the > libtool system to provide a proper response. So any information or > pointers are greatly appreciated. In DarwinPorts, python is installed as a shared library (non-framework), just like it would be under other unices. I think a good way to check for Mac OS-specific is something like try: import MacOS except ImportError: python_type = 'not macos' else: if MacOS.linkmodel == 'framework': python_type = 'framework' else: python_type = 'not framework' (run in the python you're testing, of course) According to the docs, MacOS.linkmodel is 'framework', 'static', or 'shared'; a DarwinPorts python should be 'shared'. -- |>|\/|< /------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca From lists at netelligent.biz Sun Nov 28 16:53:29 2004 From: lists at netelligent.biz (tmk) Date: Sun Nov 28 16:53:53 2004 Subject: [Pythonmac-SIG] Python 2.3.4 Installation In-Reply-To: <760736E0-103C-11D9-939F-000A95686CD8@redivi.com> References: <760736E0-103C-11D9-939F-000A95686CD8@redivi.com> Message-ID: Hi Bob, First I must confess that I don't really understand the details of the problem of building extensions with multiple versions of Python installed on Panther... Out of curiosity I just checked and the lib/python2.3/config/Makefile file from my compiled from source python 2.3.4 don't appear to be patched with the patch below. Am I correct in assuming that this is ok and that the patch below is only meant for the Apple-installed python 2.3? Also in a separate but related e-mail you also suggested that one would "also need to set the "MACOSX_DEPLOYMENT_TARGET" environment variable to "10.3" when using this patch." Could you please elaborate on how/where one should set that environment variable (I set it in ~/.MacOSX/environment.plist). TIA for any advice. = tmk = On Sep 27, 2004, at 06:19, Bob Ippolito wrote: > On Sep 27, 2004, at 12:01 AM, Samuel M.Smith wrote: > >> There isn't much on the new 2.3.4 Mac Python. Does 2.3.4 fix the >> problem where you couldn't have >> any framework version but the one that came with OSX (in this case >> 2.3 for Panther) ?. > > Yes the problem is fixed, but it's still present in the version of > 2.3.0 that ships with 10.3.. so once you install any other framework > build of 2.3 in the usual places, it will prevent any extension from > linking correctly for 2.3.0. > > It's possible to monkeypatch Python 2.3.0 so it's not broken in this > regard, though. Here's a diff: > > --- > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/config/Makefile Sun Mar 7 22:33:33 2004 > +++ /Users/bob/Makefile Sun Mar 7 22:32:16 2004 > @@ -95,8 +95,8 @@ > > # Symbols used for using shared libraries > SO= .so > -LDSHARED= $(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK) > -BLDSHARED= $(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK) > +LDSHARED= $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup > +BLDSHARED= $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup > DESTSHARED= $(BINLIBDEST)/lib-dynload > > # Executable suffix (.exe on Windows and Mac OS X) > >> Does the install >> from source replace 2.3? > > No, it goes in /Library/Frameworks/Python.framework with some symlinks > in /usr/local/bin > >> There were a lot of posts about problems building extensions and >> stuff with >> a different version etc. Have those issues been resolved? > > Same answer as the first question. > >> More of a what is the current state of Python 2.3.4 framework on os x >> 10.3.5? > > Uh, it works fine? > > -bob > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From bob at redivi.com Sun Nov 28 17:45:17 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Nov 28 17:45:29 2004 Subject: [Pythonmac-SIG] Python 2.3.4 Installation In-Reply-To: References: <760736E0-103C-11D9-939F-000A95686CD8@redivi.com> Message-ID: On Nov 28, 2004, at 10:53 AM, tmk wrote: > First I must confess that I don't really understand the details of the > problem of building extensions with multiple versions of Python > installed on Panther... Very few people do :) > Out of curiosity I just checked and the lib/python2.3/config/Makefile > file from my compiled from source python 2.3.4 don't appear to be > patched with the patch below. The correct linker settings are not adopted by any mainline version of Python 2.3. I had thought they were in 2.3.4, but they're not. Only Python 2.4 builds correctly by default. Also, Apple's build of Python 2.3.3 in the WWDC 2004 preview adopts a similar method to this patch, but slightly modified so that it does not depend on MACOSX_DEPLOYMENT_TARGET being set: (this is what a good /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ config/Makefile should look like, starting on or around line 98) LDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup BLDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup > Am I correct in assuming that this is ok and that the patch below is > only meant for the Apple-installed python 2.3? Unfortunately not, it recently came to my attention that it is VERY IMPORTANT TO PATCH THIS MAKEFILE. Here is some more information (listing what will happen with various permutations of common Python installations). I hope to never have to repeat this again by email :) Versions of Mac OS X prior to 10.3: This patch isn't at all compatible because dyld did not support this feature until Darwin 7. That sucks, but there's little that can be done about that! = Scenario 1 = [a] Python 2.3.0 in /System/Library, unpatched [b] Python 2.3.x in /Library, unpatched Building extensions with [a] no longer works, because -framework Python locates [b]. Therefore, it actually ends up building extensions only compatible with [b]. Building extensions with [b] correctly creates extensions, but are only compatible with [b]. Loading correctly built extensions built for [a] from [b] or vice versa will crash the interpreter. = Scenario 2 = [a] Python 2.3.0 in /System/Library, patched [b] Python 2.3.x in /Library, unpatched Building extensions with [a] will build extensions compatible with [b] (or any other Python 2.3.x, even non-framework builds). Building extensions with [b] correctly creates extensions, but are only compatible with [b]. Loading correctly built extensions built for [b] from [a] will crash the interpreter. = Scenario 3 = [a] Python 2.3.0 in /System/Library, unpatched [b] Python 2.3.x in /Library, patched Building extensions with [a] no longer works, because -framework Python locates [b]. Therefore, it actually ends up building extensions only compatible with [b]. Building extensions with [b] will build extensions compatible with [a] (or any other Python 2.3.x, even non-framework builds). Loading correctly built extensions built for [a] from [b] will crash the interpreter. = Scenario 4 = [a] Python 2.3.0 in /System/Library, patched [b] Python 2.3.x in /Library, patched Building extensions with [a] will build extensions compatible with [b] (or any other Python 2.3.x, even non-framework builds) and vice versa. = Scenario 5 = [a] Python 2.3.0 in /System/Library, unpatched [b] Python 2.3.x in /Library, unpatched [c] Python 2.4.x in /Library Building extensions with [a] no longer works, because -framework Python locates [c]. These extensions are not compatible with ANY Python (built with 2.3 headers, linked with 2.4). Building extensions with [b] no longer works, because -framework Python locates [c]. These extensions are not compatible with ANY Python (built with 2.3 headers, linked with 2.4). Loading correctly built extensions built for [a] from [b] or vice versa will crash the interpreter. = Scenario 6 = [a] Python 2.3.0 in /System/Library, patched [b] Python 2.3.x in /Library, unpatched [c] Python 2.4.x in /Library Building extensions with [b] no longer works, because -framework Python locates [c]. These extensions are not compatible with ANY Python (built with 2.3 headers, linked with 2.4). Loading correctly built extensions built for [b] from [a] will crash the interpreter. = Scenario 7 = [a] Python 2.3.0 in /System/Library, unpatched [b] Python 2.3.x in /Library, patched [c] Python 2.4.x in /Library Building extensions with [a] no longer works, because -framework Python locates [c]. These extensions are not compatible with ANY Python (built with 2.3 headers, linked with 2.4). Loading correctly built extensions built for [a] from [b] will crash the interpreter. = Scenario 8 = [a] Python 2.3.0 in /System/Library, patched [b] Python 2.3.x in /Library, patched [c] Python 2.4.x in /Library Building extensions with [b] will build extensions compatible with [a] (or any other Python 2.3.x, even non-framework builds) and vice versa. ... So obviously, it's very important to patch your Python! The sooner you patch, the less extensions you will build that are tied to a particular installation location. Note that nearly all precompiled extensions you will find for Python 2.3.0 are generally of the unpatched variety, so they aren't compatible with other installations of Python 2.3.x. Considering [c] can screw up the whole mix, even though it doesn't have it's own problems... it turns out that there is a fundamental flaw in the way gcc's compiler and linker finds headers and dylibs from frameworks! It can't take version numbers into account! The runtime does just fine, but link time does not.. This is pretty bad! It's not solvable without patching gcc either, because from the source files you say but HeaderName.h doesn't live in a directory named FrameworkName, it lives in a directory named Headers, so it's not possible to specify an -I that works correctly if you use this feature. There are a few workarounds to versioned framework issues, and they all suck. [1] Keep versioned frameworks in separate places and use -F appropriately. [2] Use -I with only "inside-framework" header names (i.e. instead of ) and link directly to the framework's dylib as if it were an .o file (i.e. /Library/Frameworks/Python.framework/Versions/2.3/Python instead of -framework Python) [3] Name your frameworks with the version number in them instead of using the versioning capability of frameworks (i.e. Python23.framework) Note that Python 2.4 uses a hybrid of [1] and [2]. When building the Python framework, it uses -F into the build directory, so it always links the interpreter correctly. All sources expect the headers to be available via "Python.h" and it uses an appropriate -I to make this work. When building extensions, it uses -undefined dynamic_lookup, so it doesn't link directly to any Python. > Also in a separate but related e-mail you also suggested that one > would "also need to set the "MACOSX_DEPLOYMENT_TARGET" environment > variable to "10.3" when using this patch." > > Could you please elaborate on how/where one should set that > environment variable (I set it in ~/.MacOSX/environment.plist). Setting it there is fine. You could also, instead, adopt a better patch like Apple has as stated above. -bob From john at compgeomco.com Sun Nov 28 19:02:19 2004 From: john at compgeomco.com (John Fowler) Date: Sun Nov 28 19:00:14 2004 Subject: [Pythonmac-SIG] embedding -- linking problem? Message-ID: <015401c4d574$6ae14f90$6401a8c0@fowlerjohn> Consider me a newbie at both python and MacOS. All discussion below pertains to python-2.3.4 using gcc and g++ compilers on MacOSX10.3. I configured python with ./configure --prefix=$PWD --exec-prefix=$PWD. Then I added a module in Modules/Setup and put the .c file in Modules. I built python and can import my module just fine. Next I wrote an app that calls Py_Initialize(), then PyRun_SimpleString("import mymodule\n"). To see what to add to my link line, I ran the python that I just built with: import distutils.sysconfig distutils.sysconfig.get_config_var('LINKFORSHARED') What I got from this was: '-u __dummy -u _PyMac_Error -framework System -framework CoreServices -framework Foundation' So I put this in my Makefile and linked statically to the libpython2.3.a that I just built. It compiles fine with g++ but runs correctly ONLY if I have PATH set so that the directory for Python-2.3.4 comes first. Otherwise the app can't find mymodule. So the app isn't portable. What am I missing? (This same approach works correctly on linux except what I had to add to link there was '-Xlinker -export-dynamic'.) Thanks, John Fowler -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20041128/f97a3edd/attachment.html From david.warde.farley at utoronto.ca Sun Nov 28 19:18:01 2004 From: david.warde.farley at utoronto.ca (David Warde-Farley) Date: Sun Nov 28 19:18:20 2004 Subject: [Pythonmac-SIG] Problems with MacPython PackMan Message-ID: I fired up Package Manager a short while ago and got some rather puzzling behavior. Namely, packages won't install! They will download (I see this if check "verbose") but then it just hangs there. I'm at a loss as to why this would happen. Any ideas? (I've tried both your repository and the undefined.org repo). I should also mention, I'm using OS X 10.3.6, with the MacPython Addons. I also have a fink installed python (for dependency purposes) but I've removed the python symlink it creates so as to be sure I'm using the right Python. From oic at computer.org Sun Nov 28 20:21:46 2004 From: oic at computer.org (=?ISO-8859-1?Q?Robert_Valsj=F6?=) Date: Sun Nov 28 22:13:44 2004 Subject: [Pythonmac-SIG] python 2.3.4 on Mac OS X 10.3.6 is working - upgraded standard installation Message-ID: Hi! I'm new on this list, but have read the archive of it. I have upgraded my standard python installation which comes with Mac OS X 10.3.6 to python 2.3.4 from source. I've followed the instructions in the README file in the catalog Mac/OSX in the source distribution. Everything I've done seems to work, but have I missed something? Please let me know. Here is my history list of the commands I've done. 1780 tar Python-2.3.4.tgz 1781 tar zxvf Python-2.3.4.tgz 1782 cd Python-2.3.4 1790 ./configure --enable-framework 1803 make 1804 make frameworkinstall 1805 make frameworkinstallextras 1815 cd /usr/bin/ 1818 sudo mv python python.orig 1820 sudo mv python2.3 python2.3.orig 1822 sudo mv pythonw pythonw.orig 1823 sudo mv pythonw2.3 pythonw2.3.orig 1827 cd /etc/ 1831 sudo emacs profile #add /usr/local/bin to PATH /rob Robert Valsj? From lists at netelligent.biz Sun Nov 28 23:59:34 2004 From: lists at netelligent.biz (tmk) Date: Sun Nov 28 23:59:43 2004 Subject: [Pythonmac-SIG] Python 2.3.4 Installation In-Reply-To: References: <760736E0-103C-11D9-939F-000A95686CD8@redivi.com> Message-ID: <2BBFD67D-4191-11D9-A1A6-003065C18BA0@netelligent.biz> Thanks a lot for the thorough (and quick!) explanation Bob. This is much appreciated. = tmk = On Nov 28, 2004, at 17:45, Bob Ippolito wrote: > On Nov 28, 2004, at 10:53 AM, tmk wrote: > >> First I must confess that I don't really understand the details of >> the problem of building extensions with multiple versions of Python >> installed on Panther... > > Very few people do :) > >> Out of curiosity I just checked and the lib/python2.3/config/Makefile >> file from my compiled from source python 2.3.4 don't appear to be >> patched with the patch below. > > The correct linker settings are not adopted by any mainline version of > Python 2.3. I had thought they were in 2.3.4, but they're not. Only > Python 2.4 builds correctly by default. Also, Apple's build of Python > 2.3.3 in the WWDC 2004 preview > > adopts a similar method to this patch, but slightly modified so that > it does not depend on MACOSX_DEPLOYMENT_TARGET being set: > > (this is what a good > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/config/Makefile should look like, starting on or around line > 98) > > LDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) -bundle > -undefined dynamic_lookup > BLDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) -bundle > -undefined dynamic_lookup > >> Am I correct in assuming that this is ok and that the patch below is >> only meant for the Apple-installed python 2.3? > > Unfortunately not, it recently came to my attention that it is VERY > IMPORTANT TO PATCH THIS MAKEFILE. Here is some more information > (listing what will happen with various permutations of common Python > installations). I hope to never have to repeat this again by email :) > > Versions of Mac OS X prior to 10.3: This patch isn't at all compatible > because dyld did not support this feature until Darwin 7. That sucks, > but there's little that can be done about that! > > = Scenario 1 = > > [a] Python 2.3.0 in /System/Library, unpatched > [b] Python 2.3.x in /Library, unpatched > > Building extensions with [a] no longer works, because -framework > Python locates [b]. Therefore, it actually ends up building > extensions only compatible with [b]. > Building extensions with [b] correctly creates extensions, but are > only compatible with [b]. > Loading correctly built extensions built for [a] from [b] or vice > versa will crash the interpreter. > > = Scenario 2 = > > [a] Python 2.3.0 in /System/Library, patched > [b] Python 2.3.x in /Library, unpatched > > Building extensions with [a] will build extensions compatible with [b] > (or any other Python 2.3.x, even non-framework builds). > Building extensions with [b] correctly creates extensions, but are > only compatible with [b]. > Loading correctly built extensions built for [b] from [a] will crash > the interpreter. > > = Scenario 3 = > > [a] Python 2.3.0 in /System/Library, unpatched > [b] Python 2.3.x in /Library, patched > > Building extensions with [a] no longer works, because -framework > Python locates [b]. Therefore, it actually ends up building > extensions only compatible with [b]. > Building extensions with [b] will build extensions compatible with [a] > (or any other Python 2.3.x, even non-framework builds). > Loading correctly built extensions built for [a] from [b] will crash > the interpreter. > > = Scenario 4 = > > [a] Python 2.3.0 in /System/Library, patched > [b] Python 2.3.x in /Library, patched > > Building extensions with [a] will build extensions compatible with [b] > (or any other Python 2.3.x, even non-framework builds) and vice versa. > > = Scenario 5 = > > [a] Python 2.3.0 in /System/Library, unpatched > [b] Python 2.3.x in /Library, unpatched > [c] Python 2.4.x in /Library > > Building extensions with [a] no longer works, because -framework > Python locates [c]. These extensions are not compatible with ANY > Python (built with 2.3 headers, linked with 2.4). > Building extensions with [b] no longer works, because -framework > Python locates [c]. These extensions are not compatible with ANY > Python (built with 2.3 headers, linked with 2.4). > Loading correctly built extensions built for [a] from [b] or vice > versa will crash the interpreter. > > = Scenario 6 = > > [a] Python 2.3.0 in /System/Library, patched > [b] Python 2.3.x in /Library, unpatched > [c] Python 2.4.x in /Library > > Building extensions with [b] no longer works, because -framework > Python locates [c]. These extensions are not compatible with ANY > Python (built with 2.3 headers, linked with 2.4). > Loading correctly built extensions built for [b] from [a] will crash > the interpreter. > > = Scenario 7 = > > [a] Python 2.3.0 in /System/Library, unpatched > [b] Python 2.3.x in /Library, patched > [c] Python 2.4.x in /Library > > Building extensions with [a] no longer works, because -framework > Python locates [c]. These extensions are not compatible with ANY > Python (built with 2.3 headers, linked with 2.4). > Loading correctly built extensions built for [a] from [b] will crash > the interpreter. > > = Scenario 8 = > > [a] Python 2.3.0 in /System/Library, patched > [b] Python 2.3.x in /Library, patched > [c] Python 2.4.x in /Library > > Building extensions with [b] will build extensions compatible with [a] > (or any other Python 2.3.x, even non-framework builds) and vice versa. > > ... > > So obviously, it's very important to patch your Python! The sooner > you patch, the less extensions you will build that are tied to a > particular installation location. Note that nearly all precompiled > extensions you will find for Python 2.3.0 are generally of the > unpatched variety, so they aren't compatible with other installations > of Python 2.3.x. > > Considering [c] can screw up the whole mix, even though it doesn't > have it's own problems... it turns out that there is a fundamental > flaw in the way gcc's compiler and linker finds headers and dylibs > from frameworks! It can't take version numbers into account! The > runtime does just fine, but link time does not.. This is pretty bad! > It's not solvable without patching gcc either, because from the source > files you say but HeaderName.h doesn't > live in a directory named FrameworkName, it lives in a directory named > Headers, so it's not possible to specify an -I that works correctly if > you use this feature. > > There are a few workarounds to versioned framework issues, and they > all suck. > > [1] Keep versioned frameworks in separate places and use -F > appropriately. > [2] Use -I with only "inside-framework" header names (i.e. > instead of ) and link directly to the framework's > dylib as if it were an .o file (i.e. > /Library/Frameworks/Python.framework/Versions/2.3/Python instead of > -framework Python) > [3] Name your frameworks with the version number in them instead of > using the versioning capability of frameworks (i.e. > Python23.framework) > > Note that Python 2.4 uses a hybrid of [1] and [2]. When building the > Python framework, it uses -F into the build directory, so it always > links the interpreter correctly. All sources expect the headers to be > available via "Python.h" and it uses an appropriate -I to make this > work. When building extensions, it uses -undefined dynamic_lookup, so > it doesn't link directly to any Python. > >> Also in a separate but related e-mail you also suggested that one >> would "also need to set the "MACOSX_DEPLOYMENT_TARGET" environment >> variable to "10.3" when using this patch." >> >> Could you please elaborate on how/where one should set that >> environment variable (I set it in ~/.MacOSX/environment.plist). > > Setting it there is fine. You could also, instead, adopt a better > patch like Apple has as stated above. > > -bob > From bob at redivi.com Mon Nov 29 00:35:20 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Nov 29 00:35:31 2004 Subject: [Pythonmac-SIG] python 2.3.4 on Mac OS X 10.3.6 is working - upgraded standard installation In-Reply-To: References: Message-ID: <2B2135FF-4196-11D9-8E30-000A9567635C@redivi.com> On Nov 28, 2004, at 2:21 PM, Robert Valsj? wrote: > I have upgraded my standard python installation which comes with Mac > OS X 10.3.6 to python 2.3.4 from source. > > I've followed the instructions in the README file in the catalog > Mac/OSX in the source distribution. > > Everything I've done seems to work, but have I missed something? > Please let me know. Yes. > Here is my history list of the commands I've done. > > 1780 tar Python-2.3.4.tgz > 1781 tar zxvf Python-2.3.4.tgz > 1782 cd Python-2.3.4 > 1790 ./configure --enable-framework > 1803 make > 1804 make frameworkinstall > 1805 make frameworkinstallextras You should patch the Makefile as I mentioned earlier today, or else when/if you install Python 2.4, your Python 2.3 will be broken. > 1815 cd /usr/bin/ > 1818 sudo mv python python.orig > 1820 sudo mv python2.3 python2.3.orig > 1822 sudo mv pythonw pythonw.orig > 1823 sudo mv pythonw2.3 pythonw2.3.orig DO NOT EVER DO THIS! Never touch /usr (except /usr/local)!! Just put /usr/local/bin before /usr/bin on your path and be done with it! > 1827 cd /etc/ > 1831 sudo emacs profile #add /usr/local/bin to PATH DO NOT EVER DO THIS EITHER! Just add it to your ~/.bashrc or ~/.tcshrc -bob From dreedmac at columbus.rr.com Mon Nov 29 01:03:09 2004 From: dreedmac at columbus.rr.com (David Reed) Date: Mon Nov 29 01:03:24 2004 Subject: [Pythonmac-SIG] scripting iCal Message-ID: <0DAF823E-419A-11D9-A75B-000D932F4414@columbus.rr.com> I've ran across this: http://stompstompstomp.com/weblog/technical/2004-02-05 and got the examples in it to work fine. I'm now trying to write a script to just grab the events for the current date. I could pull all the events and check their start date, but figure there is probably an easier way. The applescript documentation includes: Class calendar: This class represents a calendar Plural form: calendars Elements: event by numeric index, before/after another element, as a range of elements, satisfying a test todo by numeric index, before/after another element, as a range of elements, satisfying a test but it's not clear to me how to grave events that "satisfy a test". Can anyone help or point me to documentation on this? Thanks, Dave From bob at redivi.com Mon Nov 29 01:43:15 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Nov 29 01:43:24 2004 Subject: [Pythonmac-SIG] scripting iCal In-Reply-To: <0DAF823E-419A-11D9-A75B-000D932F4414@columbus.rr.com> References: <0DAF823E-419A-11D9-A75B-000D932F4414@columbus.rr.com> Message-ID: On Nov 28, 2004, at 7:03 PM, David Reed wrote: > I've ran across this: > > http://stompstompstomp.com/weblog/technical/2004-02-05 > > and got the examples in it to work fine. > > I'm now trying to write a script to just grab the events for the > current date. I could pull all the events and check their start date, > but figure there is probably an easier way. > > The applescript documentation includes: > Class calendar: This class represents a calendar > Plural form: > calendars > Elements: > event by numeric index, before/after another element, as a range of > elements, satisfying a test > todo by numeric index, before/after another element, as a range of > elements, satisfying a test > > > but it's not clear to me how to grave events that "satisfy a test". > Can anyone help or point me to documentation on this? You can't do that using gensuitemodule, you'll have to use something else like appscript . -bob From hengist.podd at virgin.net Mon Nov 29 01:56:19 2004 From: hengist.podd at virgin.net (has) Date: Mon Nov 29 01:56:26 2004 Subject: [Pythonmac-SIG] scripting iCal Message-ID: David Reed wrote: >I'm now trying to write a script to just grab the events for the >current date. I could pull all the events and check their start date, >but figure there is probably an easier way. Use appscript: http://freespace.virgin.net/hamish.sanderson/appscript.html Example: #!/usr/local/bin/pythonw from appscript import * from datetime import date, timedelta today = date.today() tomorrow = today + timedelta(1) # To get a list of today's events in calendar 1: print app('ical.app').calendars[1].events.filter((its.start_date >= today).AND(its.start_date < tomorrow)).get() # To get names and descriptions of today's events in 'Home' calendar: ref = app('ical.app').calendars.filter(its.title == 'Home').events.filter((its.start_date >= today).AND(its.start_date < tomorrow)) print zip(ref.summary.get(), ref.description.get()) Notes: - iCal's scripting support isn't too great - like most of Apple's iApps. Hence stupid crap like using filters to get calendars by title: the doofuses that defined its Apple event object model used 'title' instead of 'name' for no obvious reason, which prevents you from just using calendars['Home'] as you would in most apps. - For asking advice on scripting specific applications, you might want to subscribe to the macscrpt mailing list: HTH has -- http://freespace.virgin.net/hamish.sanderson/ From jwight_lists at spamcop.net Mon Nov 29 02:25:32 2004 From: jwight_lists at spamcop.net (Jonathan Wight) Date: Mon Nov 29 02:25:29 2004 Subject: [Pythonmac-SIG] scripting iCal In-Reply-To: <0DAF823E-419A-11D9-A75B-000D932F4414@columbus.rr.com> References: <0DAF823E-419A-11D9-A75B-000D932F4414@columbus.rr.com> Message-ID: If you don't want to use AppleScript I have code that reads the iCal data files directly at http://toxicsoftware.com/blog/index.php/weblog/icaltorss/ Cheers. Jon. On Nov 28, 2004, at 19:03, David Reed wrote: > I've ran across this: > > http://stompstompstomp.com/weblog/technical/2004-02-05 > > and got the examples in it to work fine. > > I'm now trying to write a script to just grab the events for the > current date. I could pull all the events and check their start date, > but figure there is probably an easier way. > > The applescript documentation includes: > Class calendar: This class represents a calendar > Plural form: > calendars > Elements: > event by numeric index, before/after another element, as a range > of elements, satisfying a test > todo by numeric index, before/after another element, as a range of > elements, satisfying a test > > > but it's not clear to me how to grave events that "satisfy a test". > Can anyone help or point me to documentation on this? > > Thanks, > Dave > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > From dreedmac at columbus.rr.com Mon Nov 29 02:59:46 2004 From: dreedmac at columbus.rr.com (David Reed) Date: Mon Nov 29 02:59:50 2004 Subject: [Pythonmac-SIG] scripting iCal In-Reply-To: References: <0DAF823E-419A-11D9-A75B-000D932F4414@columbus.rr.com> Message-ID: <580E8652-41AA-11D9-A75B-000D932F4414@columbus.rr.com> I really don't care how it is done - I'm just looking to modify/write something in Python that will get all the events on the current date (including recurring events for that day) and have it email me. Your iCalendar.py script is close, but it doesn't seem to handle recurring events. I don't have a Mac at work so I want to have a cron job email me my calendar for the day each morning. Thanks, Dave On Nov 28, 2004, at 8:25 PM, Jonathan Wight wrote: > If you don't want to use AppleScript I have code that reads the iCal > data files directly at > http://toxicsoftware.com/blog/index.php/weblog/icaltorss/ > > Cheers. > > Jon. > > On Nov 28, 2004, at 19:03, David Reed wrote: > > >> I've ran across this: >> >> http://stompstompstomp.com/weblog/technical/2004-02-05 >> >> and got the examples in it to work fine. >> >> I'm now trying to write a script to just grab the events for the >> current date. I could pull all the events and check their start date, >> but figure there is probably an easier way. >> >> The applescript documentation includes: >> Class calendar: This class represents a calendar >> Plural form: >> calendars >> Elements: >> event by numeric index, before/after another element, as a range >> of elements, satisfying a test >> todo by numeric index, before/after another element, as a range >> of elements, satisfying a test >> >> >> but it's not clear to me how to grave events that "satisfy a test". >> Can anyone help or point me to documentation on this? >> >> Thanks, >> Dave >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > > > > From bob at redivi.com Mon Nov 29 05:58:38 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Nov 29 05:58:44 2004 Subject: [Pythonmac-SIG] PyObjC py2app-branch merged to trunk Message-ID: <54F492AE-41C3-11D9-813B-000A9567635C@redivi.com> The py2app-branch of PyObjC has been merged to trunk, and development will continue on trunk. For those of you that have checked out py2app-branch, please svn switch back to http://svn.red-bean.com/pyobjc/trunk/pyobjc Enhancements include but are not limited to: - All buildapp.py scripts are gone, bundlebuilder is no longer used anywhere. Examples now have setup.py scripts and are built with "python setup.py py2app". - The way setup.py works has changed significantly. It now supports a bdist_mpkg command to build a .mpkg distribution containing both PyObjC and py2app - Includes a copy of what will be py2app 0.1.6 (or possibly 0.2.0 .. depending on what else I change) - Enhanced compatibility with the Apple Objective C runtime - Bugfixes and minor feature additions on several other fronts - A sandbox directory with some new half-baked ideas for a new Objective C header parser The Xcode template still does not support py2app. I would recommend that if you use Xcode, you should only use it for development. Deployment should be done using py2app. -bob From takaanna at hotmail.com Mon Nov 29 11:28:38 2004 From: takaanna at hotmail.com (Paul Taka) Date: Mon Nov 29 11:29:08 2004 Subject: [Pythonmac-SIG] Mac OS 10.3.5 and tkinter. In-Reply-To: <99143D76-3FED-11D9-B99E-000A95BE5E0A@physics.mcmaster.ca> Message-ID: (Sorry for my late reply..) >># -*- enconding: utf-8 -*- > >encoding, I presume Yes, I mistyped in this message. Sorry. >Exactly like the below? It doesn't have a #! or encoding line like you were >saying. I didn't wrote the very first lines here, but they are included in my real script. Robert Kern was right, it works when I add /usr/bin/env before /usr/bin/pythonw: #!/usr/bin/env /usr/bin/pythonw Thanks. Will tkinter be included in macpython in a next release? Paul From hengist.podd at virgin.net Mon Nov 29 11:37:16 2004 From: hengist.podd at virgin.net (has) Date: Mon Nov 29 11:38:20 2004 Subject: [Pythonmac-SIG] scripting iCal In-Reply-To: <9047A142-41A4-11D9-A75B-000D932F4414@columbus.rr.com> References: <9047A142-41A4-11D9-A75B-000D932F4414@columbus.rr.com> Message-ID: David Reed wrote: >>#!/usr/local/bin/pythonw >> >>from appscript import * >>from datetime import date, timedelta >> >>today = date.today() >>tomorrow = today + timedelta(1) >> >># To get a list of today's events in calendar 1: >>print app('ical.app').calendars[1].events.filter((its.start_date >= >>today).AND(its.start_date < tomorrow)).get() >> >># To get names and descriptions of today's events in 'Home' calendar: >>ref = app('ical.app').calendars.filter(its.title == >>'Home').events.filter((its.start_date >= today).AND(its.start_date >>< tomorrow)) >>print zip(ref.summary.get(), ref.description.get()) > >Thanks. I had tried appscript but hadn't figured it out either. Specify? >The above works fine except it doesn't pick up events from other >days that repeat on the current date. Tsk. I rarely use iCal, so wasn't aware of this. But I've checked and, yes, start and end date refer to the original event as defined by the user. iCal's designers obviously didn't think through the implications when the event is also set to repeat. (Like I say, iApps' scripting implementations are notoriously second-rate, hardly the showcase you'd expect.) Only solution I can see is to get the start dates of all events and do the math yourself. It's slower and less convenient but at least it works: #!/usr/local/bin/pythonw from appscript import * from datetime import date, timedelta today = date.today() ref = app('ical.app').calendars[1].events print [r for r, d in zip(ref.get(), ref.start_date.get()) if not (d.date() - today).days % 7] >Is there documentation that I could look at that shows me what calls >I can make on the various objects? No, aete [Apple event terminology] resources don't carry this info (sdefs, their eventual replacement, will have limited information on which commands work on each class), and most applications have little or no additional documentation on their scripting interfaces. Yes, this sucks. >I'm guessing there's a way to change the filter to pick up repeating >events, but I don't know where to look. No, application object references - actually simple relational queries - always follow a standard structure. Notes: An Apple event interface isn't like COM where you just chuck a bunch of raw function calls out in the wild; it's a complete View-Controller layer with its own interaction rules: the Apple Event Object Model defines a standard system for referring to objects and the application developer defines the commands and classes they wish to present (which may or may not bear any resemblance to the internal data structures in the application's Model layer). It's a good system in itself, but the quality and quantity of support for it in both first- and third-party applications varies wildly. On a good day, you can do everything you want with a few references and commands; on a bad day you have to grab raw data and process it yourself; on a really bad day you're reduced to using GUI Scripting to manipulate the app (ugh!); and at worst it's impossible. Some application developers do a good-to-excellent job of implementing - and even documenting(!) - Apple event interfaces (e.g. Finder, InDesign, Entourage), but there's a lot of companies/developers out there who don't bother, or just don't seem to 'get it', or just bodge an quick-n-ugly AE wrapper around whatever existing APIs they already have (e.g. Word & Excel 2004). C'est la vie. Third-party language bridges like appscript can save you the pain of having to deal with the ugly, underpowered can-o-worms that is the AppleScript language, but they can't do anything to address the deficiencies of individual applications. Feel free to submit feature requests/bug reports/etc. to Apple and application developers: the more they hear from folk, the more likely they are to pay attention. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From takaanna at hotmail.com Mon Nov 29 11:43:13 2004 From: takaanna at hotmail.com (Paul Taka) Date: Mon Nov 29 11:44:06 2004 Subject: [Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji unicode values. Message-ID: Hello again, list. I have to type Japanese characters in python/Tk apps. Since I had troubles displaying kanji, I searched and found this topic in pythonmac archives: http://mail.python.org/pipermail/pythonmac-sig/2004-November/012110.html In the script given as example, there is the line below: root.font = TKFont(root, font = (u'\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 Pro W3', 12)) Why should I type the fontname with unicode characters? Because before I read this topic, I tried different Japanese fonts but by typing their name with ASCII char like this: font= "Hiragino Kaku Gothic W3" But it doesn't work this way. Thanks. Paul From dreedmac at columbus.rr.com Mon Nov 29 14:06:51 2004 From: dreedmac at columbus.rr.com (David Reed) Date: Mon Nov 29 14:06:55 2004 Subject: [Pythonmac-SIG] scripting iCal In-Reply-To: References: <9047A142-41A4-11D9-A75B-000D932F4414@columbus.rr.com> Message-ID: <88CCFD46-4207-11D9-A75B-000D932F4414@columbus.rr.com> On Nov 29, 2004, at 5:37 AM, has wrote: > David Reed wrote: > >>> #!/usr/local/bin/pythonw >>> >>> from appscript import * >>> from datetime import date, timedelta >>> >>> today = date.today() >>> tomorrow = today + timedelta(1) >>> >>> # To get a list of today's events in calendar 1: >>> print app('ical.app').calendars[1].events.filter((its.start_date >= >>> today).AND(its.start_date < tomorrow)).get() >>> >>> # To get names and descriptions of today's events in 'Home' calendar: >>> ref = app('ical.app').calendars.filter(its.title == >>> 'Home').events.filter((its.start_date >= today).AND(its.start_date < >>> tomorrow)) >>> print zip(ref.summary.get(), ref.description.get()) >> >> Thanks. I had tried appscript but hadn't figured it out either. > > Specify? I just hadn't figured out what to do with the return value (ref in your example above). I see now. > >> The above works fine except it doesn't pick up events from other days >> that repeat on the current date. > > Tsk. I rarely use iCal, so wasn't aware of this. But I've checked and, > yes, start and end date refer to the original event as defined by the > user. iCal's designers obviously didn't think through the implications > when the event is also set to repeat. (Like I say, iApps' scripting > implementations are notoriously second-rate, hardly the showcase you'd > expect.) > > Only solution I can see is to get the start dates of all events and do > the math yourself. It's slower and less convenient but at least it > works: > > #!/usr/local/bin/pythonw > > from appscript import * > from datetime import date, timedelta > > today = date.today() > ref = app('ical.app').calendars[1].events > print [r for r, d in zip(ref.get(), ref.start_date.get()) if not > (d.date() - today).days % 7] > > >> Is there documentation that I could look at that shows me what calls >> I can make on the various objects? > > No, aete [Apple event terminology] resources don't carry this info > (sdefs, their eventual replacement, will have limited information on > which commands work on each class), and most applications have little > or no additional documentation on their scripting interfaces. Yes, > this sucks. > > >> I'm guessing there's a way to change the filter to pick up repeating >> events, but I don't know where to look. > > No, application object references - actually simple relational queries > - always follow a standard structure. > > > Notes: > > An Apple event interface isn't like COM where you just chuck a bunch > of raw function calls out in the wild; it's a complete View-Controller > layer with its own interaction rules: the Apple Event Object Model > defines a standard system for referring to objects and the application > developer defines the commands and classes they wish to present (which > may or may not bear any resemblance to the internal data structures in > the application's Model layer). It's a good system in itself, but the > quality and quantity of support for it in both first- and third-party > applications varies wildly. > > On a good day, you can do everything you want with a few references > and commands; on a bad day you have to grab raw data and process it > yourself; on a really bad day you're reduced to using GUI Scripting to > manipulate the app (ugh!); and at worst it's impossible. Some > application developers do a good-to-excellent job of implementing - > and even documenting(!) - Apple event interfaces (e.g. Finder, > InDesign, Entourage), but there's a lot of companies/developers out > there who don't bother, or just don't seem to 'get it', or just bodge > an quick-n-ugly AE wrapper around whatever existing APIs they already > have (e.g. Word & Excel 2004). C'est la vie. > > Third-party language bridges like appscript can save you the pain of > having to deal with the ugly, underpowered can-o-worms that is the > AppleScript language, but they can't do anything to address the > deficiencies of individual applications. Feel free to submit feature > requests/bug reports/etc. to Apple and application developers: the > more they hear from folk, the more likely they are to pay attention. > Thanks for all your help. I'm coming from the Unix world (Linux and Solaris) not Windows so I'm not familiar with COM or AppleScript at all - just getting started. I'll look into calculating the recurring values myself. Thanks, Dave From rroberts at adobe.com Mon Nov 29 19:11:40 2004 From: rroberts at adobe.com (Read Roberts) Date: Mon Nov 29 19:12:02 2004 Subject: [Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji unicode values. In-Reply-To: References: Message-ID: It does not work this way. I had the same problem - I naively wrote: from Tkinter import * import tkFont root = Tk() font = tkFont .Font(root, font= "Hiragino Kaku Gothic W3". 12) and then discovered that I was still getting Lucida by checking the result with: font.actual() The issue is that many fonts offer an OpenType name table name ID 1 "Family" name in several languages. Which one is used depends on how the font manager is written and on the system language. Although I run on a US English only system, it is the Japanese font name that is used on Mac OSX,. I feel this is an error - the font manager should look at the system script, and choose the matching name from the font name table. However, I do think you cannot expect TK to match a font by any of the font names in the font. The way I figured out which font name to use was to check the list of available fonts by family name, using import root = Tk() tkFont.families(root) This lists the available fonts by family name, and gives you the family name by which the font is known to tkFont.. What I would really like is to be able to select the font by PostScript name, but I haven't figured out how to do that yet. The mechanism of (family, style) is all very well for a old TrueType fonts, but fails with a popular OpenType font like Adobe Minion Pro, with 64 styles., or even an old Type 1 font like Frutiger. - Read Roberts IAt 10:43 AM +0000 11/29/04, Paul Taka wrote: >Hello again, list. > >I have to type Japanese characters in python/Tk apps. >Since I had troubles displaying kanji, I searched and found >this topic in pythonmac archives: >http://mail.python.org/pipermail/pythonmac-sig/2004-November/012110.html > >In the script given as example, there is the line below: > >root.font = TKFont(root, font = >(u'\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 Pro W3', 12)) > >Why should I type the fontname with unicode characters? >Because before I read this topic, I tried different Japanese fonts but >by typing their name with ASCII char like this: > font= "Hiragino Kaku Gothic W3" > >But it doesn't work this way. > >Thanks. > >Paul From kranki at mac.com Mon Nov 29 22:13:09 2004 From: kranki at mac.com (Robert White) Date: Mon Nov 29 22:13:16 2004 Subject: [Pythonmac-SIG] Using embedded python programs from DarwinPorts. Message-ID: <78A525B4-424B-11D9-96FE-000A95A94FC8@mac.com> Excuse me for bringing up the following if it has previously been discussed and I missed it. Recently, I started using DarwinPorts again to install some programs that I like to have around. However, I noticed that several programs that embed Python force an installation of python 2.3.4 into DarwinPorts for MacOSX 10.3.6 rather than just using the built-in python. So, in the case of Glom, XChat2 and cvs2svn, I started researching how to change the appropriate autoconf et al files to properly link to or set up in the builtin Python. (Probably, mostly m4 macros) In doing that I contacted two different Port Maintainers asking some very basic questions. One stated that "port" is smart enough to use the builtin-Python Framework and not pull in the unix version which is not my experience. The other stated that "The darwinports policy for both perl and python modules is to only use the darwinports-provided versions of these languages. The reason is that doing something else would require installing files outside of the darwinports prefix (which is /opt/local by default).". While I find those comments to be justified, I am wondering if it would not be possible to use the builtin version if one were to have their own PYTHONPATH environment variable defined and otherwise pull in a different version. (I am probably wrong, but I think that a PYTHONPATH variable addresses most of the problem especially if it is pointing back into /opt/local somewhere.) I know that this ultimately must be presented to the DarwinPorts Group, but I know that several on this list are very active there and may indicate to me that this is not a worthwhile investment of my time. So, I wanted to get your opinions first of whether I should pursue this or not and if so, any gotchas that you might be aware of. From bob at redivi.com Mon Nov 29 22:52:55 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Nov 29 22:53:15 2004 Subject: [Pythonmac-SIG] Using embedded python programs from DarwinPorts. In-Reply-To: <78A525B4-424B-11D9-96FE-000A95A94FC8@mac.com> References: <78A525B4-424B-11D9-96FE-000A95A94FC8@mac.com> Message-ID: <06809599-4251-11D9-AC1D-000A9567635C@redivi.com> On Nov 29, 2004, at 4:13 PM, Robert White wrote: > Excuse me for bringing up the following if it has previously been > discussed and I missed it. > > Recently, I started using DarwinPorts again to install > some programs that I like to have around. However, I noticed that > several programs that embed Python force an installation of python > 2.3.4 into DarwinPorts for MacOSX 10.3.6 rather than just using the > built-in python. > > So, in the case of Glom, XChat2 and cvs2svn, I started researching > how to change the appropriate autoconf et al files to properly link to > or set up in the builtin Python. (Probably, mostly m4 macros) > In doing that I contacted two different Port Maintainers asking some > very basic questions. One stated that "port" is smart enough to use > the builtin-Python Framework and not pull in the unix version > which is not my experience. The other stated that "The darwinports > policy for both perl and python modules is to only use the > darwinports-provided versions of these languages. The reason is > that doing something else would require installing files outside of > the darwinports prefix (which is /opt/local by default).". port is probably smart enough to bring in Python, but the existing autoconf scripts, etc. for the packages probably need to be patched. A lot of them assume -lpython will do the job. What you *could* do is something like the following to trick them: ln -s /System/Library/Frameworks/Python.framework/Versions/2.3/Python /opt/local/lib/libpython2.3.dylib ln -s /System/Library/Frameworks/Python.framework/Python /opt/local/lib/libpython2.dylib ln -s /System/Library/Frameworks/Python.framework/Python /opt/local/lib/libpython.dylib ln -s /System/Library/Frameworks/Python.framework/Versions/2.3/include/ python2.3 /opt/local/include/python2.3 ln -s /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3 /opt/local/lib/python2.3 This is probably enough to trick a naive configure script to find your framework python and link to it correctly without changes.. (untested, wrote it in mail, didn't want to deactivate my darwinports python to try it). > While I find those comments to be justified, I am wondering if it would > not be possible to use the builtin version if one were to have their > own PYTHONPATH environment variable defined and otherwise > pull in a different version. (I am probably wrong, but I think that > a PYTHONPATH variable addresses most of the problem especially > if it is pointing back into /opt/local somewhere.) Well you would have to add extra cruft to the "python setup.py install" command.. --prefix=/opt/local would be almost sufficient, except that if you did the trickery above, the headers and the python packages themselves would go to the wrong place. Unfortunately there isn't really a right place if the above trickery is used, because the headers would never really be findable by packages that need them (i.e. pygame looking for Numeric headers). This is a general problem with distutils. --install-platlib could put the python packages somewhere else just fine though (/opt/local/python/2.3/ maybe). > I know that this ultimately must be presented to the DarwinPorts > Group, but I know that several on this list are very active there > and may indicate to me that this is not a worthwhile investment > of my time. So, I wanted to get your opinions first of whether I > should > pursue this or not and if so, any gotchas that you might be aware of. It's a lot of work, question is do you really want to bother? :) My only real problem with the darwinports Python is that it uses the linker option -undefined suppress -flat_namespace (last I checked)... I personally have a whole bunch of Pythons installed for testing purposes, so I'm used to the hassle.. though 95% of the time I use the stock Python 2.3.0. At some point I'm going to start contributing port and port patches to dp, but I just have high priority things on my plate right now. -bob From bob at redivi.com Tue Nov 30 03:38:14 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 30 03:38:23 2004 Subject: [Pythonmac-SIG] ANN: Python 2.3->2.4 "compatibility" package Message-ID: I've put together a quick set of packages that brings a few new/updated modules from Python 2.4 to Python 2.3: Cross-platform: new subprocess module new decimal module For Mac OS X: new LaunchServices wrapper new OSA wrapper updated QuickTime package A binary installer built with bdist_mpkg is available from: http://undefined.org/python/Python23Compat.zip Sources are available by svn at: http://svn.red-bean.com/bob/Python23Compat/trunk/ The installer can be built as follows (assuming py2app trunk installed): % python setup.py bdist_mpkg or % bdist_mpkg -- (the -- makes sure it doesn't open up N installers.. bdist_mpkg by default automatically opens the new package) -bob From takaanna at hotmail.com Tue Nov 30 08:30:31 2004 From: takaanna at hotmail.com (Paul Taka) Date: Tue Nov 30 08:31:06 2004 Subject: [Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji unicode values. In-Reply-To: Message-ID: Thank you very much for your detailed answer, and telling me how to list Tk font families. I'll try that. By the way, did you find an issue for this problem about displaying some Kanji? And do you know some way to type Japanese with Mac IME into a Tk entry box? Paul >From: Read Roberts >To: Paul Taka >CC: pythonmac-sig@python.org >Subject: RE:[Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji >unicode values. >Date: Mon, 29 Nov 2004 10:11:40 -0800 > > >It does not work this way. I had the same problem - I naively wrote: >from Tkinter import * >import tkFont > >root = Tk() >font = tkFont .Font(root, font= "Hiragino Kaku Gothic W3". 12) >and then discovered that I was still getting Lucida by checking the result >with: >font.actual() > >The issue is that many fonts offer an OpenType name table name ID 1 >"Family" name in several languages. Which one is used depends on how the >font manager is written and on the system language. Although I run on a US >English only system, it is the Japanese font name that is used on Mac >OSX,. I feel this is an error - the font manager should look at the system >script, and choose the matching name from the font name table. However, I >do think you cannot expect TK to match a font by any of the font names in >the font. > >The way I figured out which font name to use was to check the list of >available fonts by family name, using > >import >root = Tk() >tkFont.families(root) > >This lists the available fonts by family name, and gives you the family >name by which the font is known to tkFont.. > >What I would really like is to be able to select the font by PostScript >name, but I haven't figured out how to do that yet. The mechanism of >(family, style) is all very well for a old TrueType fonts, but fails with a >popular OpenType font like Adobe Minion Pro, with 64 styles., or even an >old Type 1 font like Frutiger. > >- Read Roberts From robert at xtrafone.com Tue Nov 30 10:04:25 2004 From: robert at xtrafone.com (=?ISO-8859-1?Q?Robert_Valsj=F6?=) Date: Tue Nov 30 10:04:27 2004 Subject: [Pythonmac-SIG] python 2.3.4 on Mac OS X 10.3.6 is working - upgraded standard installation In-Reply-To: <2B2135FF-4196-11D9-8E30-000A9567635C@redivi.com> References: <2B2135FF-4196-11D9-8E30-000A9567635C@redivi.com> Message-ID: Hi Bob! Thanx for the info. I have one question though. I've read your info about patching the python 2.3.4 source Makefile, but since I'm not a c-programmer, can you please tell me what to do after I downloaded the python 2.3.4 source and untared it? Please don't laugh... ;-) /rob On 2004-11-29, at 00.35, Bob Ippolito wrote: > On Nov 28, 2004, at 2:21 PM, Robert Valsj? wrote: > >> I have upgraded my standard python installation which comes with Mac >> OS X 10.3.6 to python 2.3.4 from source. >> >> I've followed the instructions in the README file in the catalog >> Mac/OSX in the source distribution. >> >> Everything I've done seems to work, but have I missed something? >> Please let me know. > > Yes. > >> Here is my history list of the commands I've done. >> >> 1780 tar Python-2.3.4.tgz >> 1781 tar zxvf Python-2.3.4.tgz >> 1782 cd Python-2.3.4 >> 1790 ./configure --enable-framework >> 1803 make >> 1804 make frameworkinstall >> 1805 make frameworkinstallextras > > You should patch the Makefile as I mentioned earlier today, or else > when/if you install Python 2.4, your Python 2.3 will be broken. > >> 1815 cd /usr/bin/ >> 1818 sudo mv python python.orig >> 1820 sudo mv python2.3 python2.3.orig >> 1822 sudo mv pythonw pythonw.orig >> 1823 sudo mv pythonw2.3 pythonw2.3.orig > > DO NOT EVER DO THIS! Never touch /usr (except /usr/local)!! Just put > /usr/local/bin before /usr/bin on your path and be done with it! > >> 1827 cd /etc/ >> 1831 sudo emacs profile #add /usr/local/bin to PATH > > DO NOT EVER DO THIS EITHER! Just add it to your ~/.bashrc or ~/.tcshrc > > -bob > > Robert Valsj? Xtrafone www.xtrafone.com E-mail: robert@xtrafone.com From Jack.Jansen at cwi.nl Tue Nov 30 14:00:50 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Nov 30 13:59:12 2004 Subject: [Pythonmac-SIG] IDE crash In-Reply-To: <20041119234839.GA13130@bantha.org> References: <20041119234839.GA13130@bantha.org> Message-ID: On 20 Nov 2004, at 00:48, Michael Davidson wrote: > I have installed the Nov 7,2003 add ins from > http://homepages.cwi.nl/~jack/macpython/. My IDE used to work. I > foolishly > was playing with menu options that I should not have played with, and > now > my IDE crashes immediately after starting. [...] > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/Mac/Tools/ > IDE/Wapplication.py", line 433, in getnextid > > id = self.possibleIDs[0] This is a known bug, that will be fixed in a future release. The problem is that there are so many files under your Scripts folder that the IDE runs out of menu entries and crashes. The workaround is to put less files in your Scripts folder. What may have happened during your fiddling is that you've set the scripts folder to something like your home directory. Reset the IDE preferences by removing "~/Library/Preferences/Python/PythonIDE preferences" and things should start working again. -- 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 kranki at mac.com Tue Nov 30 14:23:07 2004 From: kranki at mac.com (Robert White) Date: Tue Nov 30 14:23:22 2004 Subject: [Pythonmac-SIG] (no subject) Message-ID: If someone could run the following program on a Darwin machine, not MacOSX, and email me the results, I would appreciate it. Since I run several computers at my home, I now have the output for MacOSX, Cygwin, Win32 and Linux. If anyone can email me the output for other OSes such as Solaris, Sun, etc, I would appreciate that too. Thanks for your help. Bob #!/usr/bin/env python #Program: testSysconfig.py - Print the sysconfig variables import os import sys import distutils.sysconfig if __name__ == '__main__': aDict = distutils.sysconfig.get_config_vars( ) for a in aDict: print a,'[',aDict[a],']' From Jack.Jansen at cwi.nl Tue Nov 30 16:17:35 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Nov 30 16:17:45 2004 Subject: [Pythonmac-SIG] Problem during installing MySQL module in Python In-Reply-To: References: Message-ID: On 26 Nov 2004, at 08:39, Zsolt.Putnoky@alcatel.fr wrote: > > Dear All, > > I had tried to install MySQLdba-1.0.0 to be able to talk to MySQL 4 > databases. I cd-ed into the MySQLdba-1.0.0 folder then issued the > following command > > /usr/local/bin/python setup.py install # /usr/local/bin/python is to > select the custom installation (Python 2.3.4) and not the Apple > provided one. > > At the end of the installation, had received the following message > > _mysql.c: In function `_mysql_ConnectionObject_shutdown': > _mysql.c:1545: error: too few arguments to function `mysql_shutdown' > error: command 'gcc' failed with exit status 1 Have you checked that the version of mysql that you have installed is actually the same version as what the MySQLdba extension expects? This looks like the sort of error that could happen if the two don't match: it appears the function signature of mysql_shutdown() is different from what MySQLdba expects... -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1239 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041130/e82d610c/attachment.bin From Jack.Jansen at cwi.nl Tue Nov 30 16:25:33 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Nov 30 16:25:37 2004 Subject: [Pythonmac-SIG] Keystroke/mouse events In-Reply-To: <0A4A8EA3-40B8-11D9-A23B-000A95AFD464@mac.com> References: <0A4A8EA3-40B8-11D9-A23B-000A95AFD464@mac.com> Message-ID: <13776AE0-42E4-11D9-BFC9-000A958D1666@cwi.nl> On 27 Nov 2004, at 22:05, Edward Majcher wrote: > I need to intercept keystrokes and mouse events at the system level, > basically like a keystroke logger, not being familiar enough with the > apple frameworks, can anyone point me in the right direction as far as > a python package? I thought maybe "Events" in the Carbon package but > from reading the apple api documentation this leads me to believe this > will only work for events in the current application, vs system wide. I don't know of any API that allows you to do this. But it could well be that there's something (maybe deep down in the accessibility stuff?), you should ask on a generic MacOSX developer list. Then once you've found the API you want we should be able to tell you whether it's available from Python. -- 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 Zsolt.Putnoky at alcatel.fr Tue Nov 30 16:33:44 2004 From: Zsolt.Putnoky at alcatel.fr (Zsolt.Putnoky@alcatel.fr) Date: Tue Nov 30 16:33:50 2004 Subject: [Pythonmac-SIG] Problem during installing MySQL module in Python In-Reply-To: Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 207 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041130/b612034c/attachment.gif From Jack.Jansen at cwi.nl Tue Nov 30 16:36:42 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Nov 30 16:36:52 2004 Subject: [Pythonmac-SIG] Problems with MacPython PackMan In-Reply-To: References: Message-ID: On 28 Nov 2004, at 19:18, David Warde-Farley wrote: > I fired up Package Manager a short while ago and got some rather > puzzling behavior. Namely, packages won't install! They will download > (I see this if check "verbose") but then it just hangs there. I'm at a > loss as to why this would happen. Any ideas? (I've tried both your > repository and the undefined.org repo). This is a new one (at least, I haven't heard it before). I assume binary packages install correctly, right? First thing to check is what you've got in /tmp. You should have the .tar.gz for the package that was downloaded, and an unpacked version of it. If there's no unpacked version something went wrong during untarring. You could also check whether the command-line version of PackMan (/System/....../lib/plat-mac/pimp.py) works correctly. And maybe it's worthwhile to see if you can find out what it's doing when it's hanging (ps should help here). -- 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 bob at redivi.com Tue Nov 30 17:13:47 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 30 17:14:41 2004 Subject: [Pythonmac-SIG] python 2.3.4 on Mac OS X 10.3.6 is working - upgraded standard installation In-Reply-To: References: <2B2135FF-4196-11D9-8E30-000A9567635C@redivi.com> Message-ID: On Nov 30, 2004, at 4:04 AM, Robert Valsj? wrote: > I have one question though. I've read your info about patching the > python 2.3.4 source Makefile, but since I'm not a c-programmer, can > you please tell me what to do after I downloaded the python 2.3.4 > source and untared it? Python installs its own compile time Makefile so that third party extensions can be compiled with the same options. The Makefile patching I have described is a patch intended to be done to this *installed* Makefile, NOT to the Python source code. If you want to patch the Python sources, you would ideally it do it configure.in, run autoconf, and then send a patch to http://sf.net/projects/python/ :) Anyway, to see where the Makefile is located, do: python -c "import sys,os; print os.path.join(sys.prefix, 'lib', 'python2.3', 'config', 'Makefile')" Once you know where this Makefile is, open it up with your favorite text editor (probably using sudo). Navigate to approximately line 98 and replace the two configuration variables LDSHARED and BLDSHARED with the following: LDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup BLDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup Save the file. -bob From robert at xtrafone.com Tue Nov 30 17:36:44 2004 From: robert at xtrafone.com (=?ISO-8859-1?Q?Robert_Valsj=F6?=) Date: Tue Nov 30 17:36:48 2004 Subject: [Pythonmac-SIG] python 2.3.4 on Mac OS X 10.3.6 is working - upgraded standard installation In-Reply-To: References: <2B2135FF-4196-11D9-8E30-000A9567635C@redivi.com> Message-ID: <05824F56-42EE-11D9-B45E-000D932AD2CC@xtrafone.com> Thanx! Should I do this for python 2.4c1 also? /rob On 2004-11-30, at 17.13, Bob Ippolito wrote: > On Nov 30, 2004, at 4:04 AM, Robert Valsj? wrote: > >> I have one question though. I've read your info about patching the >> python 2.3.4 source Makefile, but since I'm not a c-programmer, can >> you please tell me what to do after I downloaded the python 2.3.4 >> source and untared it? > > Python installs its own compile time Makefile so that third party > extensions can be compiled with the same options. The Makefile > patching I have described is a patch intended to be done to this > *installed* Makefile, NOT to the Python source code. If you want to > patch the Python sources, you would ideally it do it configure.in, run > autoconf, and then send a patch to http://sf.net/projects/python/ :) > > Anyway, to see where the Makefile is located, do: > > python -c "import sys,os; print os.path.join(sys.prefix, 'lib', > 'python2.3', 'config', 'Makefile')" > > Once you know where this Makefile is, open it up with your favorite > text editor (probably using sudo). > Navigate to approximately line 98 and replace the two configuration > variables LDSHARED and BLDSHARED with the following: > > LDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) -bundle > -undefined dynamic_lookup > BLDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) -bundle > -undefined dynamic_lookup > > Save the file. > > -bob > > Robert Valsj? Xtrafone www.xtrafone.com E-mail: robert@xtrafone.com From rroberts at adobe.com Tue Nov 30 17:36:50 2004 From: rroberts at adobe.com (Read Roberts) Date: Tue Nov 30 17:37:15 2004 Subject: [Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji unicode values. In-Reply-To: References: Message-ID: At 7:30 AM +0000 11/30/04, Paul Taka wrote: >Thank you very much for your detailed answer, and telling me how to >list Tk font families. >I'll try that. > >By the way, did you find an issue for this problem about displaying >some Kanji? >And do you know some way to type Japanese with Mac IME into a Tk entry box? > >Paul > There is a solution for the problems in displaying some Kanji. It exists in the form of a patch, so you need to download the Tk/Tcl sources, add the patch, and build the tk/Tcl libraries. the path is described at; "[ 638966 ] Font rendering on MacOSX with ATSU" Benjamin Riefenstahl seems to be actively working on on this area, according to an earlier e-mail on this thread, so there may be better code for the patch in a few days or weeks Tk does not yet work with Japanese IME's under Mac OS X ( it works fine with IME's under Windows). I would also very much like to see this fixed. The only work-around that I see is to write a separate bundle or dylib that puts up UI for text entry using the Apple graphic UI calls. You might look on the the following news-lists. These are in Japanese, so I can't read them - please let me know if there is anything relevant. >Motto Tcl/Tk", a Japanese-language site that appears to be devoted >to Tcl/Tk information generally. Fairly current. > * > * Has a list of "Japanese patches", referring to IMEs on Win and Unix > (but no Mac). > >"Tcl/Tk Japanese Team", a Sourceforge project to "translate >documents and develop patches to fix bugs in Japanese processing, >and also to develop new functionality for the Japanese environment." >[Japanese] > * Sourceforge project page > * Sourceforge main page (stale) > * Mailing list > * Archive: > - Read Roberts From bob at redivi.com Tue Nov 30 17:58:17 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Nov 30 17:58:55 2004 Subject: [Pythonmac-SIG] python 2.3.4 on Mac OS X 10.3.6 is working - upgraded standard installation In-Reply-To: <05824F56-42EE-11D9-B45E-000D932AD2CC@xtrafone.com> References: <2B2135FF-4196-11D9-8E30-000A9567635C@redivi.com> <05824F56-42EE-11D9-B45E-000D932AD2CC@xtrafone.com> Message-ID: <07D8711A-42F1-11D9-A720-000A9567635C@redivi.com> On Nov 30, 2004, at 11:36 AM, Robert Valsj? wrote: > On 2004-11-30, at 17.13, Bob Ippolito wrote: > >> On Nov 30, 2004, at 4:04 AM, Robert Valsj? wrote: >> >>> I have one question though. I've read your info about patching the >>> python 2.3.4 source Makefile, but since I'm not a c-programmer, can >>> you please tell me what to do after I downloaded the python 2.3.4 >>> source and untared it? >> >> Python installs its own compile time Makefile so that third party >> extensions can be compiled with the same options. The Makefile >> patching I have described is a patch intended to be done to this >> *installed* Makefile, NOT to the Python source code. If you want to >> patch the Python sources, you would ideally it do it configure.in, >> run autoconf, and then send a patch to http://sf.net/projects/python/ >> :) >> >> Anyway, to see where the Makefile is located, do: >> >> python -c "import sys,os; print os.path.join(sys.prefix, 'lib', >> 'python2.3', 'config', 'Makefile')" >> >> Once you know where this Makefile is, open it up with your favorite >> text editor (probably using sudo). >> Navigate to approximately line 98 and replace the two configuration >> variables LDSHARED and BLDSHARED with the following: >> >> LDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) >> -bundle -undefined dynamic_lookup >> BLDSHARED= env MACOSX_DEPLOYMENT_TARGET=10.3 $(CC) $(LDFLAGS) >> -bundle -undefined dynamic_lookup >> >> Save the file. >> > Should I do this for python 2.4c1 also? No, as I said in my previous message on the subject, this patch ONLY applies to Python 2.3. It has been fixed for a long time in Python 2.4 -bob From Jack.Jansen at cwi.nl Tue Nov 30 21:46:53 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Nov 30 21:46:52 2004 Subject: [Pythonmac-SIG] Mac OS 10.3.5 and tkinter. In-Reply-To: <41A7AB2E.9060605@ucsd.edu> References: <41A7AB2E.9060605@ucsd.edu> Message-ID: On 26-nov-04, at 23:16, Robert Kern wrote: > /usr/bin/pythonw is a shell script, so it can't be directly called by > the #! (it will try to interpret hello.py as a shell script, too, not > a Python script; thus the syntax errors). > > Use > > #!/usr/bin/env /usr/bin/pythonw Ah, that's a much nicer workaround than the one I always suggested (using the path to the interpreter deep in the framework). I've taken the liberty to add it to the FAQ. Thanks, -- 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 kranki at mac.com Tue Nov 30 19:00:50 2004 From: kranki at mac.com (Robert White) Date: Wed Dec 1 19:08:32 2004 Subject: [Pythonmac-SIG] (no subject) Message-ID: Thanks to David Reed. I now have a Solaris 9 output. I would still really like a Darwin output if anyone can do it. Bob Begin forwarded message: > From: Robert White > Date: November 30, 2004 8:23:07 AM EST > To: pythonmac-sig@python.org > Subject: > > If someone could run the following program on a Darwin machine, not > MacOSX, > and email me the results, I would appreciate it. Since I run several > computers > at my home, I now have the output for MacOSX, Cygwin, Win32 and Linux. > If > anyone can email me the output for other OSes such as Solaris, Sun, > etc, I > would appreciate that too. > > Thanks for your help. > > Bob > > > > > > > #!/usr/bin/env python > > #Program: testSysconfig.py - Print the sysconfig variables > > import os > import sys > import distutils.sysconfig > > if __name__ == '__main__': > aDict = distutils.sysconfig.get_config_vars( ) > for a in aDict: > print a,'[',aDict[a],']' > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1171 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041130/7b171b71/attachment.bin