[Pythonmac-SIG] AppleEvents in MacPython 2.3?

Jack Jansen Jack.Jansen at cwi.nl
Sat Aug 16 13:52:37 EDT 2003


On zaterdag, aug 16, 2003, at 00:26 Europe/Amsterdam, Larry Meyn wrote:

> Jack,
>
> Thanks! This should should work great for my application. Although I'm 
> wanting paths to new files, I'm only placing them in existing 
> directories and your function can give me robust OS 9 paths for those.

What I would do if the path can be new is something like

if os.path.exists(path):
	return makeOS9abspath(path)
head, tail = os.path.split(path)
head = makeOS9abspath(head)
if len(tail) > 31 or ':' in tail:
	raise IOError, "Come up with good error message here"
return macpath.join(head, unicode(tail, 'utf8').encode('mac-roman'))
--
- Jack Jansen        <Jack.Jansen at oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -




More information about the Pythonmac-SIG mailing list