From carlo at jsbach.harvard.edu Thu Jul 1 18:25:35 2004 From: carlo at jsbach.harvard.edu (Carlo Mattoni) Date: Thu Jul 1 18:25:39 2004 Subject: [Pythonmac-SIG] Matlab-like IDE Message-ID: Does anyone have a recommendation for an IDE with matlab-like functionality? The ability to interogate/modify the local namespace by issuing commands (including calls to plotting routines) while stopped in the debugger is one of the most useful features of matlab and one which I have yet to find in a mac python IDE. I have been using pyOXIDE for a while now and like its clean aqua interface but have missed the interogatory debugging capabilities of matlab. Boa Constructor seemed like a promising alternative in this respect since it has the debugging capabilities I seek and under windoze seems moderately stable. Unfortunately I have had minimal luck with Boa 0.2.8 under os x 10.3 with wxPython 2.4 (with 2.5 it doesn't work at all). It launches but behaves erratically at best (missing buttons, frequent crashes, inability to edit some files, etc.). Any suggestions would be very much appreciated. From gandreas at visi.com Thu Jul 1 18:42:05 2004 From: gandreas at visi.com (gandreas) Date: Thu Jul 1 18:42:45 2004 Subject: [Pythonmac-SIG] Matlab-like IDE In-Reply-To: References: Message-ID: On Jul 1, 2004, at 3:25 PM, Carlo Mattoni wrote: > I have been using pyOXIDE for a while now and like its clean aqua > interface but have missed the interogatory debugging capabilities of > matlab. Give me some more examples and suggestions on what you'd like to see, and how it can work, and I can try to add them for the next version (it's amazing how many bugs you find when you're running your app on a different machine, and without the ability to rebuild it to fix them). Assuming you are able to run it "internally" (i.e., you don't have to run your app as part of any external process) you can just bring up a new interactive window and tell it to use the namespace of your script. However, that doesn't let you easily call things with the state of something stopped in a function. You can also modify the values of the local variables in the debugger (and this works for both internally running and externally running scripts) but you can't yet execute arbitrary code. Adding this shouldn't be too hard, however. From carlo at jsbach.harvard.edu Thu Jul 1 18:55:12 2004 From: carlo at jsbach.harvard.edu (Carlo Mattoni) Date: Thu Jul 1 18:55:18 2004 Subject: [Pythonmac-SIG] Matlab-like IDE In-Reply-To: Message-ID: On Thu, 1 Jul 2004, gandreas wrote: > You can also modify the values of the local variables in the debugger > (and this works for both internally running and externally running > scripts) but you can't yet execute arbitrary code. Adding this > shouldn't be too hard, however. The ability to execute arbitrary code while stopped in the debugger is exactly what I am looking for and if you can add it to pyOXIDE relatively easily that would be tremendous. Ideally one would have access to a "python interactive" window whenever the debugger is stopped and be able to execute commands, look at results, etc. from within that shell. Then it would be a simple matter to import one's favorite plotting library and have the full matlab-like ability to visualize arrays, etc. I would contend that for scientific prototyping this is extremely useful functionality. From Jack.Jansen at cwi.nl Fri Jul 2 04:17:24 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Jul 2 04:16:15 2004 Subject: [Pythonmac-SIG] Matlab-like IDE In-Reply-To: References: Message-ID: <3FDDD752-CC00-11D8-87BE-000A958D1666@cwi.nl> On 2-jul-04, at 0:25, Carlo Mattoni wrote: > Does anyone have a recommendation for an IDE with matlab-like > functionality? > > The ability to interogate/modify the local namespace by issuing > commands > (including calls to plotting routines) while stopped in the debugger is > one of the most useful features of matlab and one which I have yet to > find > in a mac python IDE. This is a serious issue with the current IDE debugger, and one that I've been aware of ever since I wrote it's predecessor (the IDE debugger is Just's, but based on mine, AFAIK). Unfortunately I never got around to fixing this. I do know what a fix could look like, though. The easiest is adding a button "Interactive" that would open a new interactive window with the interpreter in the namespace of the currently selected frame. A better solution would be to have a drawer that would be an interactive window (similar to the XCode debugger), and have the drawer and the main debugger window synchronised (i.e. the debugger variable display would update as you type commands in the interactive drawer, and the drawer would somehow show (in the prompt?) when you switch to a different frame in the debugger window. -- 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: smime.p7s Type: application/pkcs7-signature Size: 2086 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040702/3203ee6b/smime.bin From israel at sandlotgames.com Fri Jul 2 13:59:53 2004 From: israel at sandlotgames.com (Israel C. Evans) Date: Fri Jul 2 13:59:01 2004 Subject: [Pythonmac-SIG] Scripting iCal and using OSA? Message-ID: <9EEB67AE-CC51-11D8-8DAD-000393A47FF2@sandlotgames.com> Hey there folks. I've been following the small tutorialish thing on this page http://stompstompstomp.com/weblog/technical/2004-02-05 and I'm not having much luck. I've got python 2.3 on macosx 10.2.8 and I've used the gensuitemodule to create an iCal module-folder-with-a-bunch-of-other-modules-inside-type-doodad. Following the directions on the aforementioned page I was able to feed the output of the two functions to a test log file which always came up changed, but still blank as , um, something that was very blank. So I started to play and around and try hunting for things, but what I found didn't seem to echo what was in the iCal dictionary opened from within the apple script editor which seems to have a wonderful amount of access to just about any program that even slightly thinks about applescript. -> app = iCal.iCal() log = file('/Users/iz/proj/pythonica/osa/osatest_log.txt','w') log.write(str('\n'.join(app.__dict__))+'\n') log.write(str('\n'+'\n'.join(app.calendar.__dict__))+'\n') log.write(str(app.calendar[0])) log.flush() log.close() <- This got me a text file that looks something like this: -> target_signature send_priority send_flags target send_timeout compclass fr <- After having read the osa docs in the python documentation, I don't feel a whole lot more enlightened. I'm obviously very confused about how to use this stuff. If any of you can find it in your heart to offer kind advice or point me towards any handily available founts of knowledge, I would be most grateful. ~Israel~ ~Israel~ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1686 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040702/1ced9cc0/attachment.bin From bob at redivi.com Fri Jul 2 14:06:07 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Jul 2 14:07:22 2004 Subject: [Pythonmac-SIG] Scripting iCal and using OSA? In-Reply-To: <9EEB67AE-CC51-11D8-8DAD-000393A47FF2@sandlotgames.com> References: <9EEB67AE-CC51-11D8-8DAD-000393A47FF2@sandlotgames.com> Message-ID: <7E2F628A-CC52-11D8-A005-000A95686CD8@redivi.com> On Jul 2, 2004, at 10:59 AM, Israel C. Evans wrote: > I've been following the small tutorialish thing on this page > http://stompstompstomp.com/weblog/technical/2004-02-05 and I'm not > having much luck. > > I've got python 2.3 on macosx 10.2.8 and I've used the gensuitemodule > to create an iCal > module-folder-with-a-bunch-of-other-modules-inside-type-doodad. Don't use gensuitemodule. Right now your best bet is to try appscript . -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040702/913c0c0c/smime.bin From israel at sandlotgames.com Fri Jul 2 15:48:21 2004 From: israel at sandlotgames.com (Israel C. Evans) Date: Fri Jul 2 15:47:27 2004 Subject: [Pythonmac-SIG] Scripting iCal and using OSA? In-Reply-To: <7E2F628A-CC52-11D8-A005-000A95686CD8@redivi.com> Message-ID: > Don't use gensuitemodule. Right now your best bet is to try appscript > . Oh, this is much better! Thank you. It's a little unexpectedly organized, but it's working like a charm. The examples are really helping me out here. After having not had luck with the iCal.py module (didn't seem to have frequency rules worked out), then being unable to get shared libraries working well enough to compile libical, going the osa route was one of my last available options for what I was intending to do. Thank you so much for helping out. ~Israel~ From Jonathan.Peirce at nottingham.ac.uk Sat Jul 3 06:08:11 2004 From: Jonathan.Peirce at nottingham.ac.uk (Jon Peirce) Date: Sat Jul 3 06:08:14 2004 Subject: [Pythonmac-SIG] Matlab-like IDE In-Reply-To: <40E67423.1060107@psychology.nottingham.ac.uk> References: <40E67423.1060107@psychology.nottingham.ac.uk> Message-ID: <40E6858B.2090506@psychology.nottingham.ac.uk> WingIDE does have the functionality - they call it the debug probe. For Mac you have to use the 1.1 version but they say version 2 (which is currently in beta on windows) will be supported for mac too. WingIDE is free if you're actively developing open source projects and is a nice package (full code completion too, at least in the main editor window). -- Jon Peirce This message has been scanned but we cannot guarantee that it and any attachments are free from viruses or other damaging content: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From junkster at rochester.rr.com Sat Jul 3 06:22:18 2004 From: junkster at rochester.rr.com (Benjamin Schollnick) Date: Sat Jul 3 06:22:13 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... Message-ID: Folks, (This is a resend... I sent the original with the wrong email account...) I know I asked about this before... But... The following script will crash the finder, in a repeatable manner.... After, roughly, only .... four thousand and twenty five findertools.move's, the finder will crash.... This finder crash also seems to take down Safari if it is running.... (No other applications, just the Finder and Safari... Actually, technically the finder is running... But you have the spinning pizza wheel, and your only recourse is to relaunch the finder.... Also... I can't find the directory that findertools or EasyDialogs is now stored in.... I am running on 10.3.4, and this has happened for a long time... I never thought to see if it is reproducable or consistent.... - Benjamin Btw-> If anyone asks, this is usually run on my download directory... Well, actually a different script is run on my download directory to "clean it up", and make subdirectories, and move files. I just changed the way that script works, so I need to "remove" the old subdirectories and have it process them again... So I whipped this up... ----------------------------------------------------------------------- #!python import sys import os from bas_common import * mac_mode = macintosh if mac_mode: import macostools import findertools # import macfs import EasyDialogs def move_file ( old_path, new_path, filename ): # print "old: ",old_path # print "new:",new_path # print "filename:",filename # print "old + file:", old_path + os.sep + filename if os.path.exists (new_path + os.sep + filename): Ask = EasyDialogs.AskYesNoCancel("Duplicate File Detected (%s), Overwrite?" % filename, default = 1, yes=None, no=None, cancel=None, id=262) if Ask == 1: if mac_mode: # Overwrite, by removing the old file # os.remove(new_path + os.sep + filename) elif Ask == 0: # # Do not overwrite, end routine, by returning # return 0 elif Ask == -1: # # Abort program, return error code # return -1 if mac_mode: findertools.move (old_path + os.sep + filename, new_path) return None if len(sys.argv) < 1: print "Aborted...." sys.exit(5) sources = EasyDialogs.AskFolder ( message="Please choose a folder to process") print sources sources = sources.strip() print sources found = os.listdir ( sources ) if found == None or found =="": print "No directory selected." sys.exit(5) number_of_entries = len(found) count = 0 for j in found: new_directory = sources + os.sep + j if os.path.isdir ( new_directory ): files = os.listdir ( new_directory ) if len(files) > 1: print "\n",new_directory for x in files: if x.upper() == ".DS_STORE": pass else: print " ",count," ", #print new_directory, " ", sources, " ", x move_file ( new_directory, sources, x)#, new_dir, filename ) count = count +1 print ".", ----------------------------------------------------------------------- From junkster at rochester.rr.com Sat Jul 3 07:08:59 2004 From: junkster at rochester.rr.com (Benjamin Schollnick) Date: Sat Jul 3 07:08:53 2004 Subject: [Pythonmac-SIG] Re: Accessing the USB Ports In-Reply-To: <427A40A8-CCE0-11D8-841D-000A9597110A@rochester.rr.com> References: <427A40A8-CCE0-11D8-841D-000A9597110A@rochester.rr.com> Message-ID: <627C475A-CCE1-11D8-841D-000A9597110A@rochester.rr.com> On Jul 3, 2004, at 7:00 AM, Benjamin Schollnick wrote: Folks, (@#$@#$@#$ Did it again... Forgot to change my email account in mail...@#$@$) I have been thinking of doing something strange and potentially useful. Is there any way to "control" a USB port from MacPython? I'm considering actually breaking apart a usb cable and using it as a rely control, so I would need to be able to force a line or two high, or low on demand... Heck sending real data through the USB port might be helpful too.... Any ideas? Cross platform Windows/Linux/Mac would be best, but..... - Benjamin From jwblist at olympus.net Sat Jul 3 15:47:14 2004 From: jwblist at olympus.net (John W. Baxter) Date: Sat Jul 3 15:47:29 2004 Subject: [Pythonmac-SIG] Re: Accessing the USB Ports In-Reply-To: <627C475A-CCE1-11D8-841D-000A9597110A@rochester.rr.com> Message-ID: On 7/3/2004 4:08, "Benjamin Schollnick" wrote: > > On Jul 3, 2004, at 7:00 AM, Benjamin Schollnick wrote: > > Folks, > (@#$@#$@#$ Did it again... Forgot to change my email account in > mail...@#$@$) > > I have been thinking of doing something strange and potentially useful. > > Is there any way to "control" a USB port from MacPython? > > I'm considering actually breaking apart a usb cable and using it as a > rely control, > so I would need to be able to force a line or two high, or low on > demand... > > Heck sending real data through the USB port might be helpful too.... > > Any ideas? > > Cross platform Windows/Linux/Mac would be best, but..... Reading the specs on at least USB 1.1 and 2.0 would likely be a decent first step. USB is a remarkably complicated serial protocol...after reading the spec, a likely reaction is "how does this thing ever work"...particularly the high speed devices. One likely place is http://www.usb.org/developers/docs/ (Early hit on Google for USB+specification) --John From artelse at mohr-i.nl Sat Jul 3 16:25:40 2004 From: artelse at mohr-i.nl (Arthur Elsenaar) Date: Sat Jul 3 16:25:45 2004 Subject: [Pythonmac-SIG] Re: Accessing the USB Ports In-Reply-To: References: Message-ID: <26D5213E-CD2F-11D8-8638-000A95C887F8@mohr-i.nl> On Jul 03, 2004, at 21:47, John W. Baxter wrote: > > On Jul 3, 2004, at 7:00 AM, Benjamin Schollnick wrote: > > Folks, > (@#$@#$@#$ Did it again... Forgot to change my email account in > mail...@#$@$) > > I have been thinking of doing something strange and potentially useful. > > Is there any way to "control" a USB port from MacPython? > > I'm considering actually breaking apart a usb cable and using it as a > rely control, > so I would need to be able to force a line or two high, or low on > demand... > > Heck sending real data through the USB port might be helpful too.... > > Any ideas? > > Cross platform Windows/Linux/Mac would be best, but..... hmm, why do you want to do that, why not buy a cheap USB<->Serial (or parallel) chip? FTDI has one with drivers for different platforms (windows, mac os x, linux?). So you can just treat it as a serial port, which is much more convenient. If you need pointers to websites, let me know. Arthur From schiffo2000 at yahoo.com Sun Jul 4 07:39:37 2004 From: schiffo2000 at yahoo.com (Barry Schiffman) Date: Sun Jul 4 07:39:40 2004 Subject: [Pythonmac-SIG] IDE, IDLE, extras fail on 10.2.8 Message-ID: <20040704113937.75516.qmail@web51406.mail.yahoo.com> I'd be grateful for some insight into a problem getting IDLE and the IDE to work. I'm new to the Mac OS, but have access to a dual G4 running 10.2.8. I installed Macpython2.3, and then the extras, so that I now have Apple's python along with Macpython2.3. None of the extras, IDLE, the IDE, the PackageManager works. From the finder, they all quit immediately after starting. In addition, in hopes of getting Tkinter, I tried to install Apple's Tk, but the installer tells me the version requires 10.3 and the owner of the machine doesn't want to upgrade to 10.3. Is it a matter of recompiling or is there an older version around? Anyway, about IDE, the error message in the Console log was this: Jul 3 16:24:31 DualG4 WindowServer[5402]: ERROR! execle(/Applications/MacPython-2.3/PythonIDE.app/Contents/MacOS/PythonIDE) returned, err=22 And when run with os.system in the interpreter, I get this: sh: /Applications/MacPython-2.3/PythonIDE.app/Contents/MacOS/PythonIDE: /System/Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/: bad interpreter: No such file or directory 3225 Barry __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail From markus at neffster.de Sun Jul 4 12:06:59 2004 From: markus at neffster.de (Markus Neff) Date: Sun Jul 4 12:08:01 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 Message-ID: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> Hi dear Pythonmac-SIG mailing list readers, I just compiled a framework build of Python 2.3.4 on Mac OS X 10.3.4. As far as I can tell, everything works fine except for the Package Manager. The GUI version shows the following message: ----------------------------------------------- 8< ------------------------------------------- Unspecified error while parsing database: http:// www.python.org/packman/version-0.4/prod-2.3- darwin_macpython-7-Power_Macintosh.plist Usually, this means the database is not correctly formatted. See MacPython Package Manager help page. ----------------------------------------------- 8< ------------------------------------------- When starting "pimp.py -l" in the terminal, I get the following messages: ----------------------------------------------- 8< ------------------------------------------- File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/pimp.py", line 1044, in ? main() File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/pimp.py", line 1024, in main _run(mode, verbose, force, args, prefargs) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/pimp.py", line 890, in _run db.appendURL(prefs.pimpDatabase) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/pimp.py", line 323, in appendURL self.appendURL(url, included=1) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/pimp.py", line 323, in appendURL self.appendURL(url, included=1) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/pimp.py", line 304, in appendURL dict = plistlib.Plist.fromFile(fp) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/plistlib.py", line 212, in fromFile plist = p.parse(pathOrFile) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/plistlib.py", line 303, in parse parser.ParseFile(file) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/plistlib.py", line 310, in handleBeginElement handler(attrs) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/plistlib.py", line 346, in begin_dict self.addObject(d) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ plat-mac/plistlib.py", line 322, in addObject self.stack[-1][self.currentKey] = value TypeError: list indices must be integers ----------------------------------------------- 8< ------------------------------------------- Any ideas about that ? Thanks for any help in advance, Markus From bscholl1 at rochester.rr.com Fri Jul 2 20:39:53 2004 From: bscholl1 at rochester.rr.com (Benjamin Schollnick) Date: Sun Jul 4 15:02:48 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: References: Message-ID: <7FF7A08C-CC89-11D8-86A8-000A9597110A@rochester.rr.com> Folks, I know I asked about this before... But... The following script will crash the finder, in a repeatable manner.... After, roughly, only .... four thousand and twenty five findertools.move's, the finder will crash.... This finder crash also seems to take down Safari if it is running.... (No other applications, just the Finder and Safari... Actually, technically the finder is running... But you have the spinning pizza wheel, and your only recourse is to relaunch the finder.... Also... I can't find the directory that findertools or EasyDialogs is now stored in.... I am running on 10.3.4, and this has happened for a long time... I never thought to see if it is reproducable or consistent.... - Benjamin Btw-> If anyone asks, this is usually run on my download directory... Well, actually a different script is run on my download directory to "clean it up", and make subdirectories, and move files. I just changed the way that script works, so I need to "remove" the old subdirectories and have it process them again... So I whipped this up... ----------------------------------------------------------------------- #!python import sys import os from bas_common import * mac_mode = macintosh if mac_mode: import macostools import findertools # import macfs import EasyDialogs def move_file ( old_path, new_path, filename ): # print "old: ",old_path # print "new:",new_path # print "filename:",filename # print "old + file:", old_path + os.sep + filename if os.path.exists (new_path + os.sep + filename): Ask = EasyDialogs.AskYesNoCancel("Duplicate File Detected (%s), Overwrite?" % filename, default = 1, yes=None, no=None, cancel=None, id=262) if Ask == 1: if mac_mode: # Overwrite, by removing the old file # os.remove(new_path + os.sep + filename) elif Ask == 0: # # Do not overwrite, end routine, by returning # return 0 elif Ask == -1: # # Abort program, return error code # return -1 if mac_mode: findertools.move (old_path + os.sep + filename, new_path) return None if len(sys.argv) < 1: print "Aborted...." sys.exit(5) sources = EasyDialogs.AskFolder ( message="Please choose a folder to process") print sources sources = sources.strip() print sources found = os.listdir ( sources ) if found == None or found =="": print "No directory selected." sys.exit(5) number_of_entries = len(found) count = 0 for j in found: new_directory = sources + os.sep + j if os.path.isdir ( new_directory ): files = os.listdir ( new_directory ) if len(files) > 1: print "\n",new_directory for x in files: if x.upper() == ".DS_STORE": pass else: print " ",count," ", #print new_directory, " ", sources, " ", x move_file ( new_directory, sources, x)#, new_dir, filename ) count = count +1 print ".", ----------------------------------------------------------------------- From bscholl1 at rochester.rr.com Sat Jul 3 07:00:56 2004 From: bscholl1 at rochester.rr.com (Benjamin Schollnick) Date: Sun Jul 4 15:02:52 2004 Subject: [Pythonmac-SIG] Accessing the USB Ports In-Reply-To: References: Message-ID: <427A40A8-CCE0-11D8-841D-000A9597110A@rochester.rr.com> Folks, I have been thinking of doing something strange and potentially useful. Is there any way to "control" a USB port from MacPython? I'm considering actually breaking apart a usb cable and using it as a rely control, so I would need to be able to force a line or two high, or low on demand... Heck sending real data through the USB port might be helpful too.... Any ideas? Cross platform Windows/Linux/Mac would be best, but..... - Benjamin From bob at redivi.com Sun Jul 4 15:27:56 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Jul 4 15:28:37 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: <7FF7A08C-CC89-11D8-86A8-000A9597110A@rochester.rr.com> References: <7FF7A08C-CC89-11D8-86A8-000A9597110A@rochester.rr.com> Message-ID: <41179282-CDF0-11D8-96F6-000A95686CD8@redivi.com> On Jul 2, 2004, at 5:39 PM, Benjamin Schollnick wrote: > After, roughly, only .... four thousand and twenty > five findertools.move's, the finder will crash.... Have you tried using shutil.move instead? It's probably a whole heck of a lot faster anyway (though there's a chance it might not preserve resource forks). Finder won't immediately acknowledge that the files have moved, but it will eventually figure it out... probably in less time than if you used findertools.move in the first place. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040704/ccd5d7e0/smime.bin From Jack.Jansen at cwi.nl Sun Jul 4 15:45:04 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun Jul 4 15:44:51 2004 Subject: [Pythonmac-SIG] IDE, IDLE, extras fail on 10.2.8 In-Reply-To: <20040704113937.75516.qmail@web51406.mail.yahoo.com> References: <20040704113937.75516.qmail@web51406.mail.yahoo.com> Message-ID: On 4 Jul 2004, at 13:39, Barry Schiffman wrote: > I'd be grateful for some insight into a problem > getting IDLE and the IDE to work. I'm new to the Mac > OS, but have access to a dual G4 running 10.2.8. > > I installed Macpython2.3, and then the extras, so that > I now have Apple's python along with Macpython2.3. I think your problem is that you installed the extras on 10.2.8. The Extras are for 10.3 only: Apple-supplied 10.3 Python plus the extras more-or-less matches MacPython 2.3 on MacOSX 10.2. I thought the installer for the extras had an explicit check that it only installed on 10.3, but maybe that somehow didn't work (or did it print a warning that you ignored, maybe?). Anyway, this is fairly easy to fix: - Remove /Library/Frameworks/Python.framework - Remove /Applications/MacPython-2.3 - Re-install MacPython 2.3 for Jaguar. Now, the IDE and Package Manager should work (If not: report back here with the error you get). Now youu can use the Package Manager to install IDLE, if you want it. You'll get an obscure error message about TclTkAqua, if you select the "show hidden packages" checkmark you'll see this package, select it, and the description should tell you where to download TclTkAqua for 10.2. -- 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 Sun Jul 4 15:49:23 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun Jul 4 15:49:06 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 In-Reply-To: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> References: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> Message-ID: <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> On 4 Jul 2004, at 18:06, Markus Neff wrote: > Hi dear Pythonmac-SIG mailing list readers, > > I just compiled a framework build of Python 2.3.4 on Mac OS X 10.3.4. > As far as I can tell, everything works fine except for the > Package Manager. The GUI version shows the following message: > > ----------------------------------------------- 8< > ------------------------------------------- > Unspecified error while parsing database: http:// > www.python.org/packman/version-0.4/prod-2.3- > darwin_macpython-7-Power_Macintosh.plist > Usually, this means the database is not correctly > formatted. Purely by accident you've started debugging the, yet unreleased, version 0.4 of Package Manager. It worked for me when I created it a few months ago, but apparently something broke in the mean time. I will investigate. -- 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 Sun Jul 4 16:00:37 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun Jul 4 16:00:23 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: References: Message-ID: On 3 Jul 2004, at 12:22, Benjamin Schollnick wrote: > After, roughly, only .... four thousand and twenty > five findertools.move's, the finder will crash.... I can think of two things you may want to investigate: 1. Is it always the same file (or filename) that causes the problem? Should be easy to test by, say, removing the first folder that would normally be processed 2. You're running out of some resource, probably a resource of which there are 4095 and 70 are already tied up to other purposes. After 4000 files, go into a long sleep(). Start up Activity Monitor, select the Finder and use the Inspect command to check whether it has 4000 files open or something. The same for 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 Jack.Jansen at cwi.nl Sun Jul 4 17:35:22 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun Jul 4 17:35:12 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 In-Reply-To: <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> References: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> Message-ID: <0DBD1A8C-CE02-11D8-A058-000D934FF6B4@cwi.nl> On 4 Jul 2004, at 21:49, Jack Jansen wrote: >> I just compiled a framework build of Python 2.3.4 on Mac OS X 10.3.4. >> As far as I can tell, everything works fine except for the >> Package Manager. > Purely by accident you've started debugging the, yet unreleased, > version 0.4 of Package Manager. It worked for me when I created it a > few months ago, but apparently something broke in the mean time. I > will investigate. This turned out to be a stupid bug in the database. It is fixed now, please try again. And, as you're one of the first people trying PackMan 0.4, please let me know the results:-) -- 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 junkster at rochester.rr.com Sun Jul 4 22:44:34 2004 From: junkster at rochester.rr.com (Benjamin Schollnick) Date: Sun Jul 4 22:44:45 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: References: Message-ID: <3F9B6010-CE2D-11D8-A3BD-000A9597110A@rochester.rr.com> On Jul 4, 2004, at 4:00 PM, Jack Jansen wrote: > > On 3 Jul 2004, at 12:22, Benjamin Schollnick wrote: > >> After, roughly, only .... four thousand and twenty >> five findertools.move's, the finder will crash.... > > I can think of two things you may want to investigate: > 1. Is it always the same file (or filename) that causes the problem? > Should be easy to test by, say, removing the first folder that would > normally be processed Nope.... It does not matter the filename, nor the location.... If you move roughly 4000+ files, expect the finder to "lock"... > 2. You're running out of some resource, probably a resource of which > there are 4095 and 70 are already tied up to other purposes. After > 4000 files, go into a long sleep(). Start up Activity Monitor, select > the Finder and use the Inspect command to check whether it has 4000 > files open or something. The same for Python. What I have discovered since then... 1) It does not have to be a single execution. Move 2500, wait 5 minutes, move another 1500, and expect problems... This will occur even after the program has exited. (i.e. Run Program A, move 2500. A closes.. Wait 15 minutes.. Run A again. Or Execute B, etc. 2) I am not sure what I am looking for in the Activity monitor... a) File Opens, does not list any of the files that I am moving. b) Finder starts with roughly 4.x MB of Private memory size. This will eventually move to be roughly 16.69 MB. c) After the lock up, the Finder starts are: 1) Real Memory Size: 29.73M --- New Finder ~13.61 2) Shared Memory : 36.44Mb --- New Finder ~ 32.51 3) Private Memory Size: 16.69 Mb --- New Finder ~3.50 4) Virtual Private Memory : 26.80 Mb --- New Finder ~ 28.90 5) Faults: 74341 (???? What's this? Page Faults?) --- New 6746 6) Page Ins: 129 --- New : 0 7) Ports : 7303 (???) --- New : 91 8) Context Switchs : 85323 --- New : 1225 (New / New Finder, means reading taken against the new finder (i.e. starting stats). 3) Sample will not work against the finder after the lock up happens. - Ben From garymakin at mac.com Mon Jul 5 01:44:18 2004 From: garymakin at mac.com (Gary Makin) Date: Mon Jul 5 01:44:23 2004 Subject: [Pythonmac-SIG] Saving preferences Message-ID: <40E8EAB2.10301@mac.com> Hi, I've done a search on the web and in this list's archives but can't find the answer to this. Without hard coding the path, how can I get access to the equivalent of the CFPreference API? Thanks, Gary From bob at redivi.com Mon Jul 5 06:12:13 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Jul 5 06:12:23 2004 Subject: [Pythonmac-SIG] Saving preferences In-Reply-To: <40E8EAB2.10301@mac.com> References: <40E8EAB2.10301@mac.com> Message-ID: On Jul 4, 2004, at 10:44 PM, Gary Makin wrote: > I've done a search on the web and in this list's archives but can't > find > the answer to this. > > Without hard coding the path, how can I get access to the equivalent of > the CFPreference API? Use PyObjC and the NSUserDefaults API instead. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040705/ca4c450b/smime.bin From schiffo2000 at yahoo.com Mon Jul 5 11:35:24 2004 From: schiffo2000 at yahoo.com (Barry Schiffman) Date: Mon Jul 5 11:35:28 2004 Subject: [Pythonmac-SIG] IDE, IDLE, extras fail on 10.2.8 In-Reply-To: Message-ID: <20040705153524.76645.qmail@web51410.mail.yahoo.com> --- Jack Jansen wrote: > > On 4 Jul 2004, at 13:39, Barry Schiffman wrote: > > > I'd be grateful for some insight into a problem > > getting IDLE and the IDE to work. I'm new to the > Mac > > OS, but have access to a dual G4 running 10.2.8. > > > > I installed Macpython2.3, and then the extras, so > that > > I now have Apple's python along with Macpython2.3. > > I think your problem is that you installed the > extras on 10.2.8. The > Extras are for 10.3 only: Apple-supplied 10.3 Python > plus the extras > more-or-less matches MacPython 2.3 on MacOSX 10.2. I > thought the > installer for the extras had an explicit check that > it only installed > on 10.3, but maybe that somehow didn't work (or did > it print a warning > that you ignored, maybe?). > > Anyway, this is fairly easy to fix: > - Remove /Library/Frameworks/Python.framework > - Remove /Applications/MacPython-2.3 > - Re-install MacPython 2.3 for Jaguar. > > Now, the IDE and Package Manager should work (If > not: report back here > with the error you get). Now youu can use the > Package Manager to > install IDLE, if you want it. You'll get an obscure > error message about > TclTkAqua, if you select the "show hidden packages" > checkmark you'll > see this package, select it, and the description > should tell you where > to download TclTkAqua for 10.2. > -- > Jack Jansen, , > http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your > revolution -- Emma > Goldman > > Many thanks. That did the trick. I think I did ignore the warning on the installer for the extras, not a smart thing on unfamiliar systems. __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail From mailinglists at garagecube.com Mon Jul 5 13:04:18 2004 From: mailinglists at garagecube.com (Yves Schmid) Date: Mon Jul 5 13:04:25 2004 Subject: [Pythonmac-SIG] Python library cannot be found Message-ID: <5A39C930-CEA5-11D8-863C-000393D6B24A@garagecube.com> Hello! We just released an application for MacOSX called Modul8 that uses Python for all its internal scripting (and Python is really GREAT!). We directly linked the library to the application. Modu8 works only on MacOS 10.3, so we can assume that Python 2.3 is here. Unfortunately, we have a few users who receive the following message in the console when they launch Modul8: dyld: /Applications/Modul8Demo/Modul8.app/Contents/MacOS/Modul8 can't open library: /System/Library/Frameworks/Python.framework/Versions/2.3/Python (No such file or directory, errno = 2) I talked with a user and he said that the python library was effectively at the right place in his system (see http://www.garagecube.com/forum in the support section to see the discussion with the users). I really don't understand what's going on here... Especially because it's happening only with a few users... I did not find a workaround at this time and I was wondering if anybody would have a clue ? Is there something special to do when linking the library to the application to be sure ? Thanks a lot! Yves Schmid * GarageCUBE -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1167 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040705/612f37ba/attachment.bin From bob at redivi.com Mon Jul 5 13:20:14 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Jul 5 13:20:21 2004 Subject: [Pythonmac-SIG] Python library cannot be found In-Reply-To: <5A39C930-CEA5-11D8-863C-000393D6B24A@garagecube.com> References: <5A39C930-CEA5-11D8-863C-000393D6B24A@garagecube.com> Message-ID: <9428A93C-CEA7-11D8-B206-000A95686CD8@redivi.com> On Jul 5, 2004, at 1:04 PM, Yves Schmid wrote: > We just released an application for MacOSX called Modul8 that uses > Python for all its internal scripting (and Python is really GREAT!). > We directly linked the library to the application. Modu8 works only on > MacOS 10.3, so we can assume that Python 2.3 is here. > > Unfortunately, we have a few users who receive the following message > in the console when they launch Modul8: > > dyld: /Applications/Modul8Demo/Modul8.app/Contents/MacOS/Modul8 can't > open library: > /System/Library/Frameworks/Python.framework/Versions/2.3/Python (No > such file or directory, errno = 2) > > I talked with a user and he said that the python library was > effectively at the right place in his system (see > http://www.garagecube.com/forum in the support section to see the > discussion with the users). > > I really don't understand what's going on here... Especially because > it's happening only with a few users... I did not find a workaround at > this time and I was wondering if anybody would have a clue ? Is there > something special to do when linking the library to the application to > be sure ? You'll see this if they've deleted it somehow, or if they didn't install the "optional" BSD subsystem. The BSD subsystem is installed by default, but I guess some users like to cause themselves pain. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040705/da1706d4/smime.bin From hengist.podd at virgin.net Mon Jul 5 08:03:30 2004 From: hengist.podd at virgin.net (has) Date: Mon Jul 5 13:24:00 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... Message-ID: Bob Ippolito wrote: >Have you tried using shutil.move instead? It's probably a whole heck >of a lot faster anyway (though there's a chance it might not preserve >resource forks). shutil.__doc__ says it doesn't. Consider using ditto instead. has -- http://freespace.virgin.net/hamish.sanderson/ From bob at redivi.com Mon Jul 5 13:31:32 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon Jul 5 13:31:40 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: References: Message-ID: <27FACF95-CEA9-11D8-B206-000A95686CD8@redivi.com> On Jul 5, 2004, at 8:03 AM, has wrote: > Bob Ippolito wrote: > >> Have you tried using shutil.move instead? It's probably a whole heck >> of a lot faster anyway (though there's a chance it might not preserve >> resource forks). > > shutil.__doc__ says it doesn't. Consider using ditto instead. If it's on the same volume, it will rename and that should preserve the resource fork. In the copy case, it's probably MUCH MUCH less painful to just change the implementation to also copy resource forks than it is to spawn ditto and have it copy regardless of destination volume. Thousands and thousands of useless copies isn't a good thing to do if you don't need to, because it's really slow and it makes it a whole heck of a lot more likely that you will run out of disk space during the operation. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040705/0d280bb6/smime.bin From berkowit at silcom.com Mon Jul 5 13:34:17 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Mon Jul 5 13:34:24 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: Message-ID: On 7/5/04 5:03 AM, "has" wrote: > Bob Ippolito wrote: > >> Have you tried using shutil.move instead? It's probably a whole heck >> of a lot faster anyway (though there's a chance it might not preserve >> resource forks). > > shutil.__doc__ says it doesn't. Consider using ditto instead. ditto -rsrc It needs the -rsrc option (or -rsrcFork, same thing), but works on all OS X Macs without any need for Developer Tools (such as CpMac and MvMac require). -- Paul Berkowitz From hengist.podd at virgin.net Mon Jul 5 13:46:13 2004 From: hengist.podd at virgin.net (has) Date: Mon Jul 5 13:46:23 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... Message-ID: Bob Ippolito wrote: > >> Have you tried using shutil.move instead? It's probably a whole heck > >> of a lot faster anyway (though there's a chance it might not preserve > >> resource forks). > > > > shutil.__doc__ says it doesn't. Consider using ditto instead. > >If it's on the same volume, it will rename and that should preserve the >resource fork. In the copy case, it's probably MUCH MUCH less painful >to just change the implementation to also copy resource forks than it >is to spawn ditto and have it copy regardless of destination volume. >Thousands and thousands of useless copies isn't a good thing to do if >you don't need to, because it's really slow and it makes it a whole >heck of a lot more likely that you will run out of disk space during >the operation. Just quoting the shutil docs. :) While ditto+rm are slow, they will do the job. But yeah, I agree that patching shutil to handle Mac files correctly in all cases would be the best [long-term] solution. (It'd also allow findertools to be dropped; no bad thing.) has -- http://freespace.virgin.net/hamish.sanderson/ From gandreas at delver.com Mon Jul 5 15:09:57 2004 From: gandreas at delver.com (Glenn Andreas) Date: Mon Jul 5 15:11:16 2004 Subject: [Pythonmac-SIG] Matlab-like IDE In-Reply-To: References: Message-ID: At 6:55 PM -0400 7/1/04, Carlo Mattoni wrote: >On Thu, 1 Jul 2004, gandreas wrote: > >> You can also modify the values of the local variables in the debugger >> (and this works for both internally running and externally running >> scripts) but you can't yet execute arbitrary code. Adding this >> shouldn't be too hard, however. > >The ability to execute arbitrary code while stopped in the debugger is >exactly what I am looking for and if you can add it to pyOXIDE relatively >easily that would be tremendous. Ideally one would have access to a >"python interactive" window whenever the debugger is stopped and be able >to execute commands, look at results, etc. from within that shell. It's now implemented and will be in the next release of PyOXIDE - there is a "console" drawer that appears in the debugger (like XCode) which executes code in the context of the currently selected frame (it may not update the UI correctly, and I've yet to get it working for remote debugging, but it works reasonably well for local debugging). Other changes are going to mostly be resolving some build problems, getting the "folded" image to be use correctly (instead of the "document" icon), the "correct" (XCode like) completion UI (which broke somehow), application preferences (which also broke) and I'm also planning on cleaning up and extending the "code snippet" menu. (It's amazing how many problems you can find when you do a clean install of your app on a machine other than the one it was built on). I'm hoping to add support for external editors as well (so you can edit your python code in BBEdit if you really want), but that may not make this release. -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From jwblist at olympus.net Mon Jul 5 22:17:22 2004 From: jwblist at olympus.net (John W. Baxter) Date: Tue Jul 6 03:01:07 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: Message-ID: On 7/5/2004 10:46, "has" wrote: > Bob Ippolito wrote: > >>>> Have you tried using shutil.move instead? It's probably a whole heck >>>> of a lot faster anyway (though there's a chance it might not preserve >>>> resource forks). >>> >>> shutil.__doc__ says it doesn't. Consider using ditto instead. >> >> If it's on the same volume, it will rename and that should preserve the >> resource fork. In the copy case, it's probably MUCH MUCH less painful >> to just change the implementation to also copy resource forks than it >> is to spawn ditto and have it copy regardless of destination volume. >> Thousands and thousands of useless copies isn't a good thing to do if >> you don't need to, because it's really slow and it makes it a whole >> heck of a lot more likely that you will run out of disk space during >> the operation. > > Just quoting the shutil docs. :) While ditto+rm are slow, they will > do the job. But yeah, I agree that patching shutil to handle Mac > files correctly in all cases would be the best [long-term] solution. > (It'd also allow findertools to be dropped; no bad thing.) It seems to me that I remember that "cp is modified to preserve resource forks [in Tiger]" emerged from WWDC. If cp is modified, that fixes mv (which uses cp when it needs to copy). Given that (if I am correct), I think I would use ditto pre-Tiger, and mv starting with Tiger. --John From markus at neffster.de Tue Jul 6 00:05:18 2004 From: markus at neffster.de (Markus Neff) Date: Tue Jul 6 04:51:08 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 In-Reply-To: <0DBD1A8C-CE02-11D8-A058-000D934FF6B4@cwi.nl> References: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> <0DBD1A8C-CE02-11D8-A058-000D934FF6B4@cwi.nl> Message-ID: <66D63C42-CECF-11D8-8637-000A95DE13C4@neffster.de> Am 04.07.2004 um 23:35 schrieb Jack Jansen: > > On 4 Jul 2004, at 21:49, Jack Jansen wrote: > >>> I just compiled a framework build of Python 2.3.4 on Mac OS X 10.3.4. >>> As far as I can tell, everything works fine except for the >>> Package Manager. >> Purely by accident you've started debugging the, yet unreleased, >> version 0.4 of Package Manager. It worked for me when I created it a >> few months ago, but apparently something broke in the mean time. I >> will investigate. > This turned out to be a stupid bug in the database. It is fixed now, > please try again. > > And, as you're one of the first people trying PackMan 0.4, please let > me know the results:-) Hi Jack ! I just tried the GUI Package manager and pimp.py and both seem as they would work now. Before I go on, please allow one further question: is it possible to install the listed binary packages into any Python 2.3.x version (binary compatibility)? Thanks a lot and best wishes, Markus From hengist.podd at virgin.net Tue Jul 6 12:27:24 2004 From: hengist.podd at virgin.net (has) Date: Tue Jul 6 12:28:38 2004 Subject: [Pythonmac-SIG] improving appscript architecture Message-ID: Hi all, In the process of rearchitecting appscript as a set of reasonably decoupled packages that can be recombined to suit different uses. Here's what I've got so far: http://freespace.virgin.net/hamish.sanderson/APPSCRIPT2.sit This contains the following packages: - aecodecs -- convert Python data to and from AEDescs - objspec -- extends aecodecs with support for constructing object specifiers using raw AE codes, e.g. app.elems('docu').byindex(1).prop('ctxt') - osaterms -- application terminology (aete) parser, plus related tools for rendering aete data to constants and documentation - aeconstants -- used for storing modules similar to Carbon.AppleEvents constants generated by osaterms.tools.constantsgenerator; may be used in conjunction with objspec - AEM -- creates AEAddressDescs and sends Apple events - aslite -- 'appscript lite' - extends objspec to allow object specifiers to be constructed using application terminology, e.g. app('/Applications/TextEdit.app').documents[1].text The problem I've currently got is with extending the objspec.specifier module to add new behaviours to the various classes representing object specifiers. There's a lot of composition needed, and it's leading to some pretty gnarly inheritance relationships. e.g. Look at the objspec.filter module which extends the specifier classes with comparison and logical 'operators' for constructing filter clauses. I think this one is just about possible to follow. With the aslite.specifierplus module - which extends specifier objects with support for appscript-style reference - things are starting to feel decidedly spaghetti-ish, and can only get worse from there. (e.g. I've yet to create a third tier that adds in the sanity-checking/constraints and help features that are built into appscript 0.5.0. And as for adding hooks to a future PythonScripting framework so it can be used in AE server applications... ahhh. Nips ma heid just tae think aboot it.) I suspect what I really want is mixins or a nice prototype-based OO scheme, but Python doesn't have native support for either. (There are days I really get frustrated by Python's object system, which is both too complex and too inflexible, and this is definitely one of them.) I could perhaps rig something myself, or I could maybe use metaclasses to provide an API that can mix behaviours according to recipe to create the required modules, or perhaps some sort of facade+delegation scheme using __getattr__, or maybe something else I haven't thought of like turning the whole problem over to a source code generator. Given this code needs to be simple, efficient, maintainable and extensible - and [ideally] serve as a pattern for folk who want to develop similar bridges on other languages - I'm all open to suggestions. Thanks, has -- http://freespace.virgin.net/hamish.sanderson/ From bscholl1 at rochester.rr.com Tue Jul 6 13:56:02 2004 From: bscholl1 at rochester.rr.com (Benjamin Schollnick) Date: Tue Jul 6 13:56:07 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: References: Message-ID: <73E26932-CF43-11D8-8A63-000A9597110A@rochester.rr.com> On Jul 5, 2004, at 8:03 AM, has wrote: > Bob Ippolito wrote: > >> Have you tried using shutil.move instead? It's probably a whole heck >> of a lot faster anyway (though there's a chance it might not preserve >> resource forks). > > shutil.__doc__ says it doesn't. Consider using ditto instead. I can see these as a work around. But my major issue is after XXXXXX number of copies, Python seems to kill the underlying OS. Maybe this is a memory leak from a Applescript "engine" issue, or something.... So it may not be Python's fault... But we need to fix it... Or inform Apple to fix it, if it is on their part... My real request is to help isolate this, so that I can file a bug report with Apple... Shelling to the OS and using Ditto, cp, or cpmac really does not solve the problem, it hides it... - Benjamin From mario at ruggier.org Tue Jul 6 18:36:55 2004 From: mario at ruggier.org (Mario Ruggier) Date: Tue Jul 6 18:36:49 2004 Subject: [Pythonmac-SIG] Re: [Pysqlite-users] Looking for somebody to package Mac binaries In-Reply-To: <40EAB68E.40501@ghaering.de> References: <40EAB68E.40501@ghaering.de> Message-ID: Hi, I am on an OS X machine, and, should no-one else wish to do it, I wouldn't mind to roll a new package every now and then with new stable releases. I am not sure of what the gotchas for this might be... Could anyone on the pythonmac-sig list point me to a good step-by-step procedure and checklist for creating Mac packages? However, as of this weekend I am away for 2 weeks... Mario On Jul 6, 2004, at 4:26 PM, Gerhard H?ring wrote: > I don't know much about Macs, so I don't know if that's really > practibable. > > But I think it would be nice if there were prebuilt binaries for MacOS > X, just as there are for win32. > > If this is useful, is there anybody on this list who would like to do > the MacOS X building & packaging? > > I don't have access to a Mac myself. > > -- Gerhard From hengist.podd at virgin.net Tue Jul 6 17:59:15 2004 From: hengist.podd at virgin.net (has) Date: Tue Jul 6 19:19:00 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... Message-ID: Benjamin Schollnick wrote: >my major issue is after XXXXXX number of copies, Python seems to >kill the underlying OS. > >Maybe this is a memory leak from a Applescript "engine" issue findertools hooks into the Apple Event Manager via aetools, so can't be anything related to AppleScript. >My real request is to help isolate this, so that I can file a bug report >with Apple... Suggest you start by narrowing down your code to a simple test script that demonstrates the bug in isolation. Then see if you can replicate it using AppleScript and appscript. e.g. I'm unable to cause a crashing bug with either of the following on OS10.2.8 + MacPython 2.3.3: from findertools import move for _ in range(3000): # 6000 moves move('/Users/has/TEST/f1/foobar.py', '/Users/has/TEST/f2/') move('/Users/has/TEST/f2/foobar.py', '/Users/has/TEST/f1/') tell application "Finder" repeat 3000 times -- 6000 moves move file "foobar.py" of alias "Macintosh HD:Users:has:TEST:f1:" to alias "Macintosh HD:Users:has:TEST:f2:" move file "foobar.py" of alias "Macintosh HD:Users:has:TEST:f2:" to alias "Macintosh HD:Users:has:TEST:f1:" end repeat end tell If one or both of these (with paths modified to suit) can trigger the crash on your machine, that'll be a start. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From hengist.podd at virgin.net Tue Jul 6 17:59:15 2004 From: hengist.podd at virgin.net (has) Date: Tue Jul 6 19:51:16 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... Message-ID: Benjamin Schollnick wrote: >my major issue is after XXXXXX number of copies, Python seems to >kill the underlying OS. > >Maybe this is a memory leak from a Applescript "engine" issue findertools hooks into the Apple Event Manager via aetools, so can't be anything related to AppleScript. >My real request is to help isolate this, so that I can file a bug report >with Apple... Suggest you start by narrowing down your code to a simple test script that demonstrates the bug in isolation. Then see if you can replicate it using AppleScript and appscript. e.g. I'm unable to cause a crashing bug with either of the following on OS10.2.8 + MacPython 2.3.3: from findertools import move for _ in range(3000): # 6000 moves move('/Users/has/TEST/f1/foobar.py', '/Users/has/TEST/f2/') move('/Users/has/TEST/f2/foobar.py', '/Users/has/TEST/f1/') tell application "Finder" repeat 3000 times -- 6000 moves move file "foobar.py" of alias "Macintosh HD:Users:has:TEST:f1:" to alias "Macintosh HD:Users:has:TEST:f2:" move file "foobar.py" of alias "Macintosh HD:Users:has:TEST:f2:" to alias "Macintosh HD:Users:has:TEST:f1:" end repeat end tell If one or both of these (with paths modified to suit) can trigger the crash on your machine, that'll be a start. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From Jack.Jansen at cwi.nl Tue Jul 6 22:55:50 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Jul 6 22:55:27 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 In-Reply-To: <66D63C42-CECF-11D8-8637-000A95DE13C4@neffster.de> References: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> <0DBD1A8C-CE02-11D8-A058-000D934FF6B4@cwi.nl> <66D63C42-CECF-11D8-8637-000A95DE13C4@neffster.de> Message-ID: On 6 Jul 2004, at 00:05, Markus Neff wrote: > I just tried the GUI Package manager and pimp.py and both seem as they > would work now. Before I go on, please allow one further question: is > it possible to install the listed binary packages into any Python > 2.3.x version (binary compatibility)? That is definitely the intention of Python micro-releases, so if this isn't the case please let me know. -- 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 Jul 6 23:14:37 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Jul 6 23:14:49 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 In-Reply-To: References: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> <0DBD1A8C-CE02-11D8-A058-000D934FF6B4@cwi.nl> <66D63C42-CECF-11D8-8637-000A95DE13C4@neffster.de> Message-ID: <7CFAD676-CF91-11D8-B206-000A95686CD8@redivi.com> On Jul 6, 2004, at 4:55 PM, Jack Jansen wrote: > > On 6 Jul 2004, at 00:05, Markus Neff wrote: >> I just tried the GUI Package manager and pimp.py and both seem as >> they would work now. Before I go on, please allow one further >> question: is it possible to install the listed binary packages into >> any Python 2.3.x version (binary compatibility)? > > That is definitely the intention of Python micro-releases, so if this > isn't the case please let me know. But it isn't necessarily the case. Each .so will have a mach-o load command pointing to some particular Python path, except when using the -undefined dynamic_lookup linker flag on 10.3. Has that linking style been backported to any 2.3.x release? The .so's can be rewritten using macholib or install_name_tool, but that is not guaranteed to work because in rare situations there is not enough space left in the header to change the path name. I've never actually seen that edge case myself, but I know it's possible and I've heard that other people have ran into it. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040706/4cbecafe/smime.bin From Jack.Jansen at cwi.nl Tue Jul 6 23:19:17 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Jul 6 23:19:00 2004 Subject: [Pythonmac-SIG] Re: [Pysqlite-users] Looking for somebody to package Mac binaries In-Reply-To: References: <40EAB68E.40501@ghaering.de> Message-ID: <2347EEA0-CF92-11D8-9C91-000D934FF6B4@cwi.nl> On 6 Jul 2004, at 18:36, Mario Ruggier wrote: > Hi, I am on an OS X machine, and, should no-one else wish to do it, I > wouldn't mind to roll a new package every now and then with new stable > releases. I am not sure of what the gotchas for this might be... Could > anyone on the pythonmac-sig list point me to a good step-by-step > procedure and checklist for creating Mac packages? Here is my procedure. Bob uses a different one for his PackMan database, but I prefer mine because it also makes source packages available, which I think is a good way to ease people into developing their own packages, and it simplifies maintenance when new versions become available. But it does require the package to be distutils-based (although there are ways to do non-distutils things too, see PIL for an example). First, create an experimental PackMan database for yourself. The easiest is to copy my experimental database and clean it out (if it isn't empty already). Leave the include statement for the default database in, as this allows you to depend on packages in the default database (especially pseudo-packages for Python version, etc). The database is a plist file. There's no documentation on the keys used, but if they're not self-explanatory check Lib/plat-mac/pimp.py for the details. Now start with a source distribution for your package. Pick an entry from the default database that appears to be somewhat similar to what you're doing. Modify the name, version, description, install-check, download-url and dependency fields to suit your package. Comment out the MD5 checksum for now. Fiddle it until at least the download works (the tarfile will end up in /tmp). Compute the md5 sum for the tarfile (Tools/scripts/md5sum.py in a Python source distribution does this) and put it in the database. Fiddle the install command and install check until they work. Now your source package is finished. Next create the binary installer. Go to the build directory for the package that was used for the previous install from source, again in /tmp. Run "python setup.py bdist-dumb" there, this creates a binary distribution tarfile (in the "dist" subdirectory). Compute the md5sum of this tarfile. Upload it to your webserver.\ Finally create the binary PackMan package. Start with the source package, change the URL, flavor and md5sum. Now you should be done. Advertise your new database, at the very least by letting me know so I can put it on the PackMan database page . If it turns out to be really popular let me know and I'll put it in the official database. Finally finally let me know where I forgot essential information in this description:-) -- 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 Tue Jul 6 23:23:45 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Jul 6 23:23:23 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: <73E26932-CF43-11D8-8A63-000A9597110A@rochester.rr.com> References: <73E26932-CF43-11D8-8A63-000A9597110A@rochester.rr.com> Message-ID: On 6 Jul 2004, at 13:56, Benjamin Schollnick wrote: > But my major issue is after XXXXXX number of copies, Python seems to > kill the underlying OS. > > Maybe this is a memory leak from a Applescript "engine" issue, or > something.... So it may not be Python's fault... > > But we need to fix it... Or inform Apple to fix it, if it is on their > part... > > My real request is to help isolate this, so that I can file a bug > report > with Apple... Ok, you asked for it. Here's how you can get Python out of the loop: in stead of actually doing the move with findertools, let your Python script create an AppleScript that will do the actual moves: on stdout (or another file) print lines of the form "move XXXX to YYYY", put a 'tell application "Finder"' at the top and 'end tell' at the bottom. Open this is Script Editor and run it, and see whether it also freezes the finder after 4000 moves. -- 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 berkowit at silcom.com Tue Jul 6 23:49:18 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Tue Jul 6 23:49:22 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: Message-ID: On 7/6/04 2:23 PM, "Jack Jansen" wrote: > Ok, you asked for it. Here's how you can get Python out of the loop: > in stead of actually doing the move with findertools, let your Python > script > create an AppleScript that will do the actual moves: on stdout (or > another > file) print lines of the form "move XXXX to YYYY", put a 'tell > application "Finder"' > at the top and 'end tell' at the bottom. Open this is Script Editor and > run it, and > see whether it also freezes the finder after 4000 moves. If it's an AppleScript in a Finder tell block you'll first have to coerce POSIX file paths to standard colon-delimited AppleScript file paths, then to aliases. In AppleScript that would be: set XXXX to POSIX file XXXX as alias set YYYY to POSIX file YYYY as alias -- YYYY is a directory, not a file spec tell application "Finder" to move XXXX to YYYY -- Paul Berkowitz From gshao1 at san.rr.com Wed Jul 7 00:10:08 2004 From: gshao1 at san.rr.com (Gary Shao) Date: Wed Jul 7 00:08:46 2004 Subject: [Pythonmac-SIG] Re: improving appscript architecture In-Reply-To: <20040706211902.3C3DA1E4017@bag.python.org> References: <20040706211902.3C3DA1E4017@bag.python.org> Message-ID: <40EB2340.3000503@san.rr.com> > I suspect what I really want is mixins or a nice prototype-based OO > scheme, but Python doesn't have native support for either. (There are > days I really get frustrated by Python's object system, which is both > too complex and too inflexible, and this is definitely one of them.) I > could perhaps rig something myself, or I could maybe use metaclasses > to provide an API that can mix behaviours according to recipe to > create the required modules, or perhaps some sort of facade+delegation > scheme using __getattr__, or maybe something else I haven't thought of > like turning the whole problem over to a source code generator. > > Given this code needs to be simple, efficient, maintainable and > extensible - and [ideally] serve as a pattern for folk who want to > develop similar bridges on other languages - I'm all open to suggestions. > Forgive my ignorance, but doesn't Python support mixins? I remembered reading the article found here http://www.linuxjournal.com/article.php?sid=4540 a while back, and it seemed to emphasize the power of Python to employ mixins. What additional capabilities do you require for your application? Gary From israel at sandlotgames.com Wed Jul 7 03:27:14 2004 From: israel at sandlotgames.com (Israel C. Evans) Date: Wed Jul 7 03:26:22 2004 Subject: [Pythonmac-SIG] Scripting iCal :: getting the events of the day? Message-ID: hello good folks. I've recently, under the direction of the wonderful suggestion I received on this list, begun to use appscript to script iCal. One of my main goals with doing so is to extract all the events that happen to occur on any given day. This is turning out to be quite difficult for it seems that the osa dictionary for iCal offers no methods for retrieving said events. Each event has properties which include useful things like startdate and enddate as well as recur which has the ical string of recurrence rules. It's easy to get an event based on the start date or end date, but parsing the diverse and sundry possible combinations of recurrence rules leaves me where I left attempting to parse the .ics manually... lost in the forest. I've been able to activate iCal, move to a particular day and change the view to day view so that I can see the events of that day. If there was a way to select the events "visually" (i.e. select all events visible in current view), then I might be onto something but so far, I haven't found any way to do that. If any of you wise and wonderful people out there have any tips, hints or rude limericks that could help me figure this out, I would be most grateful. Thanks. ~Israel~ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1302 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040706/7146ae2d/attachment.bin From berkowit at silcom.com Wed Jul 7 04:56:18 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Wed Jul 7 04:56:23 2004 Subject: [Pythonmac-SIG] Scripting iCal :: getting the events of the day? In-Reply-To: Message-ID: On 7/6/04 6:27 PM, "Israel C. Evans" wrote: > I've recently, under the direction of the wonderful suggestion I received on > this list, begun to use appscript to script iCal. One of my main goals with > doing so is to extract all the events that happen to occur on any given day. > This is turning out to be quite difficult for it seems that the osa dictionary > for iCal offers no methods for retrieving said events. Each event has > properties which include useful things like startdate and enddate as well as > recur which has the ical string of recurrence rules. It's easy to get an > event based on the start date or end date, but parsing the diverse and sundry > possible combinations of recurrence rules leaves me where I left attempting to > parse the .ics manually... lost in the forest. > > I've been able to activate iCal, move to a particular day and change the view > to day view so that I can see the events of that day. If there was a way to > select the events "visually" (i.e. select all events visible in current view), > then I might be onto something but so far, I haven't found any way to do that. > > > If any of you wise and wonderful people out there have any tips, hints or rude > limericks that could help me figure this out, I would be most grateful. It's not so ornate as all that. iCal stores its events in separate calendars, so you have to search per calendar. It implements 'whose clauses' for quick searching. Here's how to do it in pure AppleScript, which doesn't really belong on this list. You should join the AppleScript-Users mailing list, on Apple's website. set today to (current date) --or date "8/1/2004" set time of today to 0 -- midnight, if not set tomorrow to today + (1 * days) tell application "iCal" set dayEvents to {} repeat with c in (every calendar) set end of dayEvents to (every event of c whose start date ? today and start date < tomorrow) end repeat end tell return dayEvents [1] The long line includes a symbol made by holding down Option key and pressing ".", meaning 'greater than or equal to'. If this mailing list should happen to display it incorrectly, you'll know what to do. It's like ">" but with option, not shift, key held. [2] The result will be a list of iCal event objects. Perhaps you can turn that into a Python array if Python can deal with these objects. Otherwise you'll need to parse each one when you get it, to include a list of primitive types (strings, booleans and dates) which you can manage in Python. Write back if you need this. Or just do the whole thing in AppleScript and ask on the AppleScript-Users list. -- Paul Berkowitz -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040706/a27d74d0/attachment.html From berkowit at silcom.com Wed Jul 7 05:13:00 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Wed Jul 7 05:13:05 2004 Subject: [Pythonmac-SIG] Scripting iCal :: getting the events of the day? In-Reply-To: Message-ID: On 7/6/04 7:56 PM, "Paul Berkowitz" wrote: > It's not so ornate as all that. iCal stores its events in separate calendars, > so you have to search per calendar. It implements 'whose clauses' for quick > searching. Here's how to do it in pure AppleScript, which doesn't really > belong on this list. You should join the AppleScript-Users mailing list, on > Apple's website. > > set today to (current date) --or date "8/1/2004" > set time of today to 0 -- midnight, if not > set tomorrow to today + (1 * days) > tell application "iCal" > set dayEvents to {} > repeat with c in (every calendar) > set end of dayEvents to (every event of c whose start date ? today and > start date < tomorrow) > end repeat > end tell > return dayEvents Sorry, that will give you a list of lists rather than a simple list (array). This is better: set today to (current date) --or date "8/1/2004" set time of today to 0 -- midnight, if not set tomorrow to today + (1 * days) tell application "iCal" set dayEvents to {} repeat with c in (every calendar) set dayEvents to dayEvents & (every event of c whose start date ? today and start date < tomorrow) end repeat end tell return dayEvents However, due to a really stupid bug in iCal, that will not give you all-day events for today unless you know how to do it. (iCal thinks the start time is your local equivalent of what it would be if it were midnight GMT.) Write me privately and I'll send you a script that deals with those and excludes tomorrow's (or yesterday's) all-day events. -- Paul Berkowitz -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040706/139561b4/attachment-0001.htm From drew_dufresne at yahoo.com.au Wed Jul 7 05:56:37 2004 From: drew_dufresne at yahoo.com.au (=?iso-8859-1?q?Andrew=20Dufresne?=) Date: Wed Jul 7 05:56:41 2004 Subject: [Pythonmac-SIG] Referencing drive path names on OS9 Message-ID: <20040707035637.52429.qmail@web90105.mail.scd.yahoo.com> My appologies if this is a silly question but I have a question about referencing drive paths on an OS9 version of macpython (2.3.3). I understand that when macpython references folder paths on a drive (be it the root drive, CDROM, removable media, etc.) you need to specify the name of the drive for the absolute path specification. For example: os.listdir('My Disk:Applications') to list the directory 'Applications' on the system hard disk (in this case, named 'My Disk'). Thats all fine and dandy. But what happens when you have two different disks that happen to have the same name? Lets say I had a CDROM with the name 'My Disk' in the above system. The OS knows the difference between the devices and will generate two icons on the desktop, but python uses the drive name only (I'm guessing). Can python make a distinction between the two when they have a common drive name? --------------------------------- Find local movie times and trailers on Yahoo! Movies. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040707/fff92f49/attachment.htm From aleaxit at yahoo.com Wed Jul 7 09:53:56 2004 From: aleaxit at yahoo.com (Alex Martelli) Date: Wed Jul 7 09:54:02 2004 Subject: [Pythonmac-SIG] "Python on the Mac" recipes for the Python Cookbook's 2nd edition? Message-ID: Hi there, fellow Python Mac users! I'm in the recipe-selection phase for a second edition of O'Reilly's "Python Cookbook" and I have noticed that no recipe has been submitted to ActiveState's online cookbook that shows how to use Mac Python tools to write Python extensions (nor, indeed, _any_ recipes specific to the use of Python on the Mac, vs several specific to Windows and quite a few specific to other Unix platforms). I'd really like to have some such recipes, e.g. in the "Extending and Embedding" chapter and/or, more likely, in those on system administration and user interfaces... if anybody's interested they're welcome to submit recipes to the online cookbook and/or, if they prefer, mail me directly (sorry, I'm not subscribing to this mailing list -- indeed I've currently shut off all mailing lists since preparing the cookbook's 2nd edition is a very time-consuming task). As you know if you've seen the 1st edition, my bias is strongly in favour of "short and sweet" recipes -- in particular, those recipes that rely on 3rd party packages, as "Python on the Mac" ones would likely be, play more of a role of "raising interest" in the 3rd party package than of "covering" its use in any depth. The compensation for authors of recipes that are selected for publication is essentially "symbolic" -- a free copy of the printed book when it comes out and the listing among the book's contributors; all royalties that would normally go to contributors go to the non-profit Python Software Foundation instead (the PSF uses all of its funds to promote Python in many ways). Thanks, Alex From Jack.Jansen at cwi.nl Wed Jul 7 10:54:32 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed Jul 7 10:54:13 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 In-Reply-To: <7CFAD676-CF91-11D8-B206-000A95686CD8@redivi.com> References: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> <0DBD1A8C-CE02-11D8-A058-000D934FF6B4@cwi.nl> <66D63C42-CECF-11D8-8637-000A95DE13C4@neffster.de> <7CFAD676-CF91-11D8-B206-000A95686CD8@redivi.com> Message-ID: <43717E32-CFF3-11D8-A9CA-000D934FF6B4@cwi.nl> On 6 Jul 2004, at 23:14, Bob Ippolito wrote: >>> I just tried the GUI Package manager and pimp.py and both seem as >>> they would work now. Before I go on, please allow one further >>> question: is it possible to install the listed binary packages into >>> any Python 2.3.x version (binary compatibility)? >> >> That is definitely the intention of Python micro-releases, so if this >> isn't the case please let me know. > > But it isn't necessarily the case. Each .so will have a mach-o load > command pointing to some particular Python path, except when using the > -undefined dynamic_lookup linker flag on 10.3. Has that linking style > been backported to any 2.3.x release? Bob is right: I forgot about the pathname issue. -- 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 Wed Jul 7 11:03:26 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed Jul 7 11:03:02 2004 Subject: [Pythonmac-SIG] Referencing drive path names on OS9 In-Reply-To: <20040707035637.52429.qmail@web90105.mail.scd.yahoo.com> References: <20040707035637.52429.qmail@web90105.mail.scd.yahoo.com> Message-ID: <81E7D856-CFF4-11D8-A9CA-000D934FF6B4@cwi.nl> On 7 Jul 2004, at 05:56, Andrew Dufresne wrote: > My appologies if this is a silly question but I have a question about > referencing drive paths on?an OS9 version of macpython (2.3.3). > ? > I understand that when macpython references folder paths on a drive > (be it the root drive, CDROM, removable media, etc.) you need to > specify the name of the drive for the absolute path specification. > For example: > ????? os.listdir('My Disk:Applications') > to list the directory 'Applications' on the system hard disk (in this > case, named 'My Disk'). Thats all fine and dandy. > ? > But what happens when you have two different disks that happen to have > the same name? This is a general problem with using pathnames on MacOS9. According to the Apple specs you should be using FSRef's, FSSpec's or aliases to refer to files, not pathnames. For Python this means that a second disk with the same name is not visible to the Posix-compatible calls (open, os.chdir, many many more). If you use 100% Apple API calls (the FSspec/FSRef APIs mentioned above) there is no problem, though. But in reality this appears to be a theoretical problem: I've never heard any Python user complain about this. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From mwh at python.net Wed Jul 7 13:15:09 2004 From: mwh at python.net (Michael Hudson) Date: Wed Jul 7 13:15:27 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 In-Reply-To: <7CFAD676-CF91-11D8-B206-000A95686CD8@redivi.com> (Bob Ippolito's message of "Tue, 6 Jul 2004 17:14:37 -0400") References: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> <0DBD1A8C-CE02-11D8-A058-000D934FF6B4@cwi.nl> <66D63C42-CECF-11D8-8637-000A95DE13C4@neffster.de> <7CFAD676-CF91-11D8-B206-000A95686CD8@redivi.com> Message-ID: <2m8ydw132a.fsf@starship.python.net> Bob Ippolito writes: > On Jul 6, 2004, at 4:55 PM, Jack Jansen wrote: > >> >> On 6 Jul 2004, at 00:05, Markus Neff wrote: >>> I just tried the GUI Package manager and pimp.py and both seem as >>> they would work now. Before I go on, please allow one further >>> question: is it possible to install the listed binary packages into >>> any Python 2.3.x version (binary compatibility)? >> >> That is definitely the intention of Python micro-releases, so if >> this isn't the case please let me know. > > But it isn't necessarily the case. Each .so will have a mach-o load > command pointing to some particular Python path, except when using the > -undefined dynamic_lookup linker flag on 10.3. Has that linking style > been backported to any 2.3.x release? But the paths should be the same for any 2.3.x release -- there's a lot of the moral equivalent of sys.version[:3] going on in computing paths in Python... Or have I missed something? Cheers, mwh -- QNX... the OS that walks like a duck, quacks like a duck, but is, in fact, a platypus. ... the adventures of porting duck software to the platypus were avoidable this time. -- Chris Klein, alt.sysadmin.recovery From ronaldoussoren at mac.com Wed Jul 7 13:21:50 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed Jul 7 13:26:50 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 In-Reply-To: <2m8ydw132a.fsf@starship.python.net> References: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> <0DBD1A8C-CE02-11D8-A058-000D934FF6B4@cwi.nl> <66D63C42-CECF-11D8-8637-000A95DE13C4@neffster.de> <7CFAD676-CF91-11D8-B206-000A95686CD8@redivi.com> <2m8ydw132a.fsf@starship.python.net> Message-ID: On 7-jul-04, at 13:15, Michael Hudson wrote: > Bob Ippolito writes: > >> On Jul 6, 2004, at 4:55 PM, Jack Jansen wrote: >> >>> >>> On 6 Jul 2004, at 00:05, Markus Neff wrote: >>>> I just tried the GUI Package manager and pimp.py and both seem as >>>> they would work now. Before I go on, please allow one further >>>> question: is it possible to install the listed binary packages into >>>> any Python 2.3.x version (binary compatibility)? >>> >>> That is definitely the intention of Python micro-releases, so if >>> this isn't the case please let me know. >> >> But it isn't necessarily the case. Each .so will have a mach-o load >> command pointing to some particular Python path, except when using the >> -undefined dynamic_lookup linker flag on 10.3. Has that linking style >> been backported to any 2.3.x release? > > But the paths should be the same for any 2.3.x release -- there's a > lot of the moral equivalent of sys.version[:3] going on in computing > paths in Python... > > Or have I missed something? Extensions are not interchangeable between pythons with a different --prefix. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From hengist.podd at virgin.net Wed Jul 7 14:26:56 2004 From: hengist.podd at virgin.net (has) Date: Wed Jul 7 14:33:18 2004 Subject: [Pythonmac-SIG] Scripting iCal :: getting the events of the day? In-Reply-To: References: Message-ID: Paul Berkowitz wrote: >One of my main goals with doing so is to extract all the events that >happen to occur on any given day. > >It's not so ornate as all that. iCal stores its events in separate >calendars, so you have to search per calendar. It implements 'whose >clauses' for quick searching. Here's how to do it in pure >AppleScript, which doesn't really belong on this list. You should >join the AppleScript-Users mailing list, on Apple's website. I think a better list for Python users who wish to learn application scripting would be Dartmouth's MACSCRPT list, which is language agnostic and more programmer-friendly than AS Users: >set today to (current date) --or date "8/1/2004" >set time of today to 0 -- midnight, if not >set tomorrow to today + (1 * days) >tell application "iCal" > set dayEvents to {} > repeat with c in (every calendar) > set end of dayEvents to (every event of c whose start date ? >today and start date < tomorrow) > end repeat >end tell >return dayEvents Here's the equivalent Python: ####### from datetime import date, datetime, timedelta from appscript import * today = datetime.fromordinal(date.today().toordinal()) # [1] tomorrow = today + timedelta(1) events = [] for cal in app('iCal.app').calendars.get(): events.extend( cal.events.filter( (its.start_date >= today).AND(its.start_date < tomorrow) ).get() ) print events ####### which will return something like this: [app(u'/Applications/iCal.app').calendars[2].events[4], app(u'/Applications/iCal.app').calendars[2].events[5], app(u'/Applications/iCal.app').calendars[6].events[7]] ... Now, you _should_ be able to do away with the 'for' loop and just use the following reference instead: events = app('iCal.app').calendars.events.filter( (its.start_date >= today).AND(its.start_date < tomorrow) ).get() This _ought_ to return a list like: --> [[], [app(u'/Applications/iCal.app').calendars[2].events[4], app(u'/Applications/iCal.app').calendars[2].events[5]], [], [], [], [app(u'/Applications/iCal.app').calendars[6].events[7]], []] which could then be flattened using: reduce(lambda e,v: e+v, events) However, in OS 10.2 [and maybe 10.3; I'm not sure if it's been fixed yet] this reference is partly broken and instead returns this mess: --> [k.missing_value, [app(u'/Applications/iCal.app').calendars[2].events[4], app(u'/Applications/iCal.app').calendars[2].events[5]], k.missing_value, k.missing_value, k.missing_value, app(u'/Applications/iCal.app').calendars[6].events[7], k.missing_value] which you'll need to pass through the following to clean it up: events = [type(e) == list and e or e != k.missing_value and [e] or [] for e in events] ... Kind of annoying, but Mac application scripting has always been riddled with bugs, flaws and inconsistencies. While you can learn the essential principles in an hour, it takes rather longer to develop the deep voodoo skills required to bend the less well-implemented application scripting models to your will. Which totally bites, but I'm sure y'all know where Radar is...;) When it does work, however, it's an absolutely wonderful technology. e.g. InDesign's scripting model is a thing of beauty (one of its engineers was on the original team that developed the technology), and I'm sure Paul can tell you lots of stories about Entourage and other great scriptable apps. It's just unfortunate that Apple's own iApps are not yet amongst this list, but their engineers are working on it so fingers crossed they'll get there eventually. HTH has [1] The next version of appscript can pack date and time objects directly, simplifying this line to 'today = date.today()' -- http://freespace.virgin.net/hamish.sanderson/ From bob at redivi.com Wed Jul 7 15:06:26 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed Jul 7 15:06:42 2004 Subject: [Pythonmac-SIG] Problems with pimp in 2.3.4 In-Reply-To: References: <2DEA6F9F-CDD4-11D8-BDF9-000A95DE13C4@neffster.de> <3F5C2EFD-CDF3-11D8-A058-000D934FF6B4@cwi.nl> <0DBD1A8C-CE02-11D8-A058-000D934FF6B4@cwi.nl> <66D63C42-CECF-11D8-8637-000A95DE13C4@neffster.de> <7CFAD676-CF91-11D8-B206-000A95686CD8@redivi.com> <2m8ydw132a.fsf@starship.python.net> Message-ID: <74A294F6-D016-11D8-ACAB-000A95686CD8@redivi.com> On Jul 7, 2004, at 7:21 AM, Ronald Oussoren wrote: > > On 7-jul-04, at 13:15, Michael Hudson wrote: > >> Bob Ippolito writes: >> >>> On Jul 6, 2004, at 4:55 PM, Jack Jansen wrote: >>> >>>> >>>> On 6 Jul 2004, at 00:05, Markus Neff wrote: >>>>> I just tried the GUI Package manager and pimp.py and both seem as >>>>> they would work now. Before I go on, please allow one further >>>>> question: is it possible to install the listed binary packages into >>>>> any Python 2.3.x version (binary compatibility)? >>>> >>>> That is definitely the intention of Python micro-releases, so if >>>> this isn't the case please let me know. >>> >>> But it isn't necessarily the case. Each .so will have a mach-o load >>> command pointing to some particular Python path, except when using >>> the >>> -undefined dynamic_lookup linker flag on 10.3. Has that linking >>> style >>> been backported to any 2.3.x release? >> >> But the paths should be the same for any 2.3.x release -- there's a >> lot of the moral equivalent of sys.version[:3] going on in computing >> paths in Python... >> >> Or have I missed something? > > Extensions are not interchangeable between pythons with a different > --prefix. Such as /System/Library/Frameworks/Python.framework, /Library/Frameworks/Python.framework, ~/Library/Frameworks/Python.framework, or @executable_path/../Frameworks/Python.framework. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040707/ded2da12/smime.bin From jwblist at olympus.net Thu Jul 8 04:49:30 2004 From: jwblist at olympus.net (John W. Baxter) Date: Thu Jul 8 04:49:47 2004 Subject: [Pythonmac-SIG] Referencing drive path names on OS9 In-Reply-To: <81E7D856-CFF4-11D8-A9CA-000D934FF6B4@cwi.nl> Message-ID: On 7/7/2004 2:03, "Jack Jansen" wrote: > > On 7 Jul 2004, at 05:56, Andrew Dufresne wrote: > >>.. >> ? >> But what happens when you have two different disks that happen to have >> the same name? > > This is a general problem with using pathnames on MacOS9. According to > the Apple specs you should be using FSRef's, FSSpec's or aliases to > refer to files, not pathnames. For Python this means that a second disk > with the same name is not visible to the Posix-compatible calls (open, > os.chdir, many many more). If you use 100% Apple API calls (the > FSspec/FSRef APIs mentioned above) there is no problem, though. > > But in reality this appears to be a theoretical problem: I've never > heard any Python user complain about this. > I suspect most users intuitively "know" that having multiple volumes of the same name is potentially troublesome (even though it worked out quite well in Mac OS 9 and earlier from the software's point of view, scripting aside). I also suspect that this happens in real life most often in situations like mounting one machine in Firewire disk mode on another, both of them still having volumes named "Macintosh HD". And in those situations, Python is unlikely to be used much, so Jack doesn't see many complaints. --John (who has been wrong many times before) From bscholl1 at rochester.rr.com Thu Jul 8 13:30:40 2004 From: bscholl1 at rochester.rr.com (Benjamin Schollnick) Date: Thu Jul 8 13:30:51 2004 Subject: [Pythonmac-SIG] Finder Crash, after moving files.... In-Reply-To: References: Message-ID: <3DA7FEC2-D0D2-11D8-9390-000A9597110A@rochester.rr.com> On Jul 6, 2004, at 11:59 AM, has wrote: > findertools hooks into the Apple Event Manager via aetools, so can't > be anything related to AppleScript. Either way, it's now been eliminated... I used the following Applescript in the Script Editor to test... tell application "Finder" repeat 3000 times -- 6000 moves move file "test.jpg" of alias "Macintosh HD:Users:benjamin:test:" to alias "Macintosh HD:Users:benjamin:test:test2:" move file "test.jpg" of alias "Macintosh HD:Users:benjamin:test:test2:" to alias "Macintosh HD:Users:benjamin:test:" end repeat end tell It did seem to slow down the further it got into the repeat loop, but, it did finish.... Without any problems... > Suggest you start by narrowing down your code to a simple test script > that demonstrates the bug in isolation. Then see if you can replicate > it using AppleScript and appscript. e.g. I'm unable to cause a > crashing bug with either of the following on OS10.2.8 + MacPython > 2.3.3: I did have the same problem with 10.2.8, so something is a little fishy here... import time from findertools import move for test_count in range(0,3000): # 6000 moves move(r'/Users/benjamin/test/test.jpg' ,'/Users/benjamin/test/test2') move(r'/Users/benjamin/test/test2/test.jpg', '/Users/benjamin/test/') time.sleep (0.5) print test_count Dies at roughly loop count 2157.... This simplistic version eliminates almost everything I can think of that would be a variable between systems.... The directory count does not matter (# of files in directory)..... It's on my boot drive, etc.... Suggestions to help track this down? - Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 3202 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040708/5d88a0ac/attachment.bin From hengist.podd at virgin.net Fri Jul 9 01:17:57 2004 From: hengist.podd at virgin.net (has) Date: Fri Jul 9 01:24:18 2004 Subject: [Pythonmac-SIG] Re: improving appscript architecture In-Reply-To: <40EB2340.3000503@san.rr.com> References: <20040706211902.3C3DA1E4017@bag.python.org> <40EB2340.3000503@san.rr.com> Message-ID: Thanks to Russell and Gary for comments and links on implementing mix-ins in Python. Related to that subject, here's a quick question about using "non-standard voodoo": Given that I'm angling for appscript's eventual inclusion in the standard MacPython library, the code needs to be grokkable and maintainable by others (lest I be hit by the Proverbial Bus someday). How would using something like a home-rolled mixin scheme affect that? e.g. Justifiable under certain circumstances? A complete non-starter? -- Anyway, to expand on the issue a bit, since I was rather vague before: What's bothering me isn't that the problem can't be solved, but that I'm struggling to find a way to solve it that's no more painful to other developers/maintainers than absolutely necessary. None of this impacts on end-users who use appscript for application scripting as they never have to instantiate classes directly. But it definitely affects anyone who has to maintain this code, and it'll very likely impact on application developers using appscript to implement application scripting support in their own Python-based applications. A basic example of the knotty compositions I'm dealing with: AbstractBase | |-- AbstractMid | | | |-- Public1 | | | |-- Public2 | If I want to complement/extend/replace the behaviour supplied by AbstractMid, I can't do this directly. Instead, I have to subclass both Public1 and Public2, then either cut-n-paste the new code into both of these subclasses, or use MI to create a new AbstractMid2 that the new classes inherit from in addition to Public1 and Public2. Now, add in various circular references, e.g. a method in Public1 may be responsible for creating and returning new instances of Public2, and vice-versa. I've already got a scheme whereby modules have to provide their Base superclass with a reference to themselves, so that ModuleA's version of Public1 returns instances of ModuleA.Public2 while ModuleAPlus's version of Public1 returns instances of ModuleAPlus.Public2. Oh, and ModuleA also imports ModuleAPlus so it can refer to its classes for type-checking purposes. It all works, but it's already a right old spiderweb and I've yet to finish ModuleB and ModuleBPlus, which as their names suggest, build on ModuleA and ModuleAPlus respectively. Plus another layer which'll go on top of that to enable automatic sanity-checking and error-reporting. These layers are supposed to make the package much more flexible and easy to develop with - the A layer provides a 'geek-level' API, the B level extends this with end user-friendly sugar, and the 'sanity' layer that users of both A and A+B should be free to add in if they want them. ... In a prototype-based language that uses delegation [modifiable at runtime] instead of inheritance [determined at compile-time], composing new behaviours would be easy: I'd simply duplicate the original objects then modify the delegation chain to insert a new AbstractMidPlus object before AbstractMid. It's dead easy to do, and dead easy to follow. So I'm fair frustrated at how much harder it is to get the same results in a class-based language, but I've no choice but to work within these limitations as best I can. ... It may be that the most practical solution is to replace the concrete class structure with a bunch of metaclass factories that pump out the appropriate classes by mixing together the raw base classes on the spot according to recipes provided by each 'plugin' module. I could pretty much do away with the whole inheritance tree and just have a pile of simple, flat abstract base classes that are slapped into concrete shape purely via multiple inheritance. This shouldn't make the method resolution order any harder to fathom than it would be with a deep single-inheritance tree, I don't think. Though metaclass programming can be more than a little indigestible to many developers, so it's not a clear winner either. ... Mostly, I guess I'm trying to find out which approaches give others the least goosebumps to think about, and which will reduce them to quivering blobs at the mere thought. Find out which folk think would be most practical, given their own experiences, and maybe get a few pointers on how best to arrange the basic framework. Asking not so much for my benefit as for everyone else's. After all, you folks are probably the main developer-side market for the beast, so I'd better make damn sure you'll be happy with it. :) Many thanks, has -- http://freespace.virgin.net/hamish.sanderson/ From daniel at brightfire.org Fri Jul 9 16:44:37 2004 From: daniel at brightfire.org (Daniel Lord) Date: Fri Jul 9 16:44:44 2004 Subject: [Pythonmac-SIG] Re: improving appscript architecture Message-ID: <806F6F87-D1B6-11D8-9D5D-000A95ACE052@brightfire.org> > From: has > Date: July 8, 2004 16:17:57 PDT > To: pythonmac-sig@python.org > Subject: [Pythonmac-SIG] Re: improving appscript architecture > > > Thanks to Russell and Gary for comments and links on implementing > mix-ins in Python. Related to that subject, here's a quick question > about using "non-standard voodoo": > > Given that I'm angling for appscript's eventual inclusion in the > standard MacPython library, the code needs to be grokkable and > maintainable by others (lest I be hit by the Proverbial Bus someday). > How would using something like a home-rolled mixin scheme affect that? > e.g. Justifiable under certain circumstances? A complete non-starter? > Just my two-cents: I'd suggest parsing up the functionality between abstract base classes, a few concrete base classes, and classes that simulate Java's interface pattern depending upon some classification based on object or function characteristics. For example, if I understand your challenge correctly, Java's Listener and Adapter patterns make event processing much easier to follow and adapt to specific application than if Java's Foundation Classes were a mish-mash of rich abstract and base classes defying rhyme and reason to anyone not intimately familiar with the entire architecture. Please excuse this comment if it seems utter nonsense. After all, I know what I intend to convey but it may be far from how I explain it and even farther from how you understand it. Daniel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1739 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040709/52662b10/attachment.bin From Jack.Jansen at cwi.nl Fri Jul 9 22:49:46 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Jul 9 22:49:52 2004 Subject: [Pythonmac-SIG] Re: improving appscript architecture In-Reply-To: References: <20040706211902.3C3DA1E4017@bag.python.org> <40EB2340.3000503@san.rr.com> Message-ID: <83650530-D1E9-11D8-AD24-000D934FF6B4@cwi.nl> On 9 Jul 2004, at 01:17, has wrote: > Given that I'm angling for appscript's eventual inclusion in the > standard MacPython library, the code needs to be grokkable and > maintainable by others (lest I be hit by the Proverbial Bus someday). > How would using something like a home-rolled mixin scheme affect that? > e.g. Justifiable under certain circumstances? A complete non-starter? Has, I'm very interested in understanding this (as I'll probably be the default maintainer if it gets included in the standard distribution) but I have tried a couple of times to understand your message and I simply can't seem to grok it. Could you come up with a more concrete example of what the problem is that you're trying to solve? Or, alternatively, explain the architecture that you're using for appscript at the moment. The nice side of the old gensuitemodule architecture was that it was nicely compartmentalized, so you could really understand it a bit at a time: the C-stuff is completely self-contained, as is aepack. Aetypes had a bit more complexity, but it was all basically localized. Gensuitemodule is standalone, and the two-pass architecture made it also reasonably easy to understand. And the generated packages had (at the price of being incorrect:-) also only limited global complexity (the name lookups being the main one), with only limited dependency on magic implemented by aetypes. Appscripting and aeve (when I last looked at them) both had a higher level of complexity, but that is something that I think can't be helped if you want to do things dynamically: data structures are always harder to read than Python code, and metaclasses and stuff don't really help either (at least, they don't for me:-). The downside of that complexity is that it becomes very hard to see the forest for the trees, so I know that it would at least help me a lot of you could provide a description of the forest... -- 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 Fri Jul 9 22:51:12 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Jul 9 22:51:14 2004 Subject: [Pythonmac-SIG] Re: improving appscript architecture In-Reply-To: <806F6F87-D1B6-11D8-9D5D-000A95ACE052@brightfire.org> References: <806F6F87-D1B6-11D8-9D5D-000A95ACE052@brightfire.org> Message-ID: On 9 Jul 2004, at 16:44, Daniel Lord wrote: > Just my two-cents: I'd suggest parsing up the functionality between > abstract base classes, a few concrete base classes, and classes that > simulate Java's interface pattern depending upon some classification > based on object or function characteristics. For example, if I > understand your challenge correctly, Java's Listener and Adapter > patterns make event processing much easier to follow and adapt to > specific application than if Java's Foundation Classes were a > mish-mash of rich abstract and base classes defying rhyme and reason > to anyone not intimately familiar with the entire architecture. > > Please excuse this comment if it seems utter nonsense. After all, I > know what I intend to convey but it may be far from how I explain it > and even farther from how you understand it. I only read this after my previous post, otherwise I could have just said "+1" to this one:-) -- 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 xlii at xlii.org Sat Jul 10 23:22:51 2004 From: xlii at xlii.org (Quarante-Deux) Date: Sat Jul 10 23:23:06 2004 Subject: [Pythonmac-SIG] Accented characters Message-ID: I'm new to python and I need to process some text written in French with various accented characters. I have read about the locale module and codecs and anything else I could find to no avail. In IDLE I can't even type an accented character. In Terminal, I must activite "escape non ASCII characters" in the Emulation setting. If I write a script that writes a file to disk I never get anything good either. I have tried various combinations of locale.setlocale, and also various combinations of unicode and locale settings for the re module. Nothing works. I need: 1/ to be able to sort correctly 2/ to be able to have regular expressions recognize word boundaries correctly. I'm using Mac OSX with the preinstalled Python 2.3.3. I either use IDLE or BBEdit and the Terminal. Thanks for any help. Ellen -- ------------------------------------------------------------------- xlii@xlii.org | Ellen C. Herzfeld http://www.quarante-deux.org/ | Dominique O. Martel Quelques pages sur la Science-Fiction | Quarante-Deux ------------------------------------------------------------------- From gohaku at earthlink.net Sun Jul 11 06:31:13 2004 From: gohaku at earthlink.net (gohaku) Date: Sun Jul 11 06:31:20 2004 Subject: [Pythonmac-SIG] Where is Python.h on OS X? Message-ID: <244C60EE-D2F3-11D8-BC1F-000A9574CFD8@earthlink.net> Hi everyone, I am trying to compile the following: // Don't forget to import "pythonXX.lib"! #include int main() { Py_Initialize(); // TODO: Add your Python code here. PyObject* pyIntObject = PyInt_FromLong(5); if (pyIntObject == NULL) ; // Error Py_DECREF(pyIntObject); Py_Finalize(); return 0; } I looked in /usr/include and could not find any such file. I'm thinking I'll have to use XCode and something to do with frameworks but am not sure how to start. Thanks in advance. -gohaku From jwt at onjapan.net Sun Jul 11 06:48:15 2004 From: jwt at onjapan.net (Jim Tittsler) Date: Sun Jul 11 06:47:36 2004 Subject: [Pythonmac-SIG] Where is Python.h on OS X? In-Reply-To: <244C60EE-D2F3-11D8-BC1F-000A9574CFD8@earthlink.net> References: <244C60EE-D2F3-11D8-BC1F-000A9574CFD8@earthlink.net> Message-ID: <20040711044814.GB9757@server.onjapan.net> On Sun, Jul 11, 2004 at 12:31:13AM -0400, gohaku wrote: > I am trying to compile the following: > > // Don't forget to import "pythonXX.lib"! > #include [...] > I looked in /usr/include and could not find any such file. For 10.3: /System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/ From eppstein at ics.uci.edu Sun Jul 11 06:50:58 2004 From: eppstein at ics.uci.edu (David Eppstein) Date: Sun Jul 11 06:51:05 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? Message-ID: I have a Wapplication app that I'm trying to port to something that runs under the Panther command-line python. It needs to be able to display PIL Images. Is this possible under Cocoa with PyObjC or am I stuck with ugly Tkinter? -- David Eppstein http://www.ics.uci.edu/~eppstein/ Univ. of California, Irvine, School of Information & Computer Science From altis at semi-retired.com Sun Jul 11 17:27:10 2004 From: altis at semi-retired.com (Kevin Altis) Date: Sun Jul 11 17:27:15 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: References: Message-ID: On Jul 10, 2004, at 9:50 PM, David Eppstein wrote: > I have a Wapplication app that I'm trying to port to something that > runs > under the Panther command-line python. It needs to be able to display > PIL Images. Is this possible under Cocoa with PyObjC or am I stuck > with > ugly Tkinter? > I'm sure PyObjC will work, but I'm guessing you'll have to do an image conversion from PIL using the convert and tostring methods. Someone has probably already written this routine, I'm just not familiar enough with PyObjC to tell you where to look. In PythonCard, which uses wxPython, I have the following utility routines in the graphic.py module to handle the conversion to wx.Image and wx.Bitmap from PIL. def PILToImage(pilImage): if (pilImage.mode != 'RGB'): pilImage = pilImage.convert('RGB') imageData = pilImage.tostring('raw', 'RGB') img = wx.EmptyImage(pilImage.size[0], pilImage.size[1]) img.SetData(imageData) return img def PILToBitmap(image): return wx.BitmapFromImage(PILToImage(image)) As you might guess, wxPython and PythonCard run fine on Mac OS X and can easily display PIL images, in fact PythonCard has a built-in drawBitmap method for the BitmapCanvas component that handles PIL automatically as well as Numeric arrays. There are also pictureViewer and slideshow samples included with PythonCard in case you don't want to right any code at all. So, no you don't have to use Tkinter ka From gandreas at delver.com Sun Jul 11 17:27:19 2004 From: gandreas at delver.com (Glenn Andreas) Date: Sun Jul 11 17:28:31 2004 Subject: [Pythonmac-SIG] Where is Python.h on OS X? In-Reply-To: <20040711044814.GB9757@server.onjapan.net> References: <244C60EE-D2F3-11D8-BC1F-000A9574CFD8@earthlink.net> <20040711044814.GB9757@server.onjapan.net> Message-ID: At 1:48 PM +0900 7/11/04, Jim Tittsler wrote: >On Sun, Jul 11, 2004 at 12:31:13AM -0400, gohaku wrote: >> I am trying to compile the following: >> >> // Don't forget to import "pythonXX.lib"! >> #include >[...] >> I looked in /usr/include and could not find any such file. > >For 10.3: >/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/ > It's a bit more subtle than that (especially when using XCode with the various OS SDK's installed). Normally, from XCode, you can just "add framework", select Python (in /System/Library/Frameworks) and then do #include and everything will work. That's the easy answer. ...unless you try to target the 10.2.7 SDK (to try to build an app that works under 10.2.7 and would use a user-installed /Library/Frameworks/Python.framework) at which point it won't work... Turns out that XCode actually looks in /Developer/SDKs/MacOSX(whatever).sdk/System/Library/Frameworks, and there is no /Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/Python.Framework so even though you've added Python.framework (and can even see Python.h in xcode) it won't find it when building (and you have to manually add an include path, and you can't use the framework style include). -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From ronaldoussoren at mac.com Sun Jul 11 17:35:06 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun Jul 11 17:35:13 2004 Subject: [Pythonmac-SIG] Where is Python.h on OS X? In-Reply-To: <20040711044814.GB9757@server.onjapan.net> References: <244C60EE-D2F3-11D8-BC1F-000A9574CFD8@earthlink.net> <20040711044814.GB9757@server.onjapan.net> Message-ID: On 11-jul-04, at 6:48, Jim Tittsler wrote: > On Sun, Jul 11, 2004 at 12:31:13AM -0400, gohaku wrote: >> I am trying to compile the following: >> >> // Don't forget to import "pythonXX.lib"! >> #include > [...] >> I looked in /usr/include and could not find any such file. > > For 10.3: > /System/Library/Frameworks/Python.framework/Versions/2.3/include/ > python2.3/ ... and when you use distutils to build the extension you don't have to know the location. Ronald > > > _______________________________________________ > 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 ronaldoussoren at mac.com Sun Jul 11 18:10:19 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun Jul 11 18:10:27 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: References: Message-ID: On 11-jul-04, at 6:50, David Eppstein wrote: > I have a Wapplication app that I'm trying to port to something that > runs > under the Panther command-line python. It needs to be able to display > PIL Images. Is this possible under Cocoa with PyObjC or am I stuck > with > ugly Tkinter? PyObjC currently has no support for PIL images. BTW. Why do you have to display PIL images? Cocoa has support for displaying images and transforming them. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From ronaldoussoren at mac.com Sun Jul 11 19:20:10 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun Jul 11 19:20:18 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <52755489.1089540562@[192.168.1.100]> References: <52755489.1089540562@[192.168.1.100]> Message-ID: <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> On 11-jul-04, at 19:09, David Eppstein wrote: > On 7/11/04 6:10 PM +0200 Ronald Oussoren > wrote: >> PyObjC currently has no support for PIL images. >> >> BTW. Why do you have to display PIL images? Cocoa has support for >> displaying images and transforming them. > > I guess I don't, but the code I was porting involved using PIL to > resize and display images. Does Cocoa have routines for rotation, > antialiased downsizing, and saving back out to jpeg? I didn't see > them in a quick scan of the Cocoa "Drawing and Images" doc but maybe I > was looking in the wrong place. I don't know about saving, but I have written a tool that rotates and resizes images. That tool uses NSAffineTransformations to do the job. -- > David Eppstein http://www.ics.uci.edu/~eppstein/ > Univ. of California, Irvine, School of Information & Computer Science > > -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From bob at redivi.com Sun Jul 11 19:30:57 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Jul 11 19:31:10 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> References: <52755489.1089540562@[192.168.1.100]> <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> Message-ID: <11ECEA7F-D360-11D8-99A1-000A95686CD8@redivi.com> On Jul 11, 2004, at 1:20 PM, Ronald Oussoren wrote: > > On 11-jul-04, at 19:09, David Eppstein wrote: > >> On 7/11/04 6:10 PM +0200 Ronald Oussoren >> wrote: >>> PyObjC currently has no support for PIL images. >>> >>> BTW. Why do you have to display PIL images? Cocoa has support for >>> displaying images and transforming them. >> >> I guess I don't, but the code I was porting involved using PIL to >> resize and display images. Does Cocoa have routines for rotation, >> antialiased downsizing, and saving back out to jpeg? I didn't see >> them in a quick scan of the Cocoa "Drawing and Images" doc but maybe >> I was looking in the wrong place. > > I don't know about saving, but I have written a tool that rotates and > resizes images. That tool uses NSAffineTransformations to do the job. Saving shouldn't be a problem, considering you can print anything you can see to a PDF or draw to a NSImage. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040711/0d5b5d91/smime.bin From altis at semi-retired.com Sun Jul 11 19:49:26 2004 From: altis at semi-retired.com (Kevin Altis) Date: Sun Jul 11 19:49:30 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> References: <52755489.1089540562@[192.168.1.100]> <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> Message-ID: On Jul 11, 2004, at 10:20 AM, Ronald Oussoren wrote: > > On 11-jul-04, at 19:09, David Eppstein wrote: > >> On 7/11/04 6:10 PM +0200 Ronald Oussoren >> wrote: >>> PyObjC currently has no support for PIL images. >>> >>> BTW. Why do you have to display PIL images? Cocoa has support for >>> displaying images and transforming them. >> >> I guess I don't, but the code I was porting involved using PIL to >> resize and display images. Does Cocoa have routines for rotation, >> antialiased downsizing, and saving back out to jpeg? I didn't see >> them in a quick scan of the Cocoa "Drawing and Images" doc but maybe >> I was looking in the wrong place. > > I don't know about saving, but I have written a tool that rotates and > resizes images. That tool uses NSAffineTransformations to do the job. > Just for comparison, wxPython can handle rotation, scaling, and saving as well. IIRC, PIL has a better looking anti-aliasing downsizing algorithm, but as shown earlier, conversion to and from PIL to and from wxPython wxImage/wxBitmap is simple and depending on the type of images you're dealing with and percentage scaled you might not be able to tell the difference. You can read and save images in all the popular formats. For the most part, all these types of operations are one-liner method calls. The big plus is that whatever code you write will end up working the same on Windows and Linux, not just Mac OS X. Okay, I'm done plugging for today ;-) ka --- Kevin Altis altis@semi-retired.com http://altis.pycs.net/ http://www.pythoncard.org/ From bob at redivi.com Sun Jul 11 19:52:49 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Jul 11 19:52:56 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <52862759.1089542350@[192.168.1.100]> References: <52755489.1089540562@[192.168.1.100]> <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> <11ECEA7F-D360-11D8-99A1-000A95686CD8@redivi.com> <52862759.1089542350@[192.168.1.100]> Message-ID: <1FD35B03-D363-11D8-B214-000A95686CD8@redivi.com> On Jul 11, 2004, at 1:39 PM, David Eppstein wrote: > On 7/11/04 1:30 PM -0400 Bob Ippolito wrote: >>> I don't know about saving, but I have written a tool that rotates and >>> resizes images. That tool uses NSAffineTransformations to do the job. >> >> Saving shouldn't be a problem, considering you can print anything you >> can >> see to a PDF or draw to a NSImage. > > It is an absolute requirement that I save to a jpeg programmatically, > not pdf via a print dialog (that is the whole point of the program I'm > porting -- it's the one I'm using to create web photo galleries). But > it seems that saving to jpeg can be done via > NSBitmapImageRep.representationUsingType_properties_. Well it's also absolutely possible to print to a PDF without using a print dialog. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040711/3e8263d3/smime-0001.bin From bob at redivi.com Sun Jul 11 19:57:47 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Jul 11 19:57:49 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <1FD35B03-D363-11D8-B214-000A95686CD8@redivi.com> References: <52755489.1089540562@[192.168.1.100]> <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> <11ECEA7F-D360-11D8-99A1-000A95686CD8@redivi.com> <52862759.1089542350@[192.168.1.100]> <1FD35B03-D363-11D8-B214-000A95686CD8@redivi.com> Message-ID: On Jul 11, 2004, at 1:52 PM, Bob Ippolito wrote: > On Jul 11, 2004, at 1:39 PM, David Eppstein wrote: > >> On 7/11/04 1:30 PM -0400 Bob Ippolito wrote: >>>> I don't know about saving, but I have written a tool that rotates >>>> and >>>> resizes images. That tool uses NSAffineTransformations to do the >>>> job. >>> >>> Saving shouldn't be a problem, considering you can print anything >>> you can >>> see to a PDF or draw to a NSImage. >> >> It is an absolute requirement that I save to a jpeg programmatically, >> not pdf via a print dialog (that is the whole point of the program >> I'm porting -- it's the one I'm using to create web photo galleries). >> But it seems that saving to jpeg can be done via >> NSBitmapImageRep.representationUsingType_properties_. > > Well it's also absolutely possible to print to a PDF without using a > print dialog. Just to clarify, you can do any kind of printing you want without using a print dialog. Automated printing is not specific to PDF output. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040711/aaceb03e/smime.bin From sw at wordtech-software.com Sun Jul 11 21:12:55 2004 From: sw at wordtech-software.com (Kevin Walzer) Date: Sun Jul 11 21:12:59 2004 Subject: [Pythonmac-SIG] W widgets/Carbon modules In-Reply-To: <20040711175258.7BFCB1E4008@bag.python.org> References: <20040711175258.7BFCB1E4008@bag.python.org> Message-ID: <40F19137.8080801@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm learning Python in conjunction with some other languages (C, Tcl, AppleScript) and it seems that a lot of my interests are converging on Carbon frameworks/AppleEvents/etc. I'd like to hook Python into this learning process, because I know that there's a lot of support for Carbon modules in Python on the Mac. But I had a few questions: 1. Will MacPython continue to support Carbon in the future? PyObjC is promoted so heavily on the list, and I see a great deal of talk about Cocoa--but not about Carbon. I know wxPython is Carbon, but I'm not ready to learn wxPython (or PyObjC at this point). I know all the arguments *against* Carbon, but that's where I want to spend my time right now--however, I don't want to focus on Python here if Carbon support is going away. 2. A related question--is the W widget set deprecated/going away/to be replaced by PyObjC or just not actively developed at this point? I hardly see any discusison of it here, but it looks like a nice, lightweight tool for simple GUI apps (apart from Tkinter, which doesn't look as good), which is what I need at this stage of my learning. 3. PythonIDE is a nice, user-friendly application that looks good--am I correct that this application uses the W widget set and can be described as a "pure Carbon" application (one that taps into Carbon without external frameworks like wxPython or Tkinter)? Are there any other example apps out there that also use the W widget set? Thanks for any input anyone can provide. 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 iD8DBQFA8ZE2F6m9qPmThLQRAtmWAJ4jiSoi0PunawDc65G5WRU4WD8pyACfWqtF oWPNfpiep/GIN1q9FxxtLD0= =wE2V -----END PGP SIGNATURE----- From eppstein at ics.uci.edu Sun Jul 11 19:09:22 2004 From: eppstein at ics.uci.edu (David Eppstein) Date: Sun Jul 11 22:38:39 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: References: Message-ID: <52755489.1089540562@[192.168.1.100]> On 7/11/04 6:10 PM +0200 Ronald Oussoren wrote: > PyObjC currently has no support for PIL images. > > BTW. Why do you have to display PIL images? Cocoa has support for > displaying images and transforming them. I guess I don't, but the code I was porting involved using PIL to resize and display images. Does Cocoa have routines for rotation, antialiased downsizing, and saving back out to jpeg? I didn't see them in a quick scan of the Cocoa "Drawing and Images" doc but maybe I was looking in the wrong place. -- David Eppstein http://www.ics.uci.edu/~eppstein/ Univ. of California, Irvine, School of Information & Computer Science From eppstein at ics.uci.edu Sun Jul 11 19:36:27 2004 From: eppstein at ics.uci.edu (David Eppstein) Date: Sun Jul 11 22:39:00 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> References: <52755489.1089540562@[192.168.1.100]> <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> Message-ID: <52852978.1089542187@[192.168.1.100]> On 7/11/04 7:20 PM +0200 Ronald Oussoren wrote: >> I guess I don't, but the code I was porting involved using PIL to >> resize and display images. Does Cocoa have routines for rotation, >> antialiased downsizing, and saving back out to jpeg? I didn't see >> them in a quick scan of the Cocoa "Drawing and Images" doc but maybe I >> was looking in the wrong place. > > I don't know about saving, but I have written a tool that rotates and > resizes images. That tool uses NSAffineTransformations to do the job. Looks like what I want is NSBitmapImageRep.representationUsingType_Properties(NSJPEGFileType, {NSImageCompressionFactor:...}).writeToFile_atomically_(...) which is a little clunkier than PIL's Image.save(...) but I guess not too horrible. I suppose I should do some experimenting to find out how to use NSAffineTransformation to downsize and whether the results are properly antialiased... -- David Eppstein http://www.ics.uci.edu/~eppstein/ Univ. of California, Irvine, School of Information & Computer Science From eppstein at ics.uci.edu Sun Jul 11 19:39:10 2004 From: eppstein at ics.uci.edu (David Eppstein) Date: Sun Jul 11 22:39:21 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <11ECEA7F-D360-11D8-99A1-000A95686CD8@redivi.com> References: <52755489.1089540562@[192.168.1.100]> <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> <11ECEA7F-D360-11D8-99A1-000A95686CD8@redivi.com> Message-ID: <52862759.1089542350@[192.168.1.100]> On 7/11/04 1:30 PM -0400 Bob Ippolito wrote: >> I don't know about saving, but I have written a tool that rotates and >> resizes images. That tool uses NSAffineTransformations to do the job. > > Saving shouldn't be a problem, considering you can print anything you can > see to a PDF or draw to a NSImage. It is an absolute requirement that I save to a jpeg programmatically, not pdf via a print dialog (that is the whole point of the program I'm porting -- it's the one I'm using to create web photo galleries). But it seems that saving to jpeg can be done via NSBitmapImageRep.representationUsingType_properties_. -- David Eppstein http://www.ics.uci.edu/~eppstein/ Univ. of California, Irvine, School of Information & Computer Science From mwh at python.net Mon Jul 12 15:05:09 2004 From: mwh at python.net (Michael Hudson) Date: Mon Jul 12 15:05:19 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> (Ronald Oussoren's message of "Sun, 11 Jul 2004 19:20:10 +0200") References: <52755489.1089540562@[192.168.1.100]> <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> Message-ID: <2m1xjhtlyy.fsf@starship.python.net> Ronald Oussoren writes: > On 11-jul-04, at 19:09, David Eppstein wrote: > >> On 7/11/04 6:10 PM +0200 Ronald Oussoren >> wrote: >>> PyObjC currently has no support for PIL images. >>> >>> BTW. Why do you have to display PIL images? Cocoa has support for >>> displaying images and transforming them. >> >> I guess I don't, but the code I was porting involved using PIL to >> resize and display images. Does Cocoa have routines for rotation, >> antialiased downsizing, and saving back out to jpeg? I didn't see >> them in a quick scan of the Cocoa "Drawing and Images" doc but maybe >> I was looking in the wrong place. > > I don't know about saving, but I have written a tool that rotates and > resizes images. That tool uses NSAffineTransformations to do the job. What's the quality like? I've used NSImage to resize images (not using NSAffineTransformations but rather an obscure series of hacks I don't want to go into) and was underwhelmed by the results... Cheers, mwh -- Just point your web browser at http://www.python.org/search/ and look for "program", "doesn't", "work", or "my". Whenever you find someone else whose program didn't work, don't do what they did. Repeat as needed. -- Tim Peters, on python-help, 16 Jun 1998 From ronaldoussoren at mac.com Mon Jul 12 15:22:14 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon Jul 12 15:22:45 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <2m1xjhtlyy.fsf@starship.python.net> References: <52755489.1089540562@[192.168.1.100]> <8FED3570-D35E-11D8-9A6D-0003931CFE24@mac.com> <2m1xjhtlyy.fsf@starship.python.net> Message-ID: <7D357209-D406-11D8-B5AD-0003931CFE24@mac.com> On 12-jul-04, at 15:05, Michael Hudson wrote: > Ronald Oussoren writes: > >> On 11-jul-04, at 19:09, David Eppstein wrote: >> >>> On 7/11/04 6:10 PM +0200 Ronald Oussoren >>> wrote: >>>> PyObjC currently has no support for PIL images. >>>> >>>> BTW. Why do you have to display PIL images? Cocoa has support for >>>> displaying images and transforming them. >>> >>> I guess I don't, but the code I was porting involved using PIL to >>> resize and display images. Does Cocoa have routines for rotation, >>> antialiased downsizing, and saving back out to jpeg? I didn't see >>> them in a quick scan of the Cocoa "Drawing and Images" doc but maybe >>> I was looking in the wrong place. >> >> I don't know about saving, but I have written a tool that rotates and >> resizes images. That tool uses NSAffineTransformations to do the job. > > What's the quality like? I've used NSImage to resize images (not > using NSAffineTransformations but rather an obscure series of hacks I > don't want to go into) and was underwhelmed by the results... Good enough. The result was at least as good as the Windows program that was doing the job at the time. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From ghoover19 at cox.net Tue Jul 13 21:00:20 2004 From: ghoover19 at cox.net (Greg Hoover) Date: Tue Jul 13 21:00:24 2004 Subject: [Pythonmac-SIG] Python data structures Message-ID: While this isn't a mac-specific question, is anyone aware of Python implementations of various tree data structures? I'm specifically looking for a hash tree implementation, but would settle for modifying something close. Thanks in advance. --Greg From nbastin at opnet.com Tue Jul 13 21:25:44 2004 From: nbastin at opnet.com (Nick Bastin) Date: Tue Jul 13 21:26:17 2004 Subject: [Pythonmac-SIG] Python data structures In-Reply-To: References: Message-ID: <6F3D1EA4-D502-11D8-91CD-000D932927FE@opnet.com> On Jul 13, 2004, at 3:00 PM, Greg Hoover wrote: > While this isn't a mac-specific question, is anyone aware of Python > implementations of various tree data structures? I'm specifically > looking for a hash tree implementation, but would settle for modifying > something close. I don't understand - do you want these data structures written in Python, or written in C and exposed to Python? -- Nick From Jack.Jansen at cwi.nl Tue Jul 13 22:07:41 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Jul 13 22:07:38 2004 Subject: [Pythonmac-SIG] Accented characters In-Reply-To: References: Message-ID: <4B8B7A6D-D508-11D8-AD25-000D934FF6B4@cwi.nl> I knew there was a solution to this, but it wasn't easy to find:-) But I did find it: see for an explanation on how to state the encoding of your sourcefile. And the easiest way to do it is to save your file as UTF-8 and with BOM marks. I think BBEdit has an option to save files in this format. On 10 Jul 2004, at 23:22, Quarante-Deux wrote: > I'm new to python and I need to process some text written in French > with various accented characters. > > I have read about the locale module and codecs and anything else I > could find to no avail. > > In IDLE I can't even type an accented character. > > In Terminal, I must activite "escape non ASCII characters" in the > Emulation setting. > > If I write a script that writes a file to disk I never get anything > good either. > > I have tried various combinations of locale.setlocale, and also > various combinations of unicode and locale settings for the re module. > Nothing works. > > I need: > 1/ to be able to sort correctly > 2/ to be able to have regular expressions recognize word boundaries > correctly. > > I'm using Mac OSX with the preinstalled Python 2.3.3. I either use > IDLE or BBEdit and the Terminal. > > Thanks for any help. > > Ellen > -- > ------------------------------------------------------------------- > xlii@xlii.org | Ellen C. Herzfeld > http://www.quarante-deux.org/ | Dominique O. Martel > Quelques pages sur la Science-Fiction | Quarante-Deux > ------------------------------------------------------------------- > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- 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 Tue Jul 13 22:12:30 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Jul 13 22:12:23 2004 Subject: [Pythonmac-SIG] Where is Python.h on OS X? In-Reply-To: References: <244C60EE-D2F3-11D8-BC1F-000A9574CFD8@earthlink.net> <20040711044814.GB9757@server.onjapan.net> Message-ID: On 11 Jul 2004, at 17:27, Glenn Andreas wrote: >> For 10.3: >> /System/Library/Frameworks/Python.framework/Versions/2.3/include/ >> python2.3/ >> > > It's a bit more subtle than that (especially when using XCode with the > various OS SDK's installed). > > Normally, from XCode, you can just "add framework", select Python (in > /System/Library/Frameworks) and then do #include and > everything will work. That's the easy answer. But I would advise against this. This is the best solution for the Mac, but it has the disadvantage that it uses in stead of as on other platforms, which leads to platform incompatibilities. Apple also advises against this (but I don't remember exactly where, probably in the "porting to OSX" documentation). By far the best solution is to use distutils (as suggested by someone else already), the second-best solution is to is -I with a (configure generated) path of /System/Library/Frameworks/Python.framework/Versions/2.3/include/ python2.3 or /Library/Frameworks/Python.framework/Versions/2.3/include/python2.3. -- 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 Tue Jul 13 22:23:31 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Jul 13 22:23:24 2004 Subject: [Pythonmac-SIG] W widgets/Carbon modules In-Reply-To: <40F19137.8080801@wordtech-software.com> References: <20040711175258.7BFCB1E4008@bag.python.org> <40F19137.8080801@wordtech-software.com> Message-ID: <820664DD-D50A-11D8-AD25-000D934FF6B4@cwi.nl> On 11 Jul 2004, at 21:12, Kevin Walzer wrote: > 1. Will MacPython continue to support Carbon in the future? Yes, definitely. Apple isn't putting much development in Carbon per se, so it isn't much work to maintain it. Moreover, some technology still heavily depends on Carbon, and/or is much richer in Carbon than in Cocoa. OSA/Applescript and QuickTime, to name two. CoreFoundation is also the only way to get at some of the exciting stuff without going through ObjCm and while CF isn't Carbon in Apple's terminology the two are intertwined in the MacPython implementation. > 2. A related question--is the W widget set deprecated/going away/to be > replaced by PyObjC or just not actively developed at this point? This is a different question. W is not actively being developed, and it is indeed likely to go away (or at least remain unmaintained). It has two serious problems: - It predates even MacOS8, which means it is not Appearance Manager compatible, which means that it doesn't automatically gets the OSX Carbon "good looks". Fixing this is a lot of work. - All the text editing and some display widgets ultimately depend on a third party library, Waste, which has a bit of a funny license. This isn't a problem for Python (we've discussed that with the author), but it is a problem for Apple. Which means Apple won't ship the waste module for Python, which means W will never be complete without additional downloads. > 3. PythonIDE is a nice, user-friendly application that looks good--am I > correct that this application uses the W widget set and can be > described > as a "pure Carbon" application (one that taps into Carbon without > external frameworks like wxPython or Tkinter)? Are there any other > example apps out there that also use the W widget set? Package Manager is the only one in the distribution. -- 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 Tue Jul 13 22:29:22 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Jul 13 22:29:14 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: References: Message-ID: <533630C0-D50B-11D8-AD25-000D934FF6B4@cwi.nl> On 11 Jul 2004, at 18:10, Ronald Oussoren wrote: > > On 11-jul-04, at 6:50, David Eppstein wrote: > >> I have a Wapplication app that I'm trying to port to something that >> runs >> under the Panther command-line python. It needs to be able to display >> PIL Images. Is this possible under Cocoa with PyObjC or am I stuck >> with >> ugly Tkinter? > > PyObjC currently has no support for PIL images. > > BTW. Why do you have to display PIL images? Cocoa has support for > displaying images and transforming them. But still: it would be good to have an example PyObjC program that does the same as the Tkinter-based PIL image viewer. Even if only because it'll support any image format for which PIL has support, and other Python packages that have a bridge to PIL (such as Numeric). -- 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 eppstein at ics.uci.edu Tue Jul 13 23:07:41 2004 From: eppstein at ics.uci.edu (David Eppstein) Date: Tue Jul 13 23:07:47 2004 Subject: [Pythonmac-SIG] Re: PIL gui with Panther python? References: <533630C0-D50B-11D8-AD25-000D934FF6B4@cwi.nl> Message-ID: In article <533630C0-D50B-11D8-AD25-000D934FF6B4@cwi.nl>, Jack Jansen wrote: > On 11 Jul 2004, at 18:10, Ronald Oussoren wrote: > > PyObjC currently has no support for PIL images. > > > > BTW. Why do you have to display PIL images? Cocoa has support for > > displaying images and transforming them. > > But still: it would be good to have an example PyObjC program that does > the same as the Tkinter-based PIL image viewer. Even if only because > it'll support any image format for which PIL has support, and other > Python packages that have a bridge to PIL (such as Numeric). Another reason for wishing for PIL support in PyObjC, or at least some means of interoperating between the two: if your program is written in good MVC style (which the previous version of the one I was working on very much was not) then, even if the view part is platform-specific PyObjC Cocoa for that yummy native look'n'feel, it would still be good to have a more portable model. So, if the model involves image processing, portability for Python means doing it in PIL rather than Cocoa. -- David Eppstein http://www.ics.uci.edu/~eppstein/ Univ. of California, Irvine, School of Information & Computer Science From Jack.Jansen at cwi.nl Wed Jul 14 00:06:14 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed Jul 14 00:06:10 2004 Subject: [Pythonmac-SIG] Non-pyobjc MVC example In-Reply-To: References: <533630C0-D50B-11D8-AD25-000D934FF6B4@cwi.nl> Message-ID: Changing the subject, and addding pyobjc-dev to the distribution here: On 13 Jul 2004, at 23:07, David Eppstein wrote: > Another reason for wishing for PIL support in PyObjC, or at least some > means of interoperating between the two: if your program is written in > good MVC style (which the previous version of the one I was working on > very much was not) then, even if the view part is platform-specific > PyObjC Cocoa for that yummy native look'n'feel, it would still be good > to have a more portable model. So, if the model involves image > processing, portability for Python means doing it in PIL rather than > Cocoa. Ah, yes! One of the things that I would like to have in the PyObjC distribution (but haven't had the time to write:-) is an example using Model-View-Controller, and showing how you would write a cross-platform app that used PyObjC/Interface Builder on the Mac and something else on other platforms. Anyone willing to pick this one up? -- 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 kenneth.m.mcdonald at sbcglobal.net Wed Jul 14 03:49:33 2004 From: kenneth.m.mcdonald at sbcglobal.net (Kenneth McDonald) Date: Wed Jul 14 03:49:38 2004 Subject: [Pythonmac-SIG] Problems compiling matplotlib; OR, how to make headers accessible in OS X? Message-ID: <0DD608C4-D538-11D8-98FB-000A956870AC@sbcglobal.net> I'm attempting to compile matplotlib, and get messages saying that it can't find the headers for Tcl/Tk. They exist, they just happen to be in the Frameworks directories for Tcl and for Tk. I know I can get this to work by hacking (setting up path variables, putting symbolic links in directories, or some such), but aside from the fact that that's a pain and ugly, it doesn't solve the more general problem; if header files are supposed to be in Frameworks directories (for example, I found my Tk header files in /Library/Frameworks/Tk.framework/Headers), what is the best way to set up OS X so that they will be available to link against? Note that I don't know that these headers are supposed to be there; they just are, and for the time being, I'm assuming that the person who put together Tk.Framework knew what they were doing. I also have a more general (and much less important) question relating to this, purely for my own interest. Why (on all systems, not just on OS X) do we still have to go through this annoyance (and occasionally, nightmare) of requiring access to header sources, in order to link against existing binaries? Why not simply have the binaries contain all of the information necessary to perform the linking? Is this simply a historical holdover from the fact that it wasn't done that way originally (probably for good reasons at the time), and its too much trouble to change, or are there valid reasons for not doing this still? In some sense, putting headers into a Frameworks structure is an attempt to include that information a part of a package wrapping the libraries of interest; it seems to me that it would make a lot more sense (from a design point of view, at least) to include that info in the library binary files themselves. Thanks, Ken McDonald From bob at redivi.com Wed Jul 14 04:23:11 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed Jul 14 04:23:34 2004 Subject: [Pythonmac-SIG] Problems compiling matplotlib; OR, how to make headers accessible in OS X? In-Reply-To: <0DD608C4-D538-11D8-98FB-000A956870AC@sbcglobal.net> References: <0DD608C4-D538-11D8-98FB-000A956870AC@sbcglobal.net> Message-ID: On Jul 13, 2004, at 9:49 PM, Kenneth McDonald wrote: > I'm attempting to compile matplotlib, and get messages saying that > it can't find the headers for Tcl/Tk. They exist, they just happen to > be in the Frameworks directories for Tcl and for Tk. I know I can > get this to work by hacking (setting up path variables, putting > symbolic > links in directories, or some such), but aside from the fact that > that's > a pain and ugly, it doesn't solve the more general problem; if header > files are supposed to be in Frameworks directories (for example, I > found my Tk header files in /Library/Frameworks/Tk.framework/Headers), > what is the best way to set up OS X so that they will be available to > link > against? Note that I don't know that these headers are supposed to be > there; they just are, and for the time being, I'm assuming that the > person who put together Tk.Framework knew what they were doing. Short answer: Whatever you're trying to build is DOING IT WRONG by not using tclConfig.sh (they should allow the user to choose which one, but should default to /usr/lib/tclConfig.sh I guess). This is equivalent to not using distutils. It probably won't be a problem in the Mac OS X future however, because... Apple's latest strategy for unixy stuff (at least for Python) seems to be a hybrid approach that should please almost anyone: (1) the actual dylib lives in /usr/lib and has a mach-o id pointing to /usr/lib (2) the framework has symlinks to /usr/lib for its dylib (3) the headers live in the framework (4) /usr/include has appropriate symlinks into the framework [I can say this without breaking NDA because Apple has publicly released their sources for Python in Darwin 8.0.0b1] > I also have a more general (and much less important) question relating > to this, purely for my own interest. Why (on all systems, not just on > OS X) > do we still have to go through this annoyance (and occasionally, > nightmare) > of requiring access to header sources, in order to link against > existing > binaries? Why not simply have the binaries contain all of the > information > necessary to perform the linking? Is this simply a historical holdover > from > the fact that it wasn't done that way originally (probably for good > reasons > at the time), and its too much trouble to change, or are there valid > reasons > for not doing this still? In some sense, putting headers into a > Frameworks > structure is an attempt to include that information a part of a package > wrapping the libraries of interest; it seems to me that it would make a > lot more sense (from a design point of view, at least) to include that > info > in the library binary files themselves. I think that putting the headers in the framework makes more sense. Putting it in the binary would be a major pain in the ass for the compiler, linker, etc. Would you rather have an arbitrary per-platform binary format (like resource forks and whatever the hell windows does to get resources in its exes and dlls), or an easy to create and dissect cross-platform "opaque" directory structure (frameworks)? From experience, the latter is WAY easier to live with. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040713/d9862e15/smime-0001.bin From eichin at metacarta.com Wed Jul 14 08:20:54 2004 From: eichin at metacarta.com (eichin@metacarta.com) Date: Wed Jul 14 08:21:13 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <533630C0-D50B-11D8-AD25-000D934FF6B4@cwi.nl> References: <533630C0-D50B-11D8-AD25-000D934FF6B4@cwi.nl> Message-ID: <7geknfun21.fsf@pikespeak.metacarta.com> > does the same as the Tkinter-based PIL image viewer. Even if only > because it'll support any image format for which PIL has support, and Maybe this is naive, but wouldn't it make more sense to do a MacPIL which had a PIL API but substituted the Mac NS* interfaces underneath? (My photo-captioning app needed to be fast on osx (the laptop I sit in front of) and portable - I tried wx+pil, and now use pyGame and cheat a bit - and I haven't tried the Mac interfaces to see how they compared to whatever pygame+sdl sit on top of, but a MacPIL... especially one that took advantage of Tiger's new GPU-enabled CoreImage features... would seem attractive...) From ronaldoussoren at mac.com Wed Jul 14 09:20:08 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed Jul 14 09:20:23 2004 Subject: [Pythonmac-SIG] PIL gui with Panther python? In-Reply-To: <7geknfun21.fsf@pikespeak.metacarta.com> References: <533630C0-D50B-11D8-AD25-000D934FF6B4@cwi.nl> <7geknfun21.fsf@pikespeak.metacarta.com> Message-ID: <3C66BAF7-D566-11D8-8A5D-0003931CFE24@mac.com> On 14-jul-04, at 8:20, eichin@metacarta.com wrote: > >> does the same as the Tkinter-based PIL image viewer. Even if only >> because it'll support any image format for which PIL has support, and > > Maybe this is naive, but wouldn't it make more sense to do a MacPIL > which had a PIL API but substituted the Mac NS* interfaces underneath? Maybe in the long run. Does PIL have a good enough specification and unittests to verify that this MacPIL works exactly like the normal PIL? In the short run it is more important to have something that actually works :-) Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From kenneth.m.mcdonald at sbcglobal.net Thu Jul 15 00:07:28 2004 From: kenneth.m.mcdonald at sbcglobal.net (Kenneth McDonald) Date: Thu Jul 15 00:07:35 2004 Subject: [Pythonmac-SIG] Still trying to get matplotlib to compile Message-ID: <320E854E-D5E2-11D8-9D52-000A956870AC@sbcglobal.net> Many thanks to Bob Ippolito for his help--I've included my original message and his reply at the end of this message, for reference. After reading Bob's message, I looked into /usr/lib and found that while it contained a tclConfig.sh, there was no tkConfig.sh. A search of the file system revealed a tkConfig.sh in /Library/Framewords/Tk.framework, so I copied it there. While I suspect this was a Good Thing To Do, it still hasn't solved the problem of matplotlib's setup.py not being able to find the tcl/tk headers. Here's my attempt at building and the resultant message: ken% python setup.py build GTKAgg requires pygtk cannot find tcl/tk headers. giving up. The message about "GTKAgg" is expected and should be ignored. Attempting a "python setup.py -v build" gave exactly the same error messages. Unfortunately the error message about the header, while to the point, isn't terribly helpful :-) matplotlib is packaged using distutil, and presumably distutil isn't getting the info it needs to figure out where the headers are. I've started reading about distutil, but am a novice at it (and it's a fairly involved package, as well), so if others could offer suggestions as to how to track down/fix this problem, it would be a real help. Cheers, Ken >> I'm attempting to compile matplotlib, and get messages saying that >> it can't find the headers for Tcl/Tk. They exist, they just happen to >> be in the Frameworks directories for Tcl and for Tk. I know I can >> get this to work by hacking (setting up path variables, putting >> symbolic >> links in directories, or some such), but aside from the fact that >> that's >> a pain and ugly, it doesn't solve the more general problem; if header >> files are supposed to be in Frameworks directories (for example, I >> found my Tk header files in /Library/Frameworks/Tk.framework/Headers), >> what is the best way to set up OS X so that they will be available to >> link >> against? Note that I don't know that these headers are supposed to be >> there; they just are, and for the time being, I'm assuming that the >> person who put together Tk.Framework knew what they were doing. > > Short answer: Whatever you're trying to build is DOING IT WRONG by > not using tclConfig.sh (they should allow the user to choose which > one, but should default to /usr/lib/tclConfig.sh I guess). This is > equivalent to not using distutils. It probably won't be a problem in > the Mac OS X future however, because... > > Apple's latest strategy for unixy stuff (at least for Python) seems to > be a hybrid approach that should please almost anyone: > (1) the actual dylib lives in /usr/lib and has a mach-o id pointing > to /usr/lib > (2) the framework has symlinks to /usr/lib for its dylib > (3) the headers live in the framework > (4) /usr/include has appropriate symlinks into the framework > > [I can say this without breaking NDA because Apple has publicly > released their sources for Python in Darwin 8.0.0b1] From bob at redivi.com Thu Jul 15 00:33:27 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu Jul 15 00:33:53 2004 Subject: [Pythonmac-SIG] Still trying to get matplotlib to compile In-Reply-To: <320E854E-D5E2-11D8-9D52-000A956870AC@sbcglobal.net> References: <320E854E-D5E2-11D8-9D52-000A956870AC@sbcglobal.net> Message-ID: distutils is only good at finding Python's compiler/linker settings and Python's headers. matplotlib has custom code to find Tcl/Tk in its setup.py, and that custom code is not doing the right thing. I suggest you bring this up with them, I don't have time to take a closer look. -bob On Jul 14, 2004, at 6:07 PM, Kenneth McDonald wrote: > Many thanks to Bob Ippolito for his help--I've included my original > message and his reply at the end of this message, for reference. > > After reading Bob's message, I looked into /usr/lib and found that > while > it contained a tclConfig.sh, there was no tkConfig.sh. A search of the > file system revealed a tkConfig.sh in > /Library/Framewords/Tk.framework, so > I copied it there. > > While I suspect this was a Good Thing To Do, it still hasn't solved > the problem of matplotlib's setup.py not being able to find the tcl/tk > headers. Here's my attempt at building and the resultant message: > > ken% python setup.py build > GTKAgg requires pygtk > cannot find tcl/tk headers. giving up. > > The message about "GTKAgg" is expected and should be ignored. > Attempting > a "python setup.py -v build" gave exactly the same error messages. > Unfortunately > the error message about the header, while to the point, isn't terribly > helpful :-) > > matplotlib is packaged using distutil, and presumably distutil isn't > getting > the info it needs to figure out where the headers are. I've started > reading > about distutil, but am a novice at it (and it's a fairly involved > package, as > well), so if others could offer suggestions as to how to track > down/fix this > problem, it would be a real help. > > Cheers, > Ken > >>> I'm attempting to compile matplotlib, and get messages saying that >>> it can't find the headers for Tcl/Tk. They exist, they just happen to >>> be in the Frameworks directories for Tcl and for Tk. I know I can >>> get this to work by hacking (setting up path variables, putting >>> symbolic >>> links in directories, or some such), but aside from the fact that >>> that's >>> a pain and ugly, it doesn't solve the more general problem; if header >>> files are supposed to be in Frameworks directories (for example, I >>> found my Tk header files in >>> /Library/Frameworks/Tk.framework/Headers), >>> what is the best way to set up OS X so that they will be available >>> to link >>> against? Note that I don't know that these headers are supposed to be >>> there; they just are, and for the time being, I'm assuming that the >>> person who put together Tk.Framework knew what they were doing. >> >> Short answer: Whatever you're trying to build is DOING IT WRONG by >> not using tclConfig.sh (they should allow the user to choose which >> one, but should default to /usr/lib/tclConfig.sh I guess). This is >> equivalent to not using distutils. It probably won't be a problem in >> the Mac OS X future however, because... >> >> Apple's latest strategy for unixy stuff (at least for Python) seems >> to be a hybrid approach that should please almost anyone: >> (1) the actual dylib lives in /usr/lib and has a mach-o id pointing >> to /usr/lib >> (2) the framework has symlinks to /usr/lib for its dylib >> (3) the headers live in the framework >> (4) /usr/include has appropriate symlinks into the framework >> >> [I can say this without breaking NDA because Apple has publicly >> released their sources for Python in Darwin 8.0.0b1] > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040714/650f3c81/smime.bin From delza at alliances.org Thu Jul 15 07:50:23 2004 From: delza at alliances.org (Dethe Elza) Date: Thu Jul 15 11:46:30 2004 Subject: [Pythonmac-SIG] Re: Non-pyobjc MVC example Message-ID: I'm interested in working on this (an example of model-view-controller) which would use PyObjC on Mac and wxPython on other platforms. I've begun work on the view in both libraries, and wiring it up to the model, but need to factor out the controller better. I'll be getting back to this project after or around the Vancouver Python Workshop at the end of the month (have to work on my presentation until then). --Dethe When all else fails, men turns to reason. --Abba Eban -------------- 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/20040714/7e0c6ccb/smime.bin From Jack.Jansen at cwi.nl Thu Jul 15 12:19:21 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Jul 15 12:19:16 2004 Subject: [Pythonmac-SIG] Still trying to get matplotlib to compile In-Reply-To: References: <320E854E-D5E2-11D8-9D52-000A956870AC@sbcglobal.net> Message-ID: <6FEEF4F2-D648-11D8-8BD2-000D934FF6B4@cwi.nl> On 15 Jul 2004, at 00:33, Bob Ippolito wrote: > distutils is only good at finding Python's compiler/linker settings > and Python's headers. > > matplotlib has custom code to find Tcl/Tk in its setup.py, and that > custom code is not doing the right thing. I suggest you bring this up > with them, I don't have time to take a closer look. Most setup.py scripts have a method detect_tkinter() that at some point has been copied from Python's main setup.py and modified to suit the needs of the package. As tcl/tk on MacOSX is organized differently from the way it is on onther unixen (or windows, for that matter) this needs work. setup.py from a python source distribution may be a good starting point. Another good starting point would be setup.py from PIL, which doesn't derive from detect_tkinter(). See which of these matches your matplotlib setup.py best and pick up the modifications. And don't forget to post your changes back to the matplotlib folks... -- 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 hengist.podd at virgin.net Thu Jul 15 17:43:52 2004 From: hengist.podd at virgin.net (has) Date: Thu Jul 15 17:44:14 2004 Subject: [Pythonmac-SIG] Re: improving appscript architecture In-Reply-To: <83650530-D1E9-11D8-AD24-000D934FF6B4@cwi.nl> References: <20040706211902.3C3DA1E4017@bag.python.org> <40EB2340.3000503@san.rr.com> <83650530-D1E9-11D8-AD24-000D934FF6B4@cwi.nl> Message-ID: Jack wrote: >>Given that I'm angling for appscript's eventual inclusion in the >>standard MacPython library, the code needs to be grokkable and >>maintainable by others (lest I be hit by the Proverbial Bus >>someday). > >I'm very interested in understanding this (as I'll probably be the >default maintainer if it gets included in the standard distribution) >but I have tried a couple of times to understand your message and I >simply can't seem to grok it. Can't blame ya. I wrote that stuff in a hurry before zipping off for the week; I don't think I could understand it now either. :p >Could you come up with a more concrete example of what the problem >is that you're trying to solve? Or, alternatively, explain the >architecture that you're using for appscript at the moment. For now I'll answer the latter. This rebuild gets rid of appscript 0.5.0's monolithic design. While it works, everything is dependent on everything else so it doesn't adapt well to multiple uses. The new architecture consists of lots of small, simple, loosely-coupled packages that can be combined however you like. The two most basic packages are: - aecodecs -- convert Python data to/from Apple event data (i.e. this package is roughly equivalent to Python's aepack module, minus all the object specifier-related stuff which is now dealt with separately) - AEM -- creates AEAddressDescs and sends Apple events (i.e. roughly equivalent to the old aetools) I'll probably rename AEM to aesend at some point. I'll then rework the MiniAEFrame module to create a new package, aereceive, as a complement to aesend. These three packages should cover all your basic Apple event needs: client applications can send basic AEs using aecodecs and aesend; server applications would use aecodecs and aereceive. The next layer consists of a single package: - objspec -- extends aecodecs with support for object specifiers (raw AE codes only) This package wraps and re-exports aecodecs, adding support for object specifiers as it does so. This lets you construct object specifiers using raw 4-letter codes. Sort of what the old aetypes module does, but with a superior API. Whereas aetypes provides a bunch of loose classes that directly represent the various AE types used to construct object specifiers and leaves the user to assemble them in the right order, objspec lets you construct references via chained method calls. e.g. To refer to the text property of document 1 of an application: ref = objspec.app.elems('docu').byindex(1).prop('ctxt') Basically the same 'smart' approach used by appscript 0.5.0, but without the syntactic sugar and OSA terminology support. This API may be used directly by Python application developers who want to manipulate object specifiers without the extra overhead of working with aetes. This is the package I want to make easily extensible so other packages can merge additional functionality like syntax sugar and sanity checking to give application scripters the full 'appscript experience', or automatic name-attribute bindings and other hooks to help developers writing Python-based applications to implement scriptability. Other stuff I'm working on: - osaterms -- the new aete parser (now provides a more flexible SAX-style API), plus some useful tools that use this parser (a basic aete-to-documentation renderer, and a simple code generator for converting application terminology into Carbon.AppleEvents-like contstants modules) - aslite -- 'appscript lite' - extends objspec to allow object specifiers to be constructed using application terminology obtained via osaterms The aslite package is mostly just a testbed for seeing how objspec is panning out extensibility-wise. (Answer: not very well so far.) What I'd really like to be able to do is duplicate the entire objspec module, then insert the new behaviours directly into the duplicate's classes. (Prototype-based OO languages make this kind of powerful object extension dead easy, which is why I get a bit frustrated at class-based OO languages which are simultaneously more complex and less flexible.) >The nice side of the old gensuitemodule architecture was that it was >nicely compartmentalized, so you could really understand it a bit at >a time: the C-stuff is completely self-contained, as is aepack. >Aetypes had a bit more complexity, but it was all basically >localized. Gensuitemodule is standalone, and the two-pass >architecture made it also reasonably easy to understand. Yeah, the new appscript architecture is meant to provide the same kind of compartmentalisation, eliminating heavy coupling, circular references, etc. that prevent the old appscript's constituent parts being useful/understandable/testable outside of the complete package. (Actually, I think even the old gsm architecture is more tightly bound together than the new appscript.) >And the generated packages had (at the price of being incorrect:-) >also only limited global complexity (the name lookups being the main >one), with only limited dependency on magic implemented by aetypes. appscript did away with glues completely. There's really no value in creating proxy classes based on an application's aete: it's just a way of sugaring the API used to construct object specifiers so it looks like familiar conventional OO references rather than exotic queries, and Python lets you achieve that via __getattr__. (I believe there's other Python-to-X bridges that use the same basic technique to dress up their query-based interfaces.) The downside of sugar is it obscures mechanics, which is a nuisance for someone like yourself trying to figure out how the implementation works (this is just as true of glues, which obscure the query-centric nature of object specifiers). Objspec implements the query-building API sans sugar, so should be reasonably easy to follow once you map out the inheritance hierarchy used to compose specifier behaviours. Hope that explains the basic architecture; if it has, we can start discussing the objspec extensibility problem. Let me know. has -- http://freespace.virgin.net/hamish.sanderson/ From Jack.Jansen at cwi.nl Thu Jul 15 22:43:32 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Jul 15 22:43:21 2004 Subject: [Pythonmac-SIG] Re: improving appscript architecture In-Reply-To: References: <20040706211902.3C3DA1E4017@bag.python.org> <40EB2340.3000503@san.rr.com> <83650530-D1E9-11D8-AD24-000D934FF6B4@cwi.nl> Message-ID: I won't quote everything, but I have a couple of suggestions. Let me start by stating that I like the architecture you sketch very much. Next, the suggestions:-) Actually, there's really only one suggestion: think of a naming scheme that automatically shows which part belongs where. For example, if you name the lowlevel stuff aecodecs, aeclient and aeserver and don't reuse the "ae" prefix it's clear that they belong together and what they do. Then the next level up you have objcodecs (your objspec) which now does an obvious thing. Incidentally, his leaves the names "objclient" and "objserver" free for client and server engines that handle objspec routing, if ever you want this. An alternative naming scheme would be to push your objspec down one level and call it aeobjspec. aecodecs would then have some simple hooks to plug in to this. osaterms is clearly on the next level up, but I think I would suggest splitting the internal representation (osaterms) and the parser (osaparser? osaaeteparser?): there are already three ways to store terminology information in an application, separating this should make life easier. But what else is on this level, and how to couple the information from osaterms to the lower layers, isn't completely clear to me. And, as the amount of handwaving in your message also increases at this stage I think I'm not alone here. This coupling is exactly what causes the interdependencies in the old architecture. I'm tempted to think that metaclasses may hold the answer here, but I'm not sure (being too old to ever truly understand metaclasses:-). Something along the lines of there being metaclasses for osaobjspec, osaclient and osaserver that look at the osaterms for the class and do the right thing. The dependencies are now all within one level and downwards, I think: if aeclient gets a reply with an objspec it will pass it up to objclient, which can use objcodec to decode it to the "app.elems('docu').byindex(1).prop('ctxt')" form, which it passes up to osaclient, which can use osaobjspec to turn it into a form applicable to the application in question. The remaining difficult questions (such as how to represent "whose" clauses) now appear to be the responsibility of one module only (osaobjspec, in case of whose). -- 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 Fri Jul 16 00:00:51 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Jul 16 00:00:42 2004 Subject: [Pythonmac-SIG] Request for help for 2.4 Message-ID: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> Folks, I need help debugging things I'm doing for 2.4, so I would be grateful if people would migrate to it if they can. The most important change that is already in 2.4a1 (i.e. you can try it now!) is Bob's fix for the "two python problem": on 10.3 extensions are linked in such a way that they should work in any interpreter. *BUT* because I'm not 100% convinced yet that this fix doesn't break anything, and to ensure backwards compatibility, this feature is only enabled if you have MACOSX_DEPLOYMENT_TARGET=10.3 in your environment when configuring and building python. Currently, distutils complains if you had that setting during configure but not when building extensions. This is the safest route, but also a bit of a nuisance. For a later alpha or beta release I can see three routes we could take: 1. Do away with the whole thing because it breaks things (I don't think this will happen) 2. Leave as-is, i.e. you must have MACOSX_DEPLOYMENT_TARGET=10.3 set to enable the new functionality. 3. Make life a bit easier: if MACOSX_DEPLOYMENT_TARGET isn't set during distutils extension building we set it to the value at configure time. 4. Make life still easier: if you're on 10.3 and MACOSX_DEPLOYMENT_TARGET isn't set during configure we set it to "10.3". This means naive 10.3 users get the 2-python-fix automatically, but isn't consistent with Apple's usage (which says that MACOSX_DEPLOYMENT_TARGET defaults to 10.1). But I'm not sure of the value of Apple's default, as your object files may be 10.1 compatible if you build on 10.3 but your libraries sure aint. For now, I'd like people to build and test with MACOSX_DEPLOYMENT_TARGET=10.3 and report their findings. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Chris.Barker at noaa.gov Fri Jul 16 02:15:43 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Fri Jul 16 02:18:25 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> Message-ID: <40F71E2F.5050600@noaa.gov> Hi all, This has nothing to do with Python, but you're a helpful group of knowledgeable folks, so I thought I try. I'm trying to do some simple compilation with the command line gcc. Here is the code: #include "stdio.h" int main(){ printf("hello world\n"); return 0; } It couldn't be any simpler. However, when I try to compile it: gcc -o junk junk.c I get: ld: can't locate file for: -lcrt1.o Anyone have an idea? Shouldn't I be able to compile this very simplest of programs without providing library paths, etc. Besides that, I can't find a file with "crt1" in it on the system. -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 ronaldoussoren at mac.com Fri Jul 16 09:24:23 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri Jul 16 09:24:35 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <40F71E2F.5050600@noaa.gov> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> Message-ID: <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> It works for me (TM) :-) Did you install a different gcc? If not, did you install the platform SDK's? Ronald On Jul 16, 2004, at 2:15 AM, Chris Barker wrote: > Hi all, > > This has nothing to do with Python, but you're a helpful group of > knowledgeable folks, so I thought I try. > > I'm trying to do some simple compilation with the command line gcc. > Here is the code: > > #include "stdio.h" > > int main(){ > printf("hello world\n"); > return 0; > } > > It couldn't be any simpler. However, when I try to compile it: > > gcc -o junk junk.c > > I get: > > ld: can't locate file for: -lcrt1.o > > Anyone have an idea? Shouldn't I be able to compile this very simplest > of programs without providing library paths, etc. Besides that, I > can't find a file with "crt1" in it on the system. > > -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 > _______________________________________________ > 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 Jack.Jansen at cwi.nl Fri Jul 16 09:41:03 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Jul 16 09:40:25 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <40F71E2F.5050600@noaa.gov> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> Message-ID: <7D51BA1F-D6FB-11D8-A243-000A958D1666@cwi.nl> On 16-jul-04, at 2:15, Chris Barker wrote: > gcc -o junk junk.c > > I get: > > ld: can't locate file for: -lcrt1.o Either you haven't installed everything (such as the platform SDK, as Ronald suggests) or you'ce accidentally removed some files. crt1.o should be in /usr/lib/crt1.o. Here's the complete output of what is loaded for me, and from where: $ gcc -Wl,-whatsloaded -o junk junk.c /usr/lib/crt1.o /usr/lib/gcc/darwin/3.3/crt2.o /var/tmp//ccAFHjgl.o /usr/lib/libSystem.dylib(keymgr.o) /usr/lib/libSystem.dylib(dylib1.o) /usr/lib/libSystem.dylib(link editor) /usr/lib/libSystem.dylib(atexit.So) /usr/lib/libSystem.dylib(errno_.So) /usr/lib/libSystem.dylib(exit.So) /usr/lib/libSystem.dylib(dyld.o) /usr/lib/libSystem.dylib(abort.So) /usr/lib/libSystem.dylib(malloc.So) /usr/lib/libSystem.dylib(printf.So) /usr/lib/libSystem.dylib(getsecbyname.o) /usr/lib/libSystem.dylib(bcopy.So) /usr/lib/libSystem.dylib(pthread_getspecific.So) /usr/lib/libSystem.dylib(pthread_tsd.So) /usr/lib/libSystem.dylib(pthread.So) /usr/lib/libSystem.dylib(_eprintf.o) /usr/lib/libSystem.dylib(init_cpu_capabilities.So) /usr/lib/libSystem.dylib(get_cpu_capabilities.So) /usr/lib/libSystem.dylib(sqrt970.o) /usr/lib/libSystem.dylib(pthread_mutex.So) /usr/lib/libSystem.dylib(pthread_self.So) /usr/lib/libSystem.dylib(_exit.So) /usr/lib/libSystem.dylib(getpid.So) /usr/lib/libSystem.dylib(kill.So) /usr/lib/libSystem.dylib(sigaction.So) /usr/lib/libSystem.dylib(sigprocmask.So) /usr/lib/libSystem.dylib(crt_externs.So) /usr/lib/libSystem.dylib(errno.So) /usr/lib/libSystem.dylib(findfp.So) /usr/lib/libSystem.dylib(lock.So) /usr/lib/libSystem.dylib(scalable_malloc.So) /usr/lib/libSystem.dylib(fcntl.So) /usr/lib/libSystem.dylib(fflush.So) /usr/lib/libSystem.dylib(getenv.So) /usr/lib/libSystem.dylib(mach_init.So) /usr/lib/libSystem.dylib(memcmp.So) /usr/lib/libSystem.dylib(open.So) /usr/lib/libSystem.dylib(sleep.So) /usr/lib/libSystem.dylib(stack_logging.So) /usr/lib/libSystem.dylib(strcpy.So) /usr/lib/libSystem.dylib(strlen.So) /usr/lib/libSystem.dylib(strtol.So) /usr/lib/libSystem.dylib(strtoul.So) /usr/lib/libSystem.dylib(vm_mapUser.So) /usr/lib/libSystem.dylib(write.So) /usr/lib/libSystem.dylib(vfprintf.So) /usr/lib/libSystem.dylib(_divdi3.o) /usr/lib/libSystem.dylib(_moddi3.o) /usr/lib/libSystem.dylib(_udivdi3.o) /usr/lib/libSystem.dylib(_umoddi3.o) /usr/lib/libSystem.dylib(strcmp.So) /usr/lib/libSystem.dylib(strncmp.So) /usr/lib/libSystem.dylib(strrchr.So) /usr/lib/libSystem.dylib(swap.o) /usr/lib/libSystem.dylib(_pthread_kill.So) /usr/lib/libSystem.dylib(pthread_set_self.So) /usr/lib/libSystem.dylib(thread_setup.So) /usr/lib/libSystem.dylib(fprintf.So) /usr/lib/libSystem.dylib(mach_hostUser.So) /usr/lib/libSystem.dylib(mach_error_string.So) /usr/lib/libSystem.dylib(error_codes.So) /usr/lib/libSystem.dylib(mach_msg.So) /usr/lib/libSystem.dylib(mach_portUser.So) /usr/lib/libSystem.dylib(bzero.So) /usr/lib/libSystem.dylib(mig_support.So) /usr/lib/libSystem.dylib(taskUser.So) /usr/lib/libSystem.dylib(semaphore.So) /usr/lib/libSystem.dylib(mach_traps.So) /usr/lib/libSystem.dylib(icacheinval.So) /usr/lib/libSystem.dylib(syscall.So) /usr/lib/libSystem.dylib(sysctl.So) /usr/lib/libSystem.dylib(thread_actUser.So) /usr/lib/libSystem.dylib(mach_init_ports.So) /usr/lib/libSystem.dylib(sqrt.o) /usr/lib/libSystem.dylib(cerror.So) /usr/lib/libSystem.dylib(sigtramp.So) /usr/lib/libSystem.dylib(dyld_support.o) /usr/lib/libSystem.dylib(stdio.So) /usr/lib/libSystem.dylib(fwalk.So) /usr/lib/libSystem.dylib(getdtablesize.So) /usr/lib/libSystem.dylib(_flock_stub.So) /usr/lib/libSystem.dylib(nanosleep.So) /usr/lib/libSystem.dylib(table.So) /usr/lib/libSystem.dylib(runetype.So) /usr/lib/libSystem.dylib(gdtoa-dtoa.So) /usr/lib/libSystem.dylib(gdtoa-dmisc.So) /usr/lib/libSystem.dylib(hexfloat.So) /usr/lib/libSystem.dylib(_ashrdi3.o) /usr/lib/libSystem.dylib(fvwrite.So) /usr/lib/libSystem.dylib(wsetup.So) /usr/lib/libSystem.dylib(asprintf.So) /usr/lib/libSystem.dylib(localeconv.So) /usr/lib/libSystem.dylib(memchr.So) /usr/lib/libSystem.dylib(reallocf.So) /usr/lib/libSystem.dylib(wcrtomb.So) /usr/lib/libSystem.dylib(wcsrtombs.So) /usr/lib/libSystem.dylib(mig_strncpy.So) /usr/lib/libSystem.dylib(_sysctl.So) /usr/lib/libSystem.dylib(cprocs.So) /usr/lib/libSystem.dylib(close.So) /usr/lib/libSystem.dylib(lseek.So) /usr/lib/libSystem.dylib(read.So) /usr/lib/libSystem.dylib(sysconf.So) /usr/lib/libSystem.dylib(clockUser.So) /usr/lib/libSystem.dylib(none.So) /usr/lib/libSystem.dylib(bsearch.So) /usr/lib/libSystem.dylib(gdtoa-misc.So) /usr/lib/libSystem.dylib(strncpy.So) /usr/lib/libSystem.dylib(makebuf.So) /usr/lib/libSystem.dylib(lmonetary.So) /usr/lib/libSystem.dylib(lnumeric.So) /usr/lib/libSystem.dylib(getrlimit.So) /usr/lib/libSystem.dylib(glue.So) /usr/lib/libSystem.dylib(fstat.So) /usr/lib/libSystem.dylib(isatty.So) /usr/lib/libSystem.dylib(fix_grouping.So) /usr/lib/libSystem.dylib(ldpart.So) /usr/lib/libSystem.dylib(ioctl.So) /usr/lib/libSystem.dylib(termios.So) /usr/lib/libSystem.dylib(strcat.So) /usr/lib/libSystem.dylib(strchr.So) /usr/lib/libSystem.dylib(select.So) -- 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 howes at ll.mit.edu Fri Jul 16 15:40:23 2004 From: howes at ll.mit.edu (Brad Howes) Date: Fri Jul 16 15:40:36 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> Message-ID: I had the same problem when I upgraded to Panther, but only on one of my machines. For some reason, I was missing a few libraries in /us/lib, including /usr/lib/crt1.o. You can find a copy of this file in /Developer/SDKs/MacOSX10.3.0.sdk/usr/lib I can't remember what the other missing file was. Brad On Jul 16, 2004, at 3:24 AM, Ronald Oussoren wrote: > It works for me (TM) :-) > > Did you install a different gcc? If not, did you install the platform > SDK's? > > Ronald > > On Jul 16, 2004, at 2:15 AM, Chris Barker wrote: > >> Hi all, >> >> This has nothing to do with Python, but you're a helpful group of >> knowledgeable folks, so I thought I try. >> >> I'm trying to do some simple compilation with the command line gcc. >> Here is the code: >> >> #include "stdio.h" >> >> int main(){ >> printf("hello world\n"); >> return 0; >> } >> >> It couldn't be any simpler. However, when I try to compile it: >> >> gcc -o junk junk.c >> >> I get: >> >> ld: can't locate file for: -lcrt1.o >> >> Anyone have an idea? Shouldn't I be able to compile this very >> simplest of programs without providing library paths, etc. Besides >> that, I can't find a file with "crt1" in it on the system. >> >> -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 >> _______________________________________________ >> 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 > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > Brad -- Brad Howes Desk: 781.981.5292 ? Fax: 781.981.3495 ? Secretary: 781.981.7420 MIT Lincoln Laboratory ? 244 Wood St. ? Lexington, MA 02173 From xlii at xlii.org Fri Jul 16 19:01:18 2004 From: xlii at xlii.org (Quarante-Deux) Date: Fri Jul 16 19:01:35 2004 Subject: [Pythonmac-SIG] Accented characters In-Reply-To: <4B8B7A6D-D508-11D8-AD25-000D934FF6B4@cwi.nl> References: <4B8B7A6D-D508-11D8-AD25-000D934FF6B4@cwi.nl> Message-ID: At 22:07 +0200 13.07.2004, Jack Jansen wrote: >I knew there was a solution to this, but it wasn't easy to find:-) > >But I did find it: see=20 > for=20 >an explanation on how to state the encoding of=20 >your sourcefile. And the easiest way to do it is=20 >to save your file as UTF-8 and with BOM marks. I=20 >think BBEdit has an option to save files in this=20 >format. Thank you. I now can get regular expressions to correctly recognize word boundaries. However, sorting is another problem. No way I can=20 get accented caracters to sort correctly using=20 locale.strcoll. Correctly meaning that the=20 accented character either sorts directly after=20 the non-accented one, or is considered =3D to the=20 non-accented one. All I can get, with=20 fr_FR.ISO8859-15 is that all the accented=20 characters sort before all the other characters.=20 If I do a plain sort (no locale), or with=20 fr_FR.UTF-8 the accented characters sort after=20 all the others. Neither is of any use to me. Here's a sample output to a file (the source has=20 a list with =8E (e acute) and =88 (a grave)) oldloc: C newloc: fr_FR.ISO8859-15 before sorting: ['a', 'w', 'f', '\xc3\xa9', 'b', '\xc3\xa0', 'd'] ['a', 'z', 'f', '\xc3\xa9', 'b', '\xc3\xa0', 'd'] after sorting with locale.strcoll: ['\xc3\xa0', '\xc3\xa9', 'a', 'b', 'd', 'f', 'w'] after sorting without locale.strcoll: ['a', 'b', 'd', 'f', 'z', '\xc3\xa0', '\xc3\xa9'] oldloc: C newloc: fr_FR.UTF-8 before sorting: ['a', 'w', 'f', '\xc3\xa9', 'b', '\xc3\xa0', 'd'] ['a', 'z', 'f', '\xc3\xa9', 'b', '\xc3\xa0', 'd'] after sorting with locale.strcoll: ['a', 'b', 'd', 'f', 'w', '\xc3\xa0', '\xc3\xa9'] after sorting without locale.strcoll: ['a', 'b', 'd', 'f', 'z', '\xc3\xa0', '\xc3\xa9'] The problem seems to be in the FreeBSD=20 implementation of the C libraries LC_COLLATE.=20 Because the problem is identical on MacOSX and on=20 =46reeBSD 5.2.1. But on Linux, the sorting order is=20 good. I can't see any reason for this. But I found this http://akaihola.iki.fi/comp/python/strcoll Apparently, I'm not the only one with sorting=20 problems. I figure I'll have to roll my own :-)=20 unless there's something I missed somewhere. Ellen -- ------------------------------------------------------------------- xlii@xlii.org | Ellen C. Herzfeld http://www.quarante-deux.org/ | Dominique O. Martel Quelques pages sur la Science-Fiction | Quarante-Deux ------------------------------------------------------------------- From kenneth.m.mcdonald at sbcglobal.net Fri Jul 16 20:11:34 2004 From: kenneth.m.mcdonald at sbcglobal.net (Kenneth McDonald) Date: Fri Jul 16 20:11:39 2004 Subject: [Pythonmac-SIG] solution for matplotlib compile problems Message-ID: <92A10444-D753-11D8-9884-000A956870AC@sbcglobal.net> Just in case anyone else is interested... John Hunter, the fellow behind matplotlib, quickly provided a solution to my compile problems on OS X. Fetch this file: http://matplotlib.sf.net/setupext.py and use it to replace the file of the same name in the matplotlib root dir (dir containing 'setup.py'), then do the build. Worked great for me. I would imagine this is now (or soon will be) in the distribution. Thanks for the help, everyone, Ken From Chris.Barker at noaa.gov Fri Jul 16 20:39:04 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Fri Jul 16 20:41:48 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> Message-ID: <40F820C8.7090502@noaa.gov> Thanks everybody. You're such a helpful bunch. I don't have it solved yet, but I think I know where to start. (maybe) I'm not the only one that has this problem. A colleague of mine has exactly the same problem,a nd I think almost exactly the same set up: New G5 Developer tools installed from a cd that came with a copy of Panther from before the G5. Auto-upgraded with software update. It worked great on my previous G4. I'm guessing the wrong copy of developer tools is the problem. I guess I'll go to Apples website and download it from there. It's very annoying that Apple didn't ship a Developer Tools cd with my new G5. Russell Finn wrote: > What does "which gcc" return for you? It returns /usr/bin/gcc for me, which points to /usr/bin/gcc-3.3. So does mine. Jack Jansen wrote: > Either you haven't installed everything (such as the platform SDK, as Ronald suggests) wouldn't the platform SDK get installed with the Developer Tools? or you'ce accidentally removed some files. crt1.o I'm quite sure I haven't done that. > should be in /usr/lib/crt1.o. I don't have a single *.o in /usr/lib--maybe that's a hint. > Here's the complete output of what is loaded for me, and from where: Thanks Jack. I seem to have all of those, except crt1.o Brad Howes wrote: > For some reason, I was missing a few libraries in /us/lib, including /usr/lib/crt1.o. You can find a copy of this file in /Developer/SDKs/MacOSX10.3.0.sdk/usr/lib I don't seem to have that directory.... Oh well, off to install the complete new developer Tools off the web site. -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 Fri Jul 16 20:48:46 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Jul 16 20:48:59 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <40F820C8.7090502@noaa.gov> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> <40F820C8.7090502@noaa.gov> Message-ID: On Jul 16, 2004, at 2:39 PM, Chris Barker wrote: > Jack Jansen wrote: > > > Either you haven't installed everything (such as the platform SDK, > as Ronald suggests) > > > wouldn't the platform SDK get installed with the Developer Tools? > > or you'ce accidentally removed some files. crt1.o > > I'm quite sure I haven't done that. The the X11 and platform SDKs are an optional install in Xcode. You need to click "Customize" when installing and enable them. You should be getting a copy of crt1.o without the platform SDKs though.. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3589 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040716/edfdccd8/smime.bin From berkowit at silcom.com Fri Jul 16 20:52:49 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Fri Jul 16 20:52:55 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <40F820C8.7090502@noaa.gov> Message-ID: On 7/16/04 11:39 AM, "Chris Barker" wrote: > Oh well, off to install the complete new developer Tools off the web site. Careful: there's a new beta Xcode Tools 1.5 on the website. You shouldn't need that one, which might muddle something for you. The latest current released version - good for Panther - is Xcode Tools 1.2. (Xcode Tools 1.1 should also be fine with Panther.) If your version is called "Developer Tools" (any version) rather than "Xcode Tools" then it's for Jaguar. I hope they stick with one name one of these days. Apple are currently sending out Xcode Tools 1.2 on CD to Select ADC members. Mine came yesterday. -- Paul Berkowitz From Chris.Barker at noaa.gov Fri Jul 16 20:54:42 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Fri Jul 16 20:57:26 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> <40F820C8.7090502@noaa.gov> Message-ID: <40F82472.50909@noaa.gov> Bob Ippolito wrote: > The the X11 and platform SDKs are an optional install in Xcode. You > need to click "Customize" when installing and enable them. You should > be getting a copy of crt1.o without the platform SDKs though.. I would think so, if you can't compile "hello world", I wouldn't say you have a Developer Tool. Anyway, what are the "platform SDKs" then? Why might I want them? -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 rfinn at opnet.com Fri Jul 16 21:00:41 2004 From: rfinn at opnet.com (Russell Finn) Date: Fri Jul 16 21:00:50 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <40F820C8.7090502@noaa.gov> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> <40F820C8.7090502@noaa.gov> Message-ID: <6EB0006C-D75A-11D8-B126-000D93C109A8@opnet.com> On Jul 16, 2004, at 2:39 PM, Chris Barker wrote: > I'm guessing the wrong copy of developer tools is the problem. I guess > I'll go to Apples website and download it from there. It's very > annoying that Apple didn't ship a Developer Tools cd with my new G5. > > .... > > Oh well, off to install the complete new developer Tools off the web > site. Wait! Did you look in /Applications/Installers? I'm pretty sure there was a Developer Tools installer in there when I got my new PowerBook, along with a Filemaker trial. (It's probably hidden on the system restore DVD somewhere, too.) Of course, I immediately installed it, and then deleted the installer... -- Russell Finn -- Russell S. Finn Principal Software Engineer, Software Architecture and Design OPNET Technologies, Inc. Phone: +1-240-497-3000 / Fax: +1-240-497-3001 Web: ============================================================= Register for OPNET's Online Technology Workshops ============================================================= Register for OPNETWORK 2004 (Aug 30 - Sept 3, Washington DC) ============================================================= From bob at redivi.com Fri Jul 16 21:04:14 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Jul 16 21:04:33 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <40F82472.50909@noaa.gov> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> <40F820C8.7090502@noaa.gov> <40F82472.50909@noaa.gov> Message-ID: On Jul 16, 2004, at 2:54 PM, Chris Barker wrote: > Bob Ippolito wrote: > >> The the X11 and platform SDKs are an optional install in Xcode. You >> need to click "Customize" when installing and enable them. You >> should be getting a copy of crt1.o without the platform SDKs though.. > > I would think so, if you can't compile "hello world", I wouldn't say > you have a Developer Tool. Anyway, what are the "platform SDKs" then? > Why might I want them? Platform SDKs allow you to compile/link against previous versions of Mac OS X. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3589 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040716/f426c1dc/smime.bin From bob at redivi.com Fri Jul 16 21:04:14 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri Jul 16 21:05:49 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <40F82472.50909@noaa.gov> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> <40F820C8.7090502@noaa.gov> <40F82472.50909@noaa.gov> Message-ID: On Jul 16, 2004, at 2:54 PM, Chris Barker wrote: > Bob Ippolito wrote: > >> The the X11 and platform SDKs are an optional install in Xcode. You >> need to click "Customize" when installing and enable them. You >> should be getting a copy of crt1.o without the platform SDKs though.. > > I would think so, if you can't compile "hello world", I wouldn't say > you have a Developer Tool. Anyway, what are the "platform SDKs" then? > Why might I want them? Platform SDKs allow you to compile/link against previous versions of Mac OS X. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3589 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040716/f426c1dc/smime-0001.bin From ronaldoussoren at mac.com Fri Jul 16 21:06:16 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri Jul 16 21:06:42 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <40F820C8.7090502@noaa.gov> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> <40F820C8.7090502@noaa.gov> Message-ID: <36B5026C-D75B-11D8-91D5-0003931CFE24@mac.com> On Jul 16, 2004, at 8:39 PM, Chris Barker wrote: > > > Either you haven't installed everything (such as the platform SDK, > as Ronald suggests) > > > wouldn't the platform SDK get installed with the Developer Tools? At least some, and maybe all, platform SDK's are optional. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From Chris.Barker at noaa.gov Sat Jul 17 00:36:31 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Sat Jul 17 00:39:16 2004 Subject: [Pythonmac-SIG] Totally O.T. OS-X question In-Reply-To: <6EB0006C-D75A-11D8-B126-000D93C109A8@opnet.com> References: <6F922F0A-D6AA-11D8-8BD2-000D934FF6B4@cwi.nl> <40F71E2F.5050600@noaa.gov> <290F70CD-D6F9-11D8-922A-0003931CFE24@mac.com> <40F820C8.7090502@noaa.gov> <6EB0006C-D75A-11D8-B126-000D93C109A8@opnet.com> Message-ID: <40F8586F.30905@noaa.gov> Russell Finn wrote: > Wait! Did you look in /Applications/Installers? Bingo!!! Yes, there is (and XCode installer anyway). Installing this one fixes the problem. Thanks all! -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 artelse at mohr-i.nl Sat Jul 17 15:34:15 2004 From: artelse at mohr-i.nl (Arthur Elsenaar) Date: Sat Jul 17 15:34:16 2004 Subject: [Pythonmac-SIG] list of fonts Message-ID: Hi, how do I get a list of the available system fonts? I tried doing this in pygame, but the darwin code to do this is unimplemented. I see a carbon.fm (font manager) module, but how does this work? Thanks, Arthur. From bob at redivi.com Sat Jul 17 16:50:00 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat Jul 17 16:50:09 2004 Subject: [Pythonmac-SIG] list of fonts In-Reply-To: References: Message-ID: <9474D7AC-D800-11D8-B460-000A95686CD8@redivi.com> On Jul 17, 2004, at 9:34 AM, Arthur Elsenaar wrote: > how do I get a list of the available system fonts? I tried doing this > in pygame, but the darwin code to do this is unimplemented. I see a > carbon.fm (font manager) module, but how does this work? Using PyObjC: import sys import codecs from AppKit import * sys.stdout = codecs.getwriter('utf8')(sys.stdout) fontManager = NSFontManager.sharedFontManager() print u'\n'.join(fontManager.availableFonts()) See: http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Classes/NSFontManager.html#//apple_ref/doc/ uid/20000383/CJBDHJDJ -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3589 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040717/4c447378/smime.bin From Jack.Jansen at cwi.nl Sun Jul 18 00:44:44 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun Jul 18 00:44:31 2004 Subject: [Pythonmac-SIG] list of fonts In-Reply-To: References: Message-ID: On 17 Jul 2004, at 15:34, Arthur Elsenaar wrote: > how do I get a list of the available system fonts? I tried doing this > in pygame, but the darwin code to do this is unimplemented. I see a > carbon.fm (font manager) module, but how does this work? Carbon.Fm probably won't do you much good, it's tied too much to QuickDraw. Also, I don't think it lets you enumerate over the available fonts. Bob's suggestion is the easiest, if you can use Cocoa. But anyway, here's an easy recipe for finding out what is in the various Carbon modules, what they do, and how to call them: >>> import Carbon.Fm >>> help(Carbon.Fm) This will tell you the names an Python calling sequences of the functions. The functions you can now lookup in the Apple documentation (for instance from within Xcode). Unfortunately it will not tell you the names of the classes right now, you'll either have to guess or use dir() for that. Then you can do help() on the class, and find out about the methods. BTW: does anyone know *why* the classes don't get listed by help()? -- 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 Sun Jul 18 01:53:03 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Jul 18 01:53:09 2004 Subject: [Pythonmac-SIG] list of fonts In-Reply-To: References: Message-ID: <718D9D84-D84C-11D8-95ED-000A95686CD8@redivi.com> On Jul 17, 2004, at 6:44 PM, Jack Jansen wrote: > > On 17 Jul 2004, at 15:34, Arthur Elsenaar wrote: >> how do I get a list of the available system fonts? I tried doing this >> in pygame, but the darwin code to do this is unimplemented. I see a >> carbon.fm (font manager) module, but how does this work? > > Carbon.Fm probably won't do you much good, it's tied too much to > QuickDraw. Also, I don't think it lets you enumerate over the > available fonts. Bob's suggestion is the easiest, if you can use > Cocoa. > > But anyway, here's an easy recipe for finding out what is in the > various Carbon modules, what they do, and how to call them: > >>> import Carbon.Fm > >>> help(Carbon.Fm) > This will tell you the names an Python calling sequences of the > functions. > The functions you can now lookup in the Apple documentation (for > instance from within Xcode). > > Unfortunately it will not tell you the names of the classes right now, > you'll either have to guess or use dir() for that. Then you can do > help() on the class, and find out about the methods. > > BTW: does anyone know *why* the classes don't get listed by help()? Probably because there aren't any classes in _Fm ;) -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3589 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040717/9ab25d60/smime.bin From Jack.Jansen at cwi.nl Sun Jul 18 22:33:06 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun Jul 18 22:32:46 2004 Subject: [Pythonmac-SIG] list of fonts In-Reply-To: <718D9D84-D84C-11D8-95ED-000A95686CD8@redivi.com> References: <718D9D84-D84C-11D8-95ED-000A95686CD8@redivi.com> Message-ID: On 18 Jul 2004, at 01:53, Bob Ippolito wrote: >> BTW: does anyone know *why* the classes don't get listed by help()? > > Probably because there aren't any classes in _Fm ;) Hehe:-) I should have said "I tried this for Carbon.Win, but to my surprise the classes there weren't listed. Anyone happen to know how help() finds the classes/types in extension modules, because apparently bgen isn't setting things up so that help() can find the classes". -- 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 Sun Jul 18 23:25:30 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun Jul 18 23:25:38 2004 Subject: [Pythonmac-SIG] list of fonts In-Reply-To: References: <718D9D84-D84C-11D8-95ED-000A95686CD8@redivi.com> Message-ID: On Jul 18, 2004, at 4:33 PM, Jack Jansen wrote: > > On 18 Jul 2004, at 01:53, Bob Ippolito wrote: >>> BTW: does anyone know *why* the classes don't get listed by help()? >> >> Probably because there aren't any classes in _Fm ;) > > Hehe:-) > > I should have said "I tried this for Carbon.Win, but to my surprise > the classes there weren't listed. Anyone happen to know how help() > finds the classes/types in extension modules, because apparently bgen > isn't setting things up so that help() can find the classes". help(...) ignores class references from other modules (which makes sense in the general case), so it skips '_Win.Window'. help(_Win) works perfectly well, of course. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3589 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040718/abbe89ed/smime.bin From Cameron at Phaseit.net Mon Jul 19 19:35:56 2004 From: Cameron at Phaseit.net (Cameron Laird) Date: Mon Jul 19 21:15:19 2004 Subject: [Pythonmac-SIG] list of fonts In-Reply-To: <9474D7AC-D800-11D8-B460-000A95686CD8@redivi.com> References: <9474D7AC-D800-11D8-B460-000A95686CD8@redivi.com> Message-ID: <20040719173556.GA8172@lairds.us> On Sat, Jul 17, 2004 at 10:50:00AM -0400, Bob Ippolito wrote: . . . > On Jul 17, 2004, at 9:34 AM, Arthur Elsenaar wrote: > > >how do I get a list of the available system fonts? I tried doing this > >in pygame, but the darwin code to do this is unimplemented. I see a > >carbon.fm (font manager) module, but how does this work? > > Using PyObjC: > > import sys > import codecs > from AppKit import * . . . I haven't been keeping up; what's it take to be able to import AppKit ? The Python installed with 10.3.3 certainly doesn't seem to know about it. From Jack.Jansen at cwi.nl Tue Jul 20 09:51:41 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue Jul 20 09:51:44 2004 Subject: [Pythonmac-SIG] list of fonts In-Reply-To: <20040719173556.GA8172@lairds.us> References: <9474D7AC-D800-11D8-B460-000A95686CD8@redivi.com> <20040719173556.GA8172@lairds.us> Message-ID: On 19 Jul 2004, at 19:35, Cameron Laird wrote: >> import sys >> import codecs >> from AppKit import * > . > . > . > I haven't been keeping up; what's it take to be able to > import AppKit > ? The Python installed with 10.3.3 certainly doesn't seem > to know about it. It's part of PyObjC (the Python to Objective C, and hence Cocoa, bridge). You need to install it separately. This is easiest through the Package Manager. (And if you don't have the Package Manager: go to http://www.cwi. nl/~jack/macpython and download the MacPython for Panther Additions). -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From ronaldoussoren at mac.com Tue Jul 20 12:06:29 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue Jul 20 12:06:36 2004 Subject: [Pythonmac-SIG] list of fonts Message-ID: <5326875.1090317989760.JavaMail.ronaldoussoren@mac.com> On Tuesday, July 20, 2004, at 09:52AM, Jack Jansen wrote: > >On 19 Jul 2004, at 19:35, Cameron Laird wrote: >>> import sys >>> import codecs >>> from AppKit import * >> . >> . >> . >> I haven't been keeping up; what's it take to be able to >> import AppKit >> ? The Python installed with 10.3.3 certainly doesn't seem >> to know about it. > >It's part of PyObjC (the Python to Objective C, and hence Cocoa, >bridge). >You need to install it separately. This is easiest through the Package >Manager. (And if you don't have the Package Manager: go to >http://www.cwi. nl/~jack/macpython and download the MacPython for >Panther Additions). There's also an installer at pyobjc.sf.net, this will install Xcode templates as well. Ronald >-- >Jack Jansen, , http://www.cwi.nl/~jack >If I can't dance I don't want to be part of your revolution -- Emma >Goldman > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > From aab.lists at nb-a.com Wed Jul 21 11:10:24 2004 From: aab.lists at nb-a.com (Aldo Bergamini) Date: Wed Jul 21 11:10:57 2004 Subject: [Pythonmac-SIG] Setting paths Message-ID: <20040721101024.19312@mail.nb-a.com> I am faced with a very basic question: how to set paths to be able to create a package with my .py source files. The setup is simple: I do use BBEdit to write the code and to launch the test scripts. Of course I am using the nice shell/worksheet feature of BBEdit to start the test scripts. There is a bunch of folders at some location like: /Users/aldo/Documents/ .... /Pegasus/Objectspace In the Pegasus folder there is an __init__.py file, as well as in the subfolders that should host different parts of the would-be-package. I tried to set an environment variable hoping to pass some information the the interpreter: >set PYTHONPATH = "/Users/aldo/Documents/Work/Amministrazione/Budgeting/ >Budget_proj/Pegasus/" Strangely I cant't read it back.. >$PYTHONPATH >tcsh: /Users/aldo/Documents/Work/Amministrazione/Budgeting/Budget_proj/ >Pegasus/: Permission denied. And the interpreter, when I launch a test script that opens a .py file in the same subfolder as the test code, stops as it get to the import lines: >import sys >import exceptions >import Pegasus It obviously has no clue where to look for my 'package'; how should I set the correct path (pointing to a folder that is in a "Finder-handy" place)? TIA Aldo From Jack.Jansen at cwi.nl Wed Jul 21 11:32:39 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed Jul 21 11:31:40 2004 Subject: [Pythonmac-SIG] Setting paths In-Reply-To: <20040721101024.19312@mail.nb-a.com> References: <20040721101024.19312@mail.nb-a.com> Message-ID: On 21-jul-04, at 11:10, Aldo Bergamini wrote: > There is a bunch of folders at some location like: > > /Users/aldo/Documents/ .... /Pegasus/Objectspace > > In the Pegasus folder there is an __init__.py file, as well as in the > subfolders that should host different parts of the would-be-package. > > I tried to set an environment variable hoping to pass some information > the the interpreter: > >> set PYTHONPATH = >> "/Users/aldo/Documents/Work/Amministrazione/Budgeting/ >> Budget_proj/Pegasus/" If Pegasus is the package you want to import you should make sure that the directory *above that* is in sys.path. Moreover, the PYTHONPATH variable must end up in the environment too. Something like >> setenv PYTHONPATH >> /Users/aldo/Documents/Work/Amministrazione/Budgeting/Budget_proj or >> PYTHONPATH=/Users/aldo/Documents/Work/Amministrazione/Budgeting/ >> Budget_proj >> export PYTHONPATH depending on whether you use bash or tcsh. -- 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: smime.p7s Type: application/pkcs7-signature Size: 2086 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040721/cebce105/smime.bin From joaoleao at gmx.net Wed Jul 21 18:24:43 2004 From: joaoleao at gmx.net (=?ISO-8859-1?Q?Jo=E3o_Le=E3o?=) Date: Wed Jul 21 18:24:42 2004 Subject: [Pythonmac-SIG] PDF creation using CoreGraphics Message-ID: <78F0B125-DB32-11D8-AAA6-000393967AF4@gmx.net> Hi list! I've been doing some experiences with CoreGraphics to generate PDF documents. As a starting point I took a look at the examples in "/Developer/Examples/Quartz/Python/". Examining the "image.py" example I was able to write a script that imports an image, resizes and places it in a PDF Page. For this I'm using the same steps as in that example. The placement of the image is made with the method "drawImage" in the PDF Context, that draws the image in a given rect. However, I noticed that the PDF gets the same size (in this case 3,7 M because it was a big image) even if I "resize" it to an area of 50 x 50 px. It appears that "drawImage" scales the image but maintains the number of pixels. This is very clear when you zoom the PDF. Maybe I have to -really- resize the image before I place it in the PDF or maybe there is some way of optimizing the PDF after. I need it to be lightweight. Any suggestions on how to do this? Before asking here I looked the documentation (the API and the Apple Docs) which I think is good, but couldn't figure it out. I'm not an experienced programmer and don't know how to 'glue' all this classes and methods to address my needs... Thanks everyone. _ joao From mlpollard at earthlink.net Wed Jul 21 20:08:33 2004 From: mlpollard at earthlink.net (Tom Pollard) Date: Wed Jul 21 20:06:30 2004 Subject: [Pythonmac-SIG] wxpython debugging Message-ID: Hi, I've recently started trying to develop a simple wxPython application, but have become frustrated by the fact that I can't get tracebacks when my scripts crash. It looks like the traceback is automatically directed to a GUI window when running my wxpython script, rather than the terminal or the console, but this window is closed immediately when the script exits. Is there anyway to force tracebacks to be sent to the terminal? Thanks, TomP In case it's useful, I'm running the standard Python installed with Panther (plus MacPython additions), and the most recent official release of WxPython. From Chris.Barker at noaa.gov Wed Jul 21 21:50:30 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Wed Jul 21 21:53:31 2004 Subject: [Pythonmac-SIG] wxpython debugging In-Reply-To: References: Message-ID: <40FEC906.5020904@noaa.gov> Tom Pollard wrote: > Hi, > > I've recently started trying to develop a simple wxPython application, > but have become frustrated by the fact that I can't get tracebacks when > my scripts crash. It looks like the traceback is automatically directed > to a GUI window when running my wxpython script, rather than the > terminal or the console, are you starting it from the terminal? if so, you have to initialize your wx.App with 0 or False as the parameter. 1 or True indicates that you want output directed to a created window, which is nice if people are starting the app with a double-click, but not so good in that it goes away on a crash. So your startup code looks like: app = MyApp(False)# put in True if you want output to go to it's own window. app.MainLoop() -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 kevino at tulane.edu Thu Jul 22 18:45:36 2004 From: kevino at tulane.edu (Kevin Ollivier) Date: Thu Jul 22 18:45:47 2004 Subject: [Pythonmac-SIG] Fwd: [wxPython-mac] Newbie Question Message-ID: <8E5CD832-DBFE-11D8-B77C-000393CB1C86@tulane.edu> Hi Sergi, Try right-clicking on a script, selecting "Open With", then selecting "Python Launcher". Does the script work if you do that? Also, did you install MacPython (i.e. by downloading it from python.org) or the "MacPython Additions" from here: http://homepages.cwi.nl/~jack/macpython/download.html On Panther, there is already a complete installation of Python, so you do not even need to install it. If you *did* install the complete MacPython Jaguar package, then you can find removal instructions here: http://homepages.cwi.nl/~jack/macpython/uninstall.html Please let me know if this helps! Kevin Begin forwarded message: > From: Sergi Mansilla Molins > Date: July 22, 2004 6:10:21 AM PDT > To: wxPython-mac@lists.wxwidgets.org > Subject: [wxPython-mac] Newbie Question > Reply-To: wxPython-mac@lists.wxwidgets.org > > I have installed wxpython and macpython in my ibook with panther. But > the sample scripts that come qith the packages doesn't execute. They > call the python IDE but the "run all" button doesn't work. > > Do I have to do something apart of simply install the necessary > packages? > > Thanks in advance and sorry for such a newbie question. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: wxPython-mac-unsubscribe@lists.wxwidgets.org > For additional commands, e-mail: wxPython-mac-help@lists.wxwidgets.org > From Jack.Jansen at cwi.nl Thu Jul 22 22:13:46 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu Jul 22 22:13:44 2004 Subject: [Pythonmac-SIG] Wanted: stand-in moderator Message-ID: Folks, is anyone willing to act as a temporary moderator for pythonmac-sig while I'm away on holidays, 3 weeks starting this weekend? Preferably someone who has used mailman before... The task is simple, but boring: you get about 50 email messages per day about postings being held. You visit the moderator page, look through the subjects, and usually it's clear they're all viruses or other junk, then you simply select the "discard all postings marked as held" and press submit. Once every three or four days there'll be something resembling a legitimate message which you then have to look at, and possibly accept before cleaning out the other junk. Skip Montanero is co-moderator, but he hasn't replied to my email earlier this week, so I think he may be away 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 skip at pobox.com Thu Jul 22 22:31:17 2004 From: skip at pobox.com (Skip Montanaro) Date: Thu Jul 22 22:31:38 2004 Subject: [Pythonmac-SIG] Wanted: stand-in moderator In-Reply-To: References: Message-ID: <16640.9237.566111.471345@montanaro.dyndns.org> Jack> is anyone willing to act as a temporary moderator for Jack> pythonmac-sig while I'm away on holidays, 3 weeks starting this Jack> weekend? Preferably someone who has used mailman before... ... Jack> Skip Montanero is co-moderator, but he hasn't replied to my email Jack> earlier this week, so I think he may be away too. Actually, I did reply: ... Date: Tue, 20 Jul 2004 17:16:04 -0500 Subject: Re: pythonmac-sig moderation In-Reply-To: <4D3D8122-DA95-11D8-BD74-000D934FF6B4@cwi.nl> ... Jack> from this weekend I'll be gone for holidays for about 3 weeks, Jack> can you handle moderation of pythonmac-sig, and/or should we Jack> put the list in automatic and/or should I ask on the list for Jack> a standin moderator? Jack, I should be able to handle it okay. Have a relaxing holiday. Skip Still wishing you a relaxing holiday... ;-) Skip From Jack.Jansen at cwi.nl Fri Jul 23 10:29:49 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri Jul 23 10:31:00 2004 Subject: [Pythonmac-SIG] Wanted: stand-in moderator In-Reply-To: <16640.9237.566111.471345@montanaro.dyndns.org> References: <16640.9237.566111.471345@montanaro.dyndns.org> Message-ID: <763BE573-DC82-11D8-91A8-000A958D1666@cwi.nl> On 22-jul-04, at 22:31, Skip Montanaro wrote: > Actually, I did reply: > > Jack, > > I should be able to handle it okay. Have a relaxing holiday. > > Skip Argh, I missed it. I guess short emails with "relaxing holiday" in them, and no references to Python bytecode or Cocoa widgets or somesuch confuse my spam filter:-) I'll let you handle it, then. And so, Jacob: thanks for the offer, but it isn't needed after all. I'll know where to find you next year:-) -- 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: smime.p7s Type: application/pkcs7-signature Size: 2086 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040723/9f0699d5/smime.bin From kenpaulkoller at sbcglobal.net Fri Jul 23 11:05:50 2004 From: kenpaulkoller at sbcglobal.net (Ken Koller) Date: Fri Jul 23 11:05:57 2004 Subject: [Pythonmac-SIG] Apple Event Manager Message-ID: <4100D4EE.60706@sbcglobal.net> Hi, I've been using Python for several years on the PC. I'm comfortable with Unix too so writing Python to access OS X via a shell is no problem. What I really want to do now is explore controlling applications from Python. Specifically Final Cut Pro to automate some video editing functionality. I've done a few searches and it seems that accessing the Apple Event Manager is the way to do this. Can someone point me to a good starting place? A simple example would be great. Also, comments on the various packages? Thanks, Ken From gandreas at delver.com Sat Jul 24 16:22:23 2004 From: gandreas at delver.com (Glenn Andreas) Date: Sat Jul 24 16:22:34 2004 Subject: [Pythonmac-SIG] ANN: PyOXIDE 0.6.3 - Cocoa based Python IDE Message-ID: PyOXIDE 0.6.3 is now available for abuse. The major addition (thanks to the "Matlab-like IDE" thread) is the "debug console" which allows you to execute an interactive shell within the context of the current debugging location (and this works for both local and remote debugging). It also fixes some build issues that caused preferences to not work (so you can finally set custom keyboard commands). The project has also been converted to being built as an XCode "native" project (no more Project Builder support). PyOXIDE 0.6.3 has only been tested with 10.3, but should work with 10.2 (assuming it can find the python framework). The sources are built using XCode 1.1 on 10.3. PyOXIDE 0.6.3 is now available on my idisk (as PyOXIDE_0.6.3.dmg): from the pather finder, "connect to other public folder" and type in "gandreas" or http://projects.gandreas.com/pyoxide/ If you want to build from source, you'll need to get PyOXIDE_Src_0.6.3.dmg, and IDEKit_0.2.3.dmg (also built XCode 1.2 on 10.3). IDEKit_0.2.3.dmg is found either on the idisk above or PyOXIDE source is covered under a BSD-style license. The IDEKit framework is covered under LGPL, so you can freely link it in other projects. If you have problems, questions, enhancment request, etc, please submit request at (hopefully it should work - you'll have to make a new account, but the PyOXIDE database is publically available), and feel free to post questions/comments/public discussion to -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From michael at possibleworlds.com Mon Jul 26 22:40:26 2004 From: michael at possibleworlds.com (michael ferraro) Date: Mon Jul 26 22:40:32 2004 Subject: [Pythonmac-SIG] Quicktime, versions, 3GPP In-Reply-To: References: <61DD329C-63B0-11D8-A030-00039345C610@darwin.in-berlin.de> Message-ID: <066D3978-DF44-11D8-A035-000A956D5598@possibleworlds.com> hello -- i was about to start a project that employed Quicktime to output, in real-time the contents of my OpenGL window. I am doing this in order to use a Quicktime based SDI output card (The Blackmagic Decklink) to convert to video without using a scan converter (The scan converter approach digitizes the monitor output and does not let me output a simultaneous alpha channel. I checked out python from CVS and used my python2.3 to run setup.py in Mac/Modules/qt to build the new stuff. The compile seemed to go ok by the install generated a number of messages Are these something I can work around. it seem that the messages are related to Quicktime Musc. Michael running install running build running build_py running build_ext running install_lib creating /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime copying build/lib.darwin-7.4.0-Power_Macintosh-2.3/QuickTime/__init__.py -> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime copying build/lib.darwin-7.4.0-Power_Macintosh-2.3/QuickTime/_Qt.so -> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime copying build/lib.darwin-7.4.0-Power_Macintosh-2.3/QuickTime/Qt.py -> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime copying build/lib.darwin-7.4.0-Power_Macintosh-2.3/QuickTime/QuickTime.py -> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime byte-compiling /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/__init__.py to __init__.pyc byte-compiling /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/Qt.py to Qt.pyc byte-compiling /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py to QuickTime.pyc /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3122: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up notImplementedMusicErr = (0x80000000 | (0xFFFF & (notImplementedMusicOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3123: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up cantSendToSynthesizerErr = (0x80000000 | (0xFFFF & (cantSendToSynthesizerOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3124: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up cantReceiveFromSynthesizerErr = (0x80000000 | (0xFFFF & (cantReceiveFromSynthesizerOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3125: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up illegalVoiceAllocationErr = (0x80000000 | (0xFFFF & (illegalVoiceAllocationOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3126: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up illegalPartErr = (0x80000000 | (0xFFFF & (illegalPartOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3127: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up illegalChannelErr = (0x80000000 | (0xFFFF & (illegalChannelOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3128: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up illegalKnobErr = (0x80000000 | (0xFFFF & (illegalKnobOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3129: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up illegalKnobValueErr = (0x80000000 | (0xFFFF & (illegalKnobValueOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3130: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up illegalInstrumentErr = (0x80000000 | (0xFFFF & (illegalInstrumentOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3131: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up illegalControllerErr = (0x80000000 | (0xFFFF & (illegalControllerOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3132: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up midiManagerAbsentErr = (0x80000000 | (0xFFFF & (midiManagerAbsentOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3133: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up synthesizerNotRespondingErr = (0x80000000 | (0xFFFF & (synthesizerNotRespondingOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3134: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up synthesizerErr = (0x80000000 | (0xFFFF & (synthesizerOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3135: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up illegalNoteChannelErr = (0x80000000 | (0xFFFF & (illegalNoteChannelOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3136: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up noteChannelNotAllocatedErr = (0x80000000 | (0xFFFF & (noteChannelNotAllocatedOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3137: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up tunePlayerFullErr = (0x80000000 | (0xFFFF & (tunePlayerFullOSErr))) /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ site-packages/QuickTime/QuickTime.py:3138: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up tuneParseErr = (0x80000000 | (0xFFFF & (tuneParseOSErr))) [Wheezer:Mac/Modules/qt] mef% (On Feb 20, 2004, at 6:01 PM, Jack Jansen wrote: > > On 20 Feb 2004, at 15:23, Dinu Gherman wrote: > >> Hi again, >> >> does anybody know if the Quicktime modules under Carbon do always >> support the currently installed/found version of Quicktime during >> compile time, or is it a more difficult story? >> >> I'm especially interested in Quicktime 6.3 and higher with their >> ability to save in 3GPP mode for mobile devices... > > It is a more difficult story (of course, I should add:-). > > The quicktime modules are built against a specific version of the API, > but they use the implementation provided by the version of QuickTime > you have installed on your machine. In other words, if exporting to > 3GPP requires API calls that are newer than when the quicktime modules > were built you will not be able to do it. But any new functionality > sitting under existing APIs is immediately available. > > All that said: I've greatly enhanced the quicktime modules a month or > so ago. The code is in the Python CVS repository, and I've done it in > such a way that even though the code is in the 2.4 sourcetree it is > possible to build the modules for 2.3. Unfortunately I've been really > busy ever since, and I haven't had a chance to make the modules > available through PackageManager. I promise I will do so as soon as I > have the time. In the mean time you can check out Python from CVS and > use your python2.3 interpreter to run setup.py in Mac/Modules/Qt to > build the new stuff from source. > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From hengist.podd at virgin.net Mon Jul 26 23:04:41 2004 From: hengist.podd at virgin.net (has) Date: Mon Jul 26 23:04:48 2004 Subject: [Pythonmac-SIG] Apple Event Manager In-Reply-To: <4100D4EE.60706@sbcglobal.net> References: <4100D4EE.60706@sbcglobal.net> Message-ID: Ken Koller wrote: >What I really want to do now is explore controlling applications >from Python. Specifically Final Cut Pro to automate some video >editing functionality. > >I've done a few searches and it seems that accessing the Apple Event >Manager is the way to do this. See However, AFAIK, Final Cut Pro only supports FXScript/FXBuilder and/or XML Interchange Format. (Apple's pretty shocking at providing Apple event interfaces to their own programs, especially pro-apps; e.g. see John C Welch wax lyrical on the subject: ) has -- http://freespace.virgin.net/hamish.sanderson/ From thor.zayan at 9online.fr Mon Jul 26 11:55:30 2004 From: thor.zayan at 9online.fr (Thor Zayan) Date: Tue Jul 27 02:24:36 2004 Subject: [Pythonmac-SIG] ValueError: Empty module name Message-ID: <4104D512.3070509@9online.fr> I am running IDLE 1.0 with python 2.3 and Tk 8.4 on a Mac under Mac OS X 10.3.4 french version and all was fun. On another hand I installed LyX 1.3.4 and also it was fun. But when added in my ~/.MacOSX/environment.plist a LANG property with value fr_FR to run it in french I noticed that IDLE don't works any more. It's Dock icon bounces a little and stops ginving me this alert on my console : Traceback (most recent call last): File "/Applications/MacPython-2.3/IDLE.app/Contents/Resources/__argvemulator_idle", line 4, in ? execfile(os.path.join(os.path.split(__file__)[0], "idle")) File "/Applications/MacPython-2.3/IDLE.app/Contents/Resources/idle", line 4, in ? import idlelib.PyShell File "/Applications/MacPython-2.3/IDLE.app/Contents/Resources/idlelib/PyShell.py", line 22, in ? from EditorWindow import EditorWindow, fixwordbreaks File "/Applications/MacPython-2.3/IDLE.app/Contents/Resources/idlelib/EditorWindow.py", line 39, in ? class EditorWindow: File "/Applications/MacPython-2.3/IDLE.app/Contents/Resources/idlelib/EditorWindow.py", line 43, in EditorWindow from IOBinding import IOBinding File "/Applications/MacPython-2.3/IDLE.app/Contents/Resources/idlelib/IOBinding.py", line 54, in ? codecs.lookup(encoding) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/encodings/__init__.py", line 84, in search_function globals(), locals(), _import_tail) ValueError: Empty module name Is there any solution to get IDLE and LyX (with french GUI) running at once? Thanks From kenneth.m.mcdonald at sbcglobal.net Tue Jul 27 07:47:54 2004 From: kenneth.m.mcdonald at sbcglobal.net (Kenneth McDonald) Date: Tue Jul 27 07:47:57 2004 Subject: [Pythonmac-SIG] Generating pdf using epydoc under OS X--any way to avoid LaTeX?... Message-ID: <8106757A-DF90-11D8-B08C-000A956870AC@sbcglobal.net> ...and if not, what's the easiest Latex install for OS X? I'm using epydoc to generate docs for my projects, and I'd like to generate pdf versions as well as HTML. Given that OS X supports pdf natively, I was wondering if anyone had a clever hack to enable epydoc to generate pdf without installing latex. If not, any comments on how to most easily install LaTeX? I'll use darwinports/fink if I have to, but would prefer a source distro where I can just do a standard ./configure-make-make install. Thanks, Ken From bob at redivi.com Tue Jul 27 08:03:07 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue Jul 27 08:03:15 2004 Subject: [Pythonmac-SIG] Generating pdf using epydoc under OS X--any way to avoid LaTeX?... In-Reply-To: <8106757A-DF90-11D8-B08C-000A956870AC@sbcglobal.net> References: <8106757A-DF90-11D8-B08C-000A956870AC@sbcglobal.net> Message-ID: On Jul 27, 2004, at 1:47 AM, Kenneth McDonald wrote: > ...and if not, what's the easiest Latex install for OS X? > > I'm using epydoc to generate docs for my projects, and I'd like > to generate pdf versions as well as HTML. Given that OS X > supports pdf natively, I was wondering if anyone had a clever > hack to enable epydoc to generate pdf without installing latex. > If not, any comments on how to most easily install LaTeX? I'll > use darwinports/fink if I have to, but would prefer a source > distro where I can just do a standard ./configure-make-make install. I used this one: http://www.rna.nl/tex.html -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3589 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040727/2ed0cadc/smime.bin From eichin at metacarta.com Tue Jul 27 08:38:55 2004 From: eichin at metacarta.com (eichin@metacarta.com) Date: Tue Jul 27 08:39:03 2004 Subject: [Pythonmac-SIG] Generating pdf using epydoc under OS X--any way to avoid LaTeX?... In-Reply-To: <8106757A-DF90-11D8-B08C-000A956870AC@sbcglobal.net> References: <8106757A-DF90-11D8-B08C-000A956870AC@sbcglobal.net> Message-ID: <7gd62i9cow.fsf@pikespeak.metacarta.com> It may turn out to not look good enough, but it might be worth a try to go "the other way 'round": load the HTML in Safari, save-as-pdf (from the Print panel.) Regrettably this needs gui-scripting to automate, there's no exposed applescript interface for it... From janssen at parc.com Tue Jul 27 17:25:21 2004 From: janssen at parc.com (Bill Janssen) Date: Tue Jul 27 17:25:45 2004 Subject: [Pythonmac-SIG] Generating pdf using epydoc under OS X--any way to avoid LaTeX?... In-Reply-To: Your message of "Mon, 26 Jul 2004 22:47:54 PDT." <8106757A-DF90-11D8-B08C-000A956870AC@sbcglobal.net> Message-ID: <04Jul27.082530pdt."58612"@synergy1.parc.xerox.com> You can use htmldoc (www.easysw.com/htmldoc) to convert HTML to PDF without latex. You can use ReportLab from Python to directly construct PDF; perhaps a module for epydoc using ReportLab would be a good idea. Bill From Chris.Barker at noaa.gov Thu Jul 29 20:57:21 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Thu Jul 29 21:00:47 2004 Subject: [Pythonmac-SIG] The value of a native Blas Message-ID: <41094891.4040103@noaa.gov> Hi all, I think this is a nifty bit of trivia. After getting my nifty Apple Dual G5, I finally got around to doing a test I had wanted to do for a while. The Numeric package uses LAPACK for the Linear Algebra stuff. For OS-X there are two binary versions available for easy install: One linked against the default, non-optimized version of BLAS (from Jack Jansen's PackMan database) One linked against the Apple Supplied vec-lib as the BLAS. (From Bob Ippolito's PackMan database (http://undefined.org/python/pimp/) To compare performance, I wrote a little script that generates a random matrix and vector: A, b, and solves the equation: Ax = b for x N = 1000 a = RandomArray.uniform(-1000, 1000, (N,N) ) b = RandomArray.uniform(-1000, 1000, (N,) ) start = time.clock() x = solve_linear_equations(a,b) print "It took %f seconds to solve a %iX%isystem"%( time.clock()-start, N, N) And here are the results: With the non-optimized version: It took 3.410000 seconds to solve a 1000X1000 system It took 28.260000 seconds to solve a 2000X2000 system With vec-Lib: It took 0.360000 seconds to solve a 1000X1000 system It took 2.580000 seconds to solve a 2000X2000 system for a speed increase of over 10 times! Wow! Thanks Bob, for providing that package. I'd be interested to see similar tests on other platforms, I haven't gotten around to figuring out how to use a native BLAS on my Linux box. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From Chris.Barker at noaa.gov Thu Jul 29 21:10:37 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Thu Jul 29 21:14:04 2004 Subject: [Pythonmac-SIG] Headers for Numeric module In-Reply-To: <58C5D36A-BE57-11D8-BEB2-000A95686CD8@redivi.com> References: <87E1059F-BE3E-11D8-99DD-003065C9DF8C@sarwat.net> <40CE0AA3.2080001@noaa.gov> <58C5D36A-BE57-11D8-BEB2-000A95686CD8@redivi.com> Message-ID: <41094BAD.4000802@noaa.gov> Hi all, I've installed Numeric with both Jack's PIMP database and Bob's. They are not the same version, and Bob's has real advantages (see my previous post). However, in neither case did I get the headers installed, so I can't compile extensions against it. I remember there was some issue about how they couldn't be installed properly because they need to go into System/Library/.... Is my only option to go get the full sources from the Numeric web site, and install the headers by hand? In any case, there really should be a way to install a "dev" version of a package, and get the necessary headers installed. -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 lsloan-000002 at umich.edu Fri Jul 30 15:30:18 2004 From: lsloan-000002 at umich.edu (Lance E Sloan) Date: Fri Jul 30 15:30:27 2004 Subject: [Pythonmac-SIG] Eclipse and Python on MOSX? Message-ID: <2147483647.1091179818@141-213-238-82.umnet.umich.edu> Has anybody on this list been able to use the Eclipse IDE for Python development on Mac OS X successfully? I've tried on my MOSX 10.3.4 machine, but I'm not able to run a simple "hello, world" program due to Java exceptions. I got the idea from this IBM DeveloperWorks article, "Python development with Eclipse and Ant": . The Eclipse homepage is at . I'm sorry if this is a repeat of an old question. I took a quick look through the Pipermail list archives on mail.python.org, but I didn't see any mention in the message subjects. It would be nice if the archive had a search feature. -- Lance E Sloan, Systems Research Programmer III U-M WATS: Web Applications, Technologies, and Solutions Full-service web and database design, development, and hosting. http://www.itcs.umich.edu/wats/ - "Putting U on the Web"