[Pythonmac-SIG] MachoPython and os.getbootvol()?

Kevin Ollivier kevino@tulane.edu
Mon, 4 Nov 2002 11:45:03 -0500


Hi all,

Let me start off by explaining what I am trying to do. =) I'm running 
MachoPython downloaded from the wxPython sourceforge site. I have a 
wxPython application (that's why I'm using MachoPython) and I'm working 
on an "import" function which imports an HTML page into the user's 
project folder. When I do this, I would like to also copy over any 
associated image or http links stored locally so the links don't break. 
(if the file is an internet link, like www.address.com, I don't mess 
with it.)

I'm now trying to implement support for absolute links. (i.e. 
file:///mydir/myfile.ext) The problem is that packages like Dreamweaver 
create links like so: "file:///Macintosh HD/Users/myname/myfile.ext". Of 
course, "Macintosh HD" is not used to denote the root of the volume 
under OS X, although on OS 9 it is. I tried URLParse and urlretrieve but 
they both fail, so I considered stripping out the boot volume name, if 
it exists in the path. I also tried switching the path separator to ":" 
(i.e. "Macintosh HD:Users:myname:myfile.ext") but os.path.isfile() 
returned false, meaning that I don't think Unix Python interprets Mac 
paths yet.

I know this is still alpha-level (pre-alpha?) software, so I realize 
it's not quite there yet. =) (I'm also trying to see if I can get 
wxPython running on MacPython 2.2.2.) I just thought I'd throw this out 
to see if there are any easy answers I'm missing!

Thanks,

Kevin