1998-04-17 17:07:21 -03:00
|
|
|
\section{Introduction}
|
|
|
|
\label{intro}
|
|
|
|
|
1998-04-16 23:46:34 -03:00
|
|
|
The modules in this manual are available on the Apple Macintosh only.
|
1994-01-01 21:22:07 -04:00
|
|
|
|
1996-07-20 23:20:58 -03:00
|
|
|
Aside from the modules described here there are also interfaces to
|
|
|
|
various MacOS toolboxes, which are currently not extensively
|
|
|
|
described. The toolboxes for which modules exist are:
|
1998-02-18 11:21:26 -04:00
|
|
|
\module{AE} (Apple Events),
|
|
|
|
\module{Cm} (Component Manager),
|
|
|
|
\module{Ctl} (Control Manager),
|
|
|
|
\module{Dlg} (Dialog Manager),
|
|
|
|
\module{Evt} (Event Manager),
|
|
|
|
\module{Fm} (Font Manager),
|
|
|
|
\module{List} (List Manager),
|
|
|
|
\module{Menu} (Moenu Manager),
|
|
|
|
\module{Qd} (QuickDraw),
|
|
|
|
\module{Qt} (QuickTime),
|
|
|
|
\module{Res} (Resource Manager and Handles),
|
|
|
|
\module{Scrap} (Scrap Manager),
|
|
|
|
\module{Snd} (Sound Manager),
|
|
|
|
\module{TE} (TextEdit),
|
|
|
|
\module{Waste} (non-Apple \program{TextEdit} replacement) and
|
|
|
|
\module{Win} (Window Manager).
|
1996-07-20 23:20:58 -03:00
|
|
|
|
|
|
|
If applicable the module will define a number of Python objects for
|
|
|
|
the various structures declared by the toolbox, and operations will be
|
|
|
|
implemented as methods of the object. Other operations will be
|
|
|
|
implemented as functions in the module. Not all operations possible in
|
1998-02-19 15:45:19 -04:00
|
|
|
\C{} will also be possible in Python (callbacks are often a problem), and
|
1996-07-20 23:20:58 -03:00
|
|
|
parameters will occasionally be different in Python (input and output
|
|
|
|
buffers, especially). All methods and functions have a \code{__doc__}
|
|
|
|
string describing their arguments and return values, and for
|
1998-02-19 15:45:19 -04:00
|
|
|
additional description you are referred to \emph{Inside Macintosh} or
|
|
|
|
similar works.
|
|
|
|
|
|
|
|
The following modules are documented here:
|
|
|
|
|
1998-07-23 14:55:31 -03:00
|
|
|
\localmoduletable
|
1998-02-19 15:45:19 -04:00
|
|
|
|
|
|
|
|
1998-08-10 15:40:22 -03:00
|
|
|
\section{\module{mac} ---
|
1999-02-01 16:19:38 -04:00
|
|
|
Implementations for the \module{os} module}
|
1998-02-19 15:45:19 -04:00
|
|
|
|
1999-03-02 12:37:17 -04:00
|
|
|
\declaremodule{builtin}{mac}
|
|
|
|
\platform{Mac}
|
1999-02-01 16:19:38 -04:00
|
|
|
\modulesynopsis{Implementations for the \module{os} module.}
|
1998-02-19 15:45:19 -04:00
|
|
|
|
1996-07-20 23:20:58 -03:00
|
|
|
|
1999-02-01 16:19:38 -04:00
|
|
|
This module implements the operating system dependent functionality
|
|
|
|
provided by the standard module \module{os}\refstmodindex{os}. It is
|
|
|
|
best accessed through the \module{os} module.
|
1994-01-01 21:22:07 -04:00
|
|
|
|
|
|
|
The following functions are available in this module:
|
1998-02-18 11:21:26 -04:00
|
|
|
\function{chdir()},
|
|
|
|
\function{close()},
|
|
|
|
\function{dup()},
|
|
|
|
\function{fdopen()},
|
|
|
|
\function{getcwd()},
|
|
|
|
\function{lseek()},
|
|
|
|
\function{listdir()},
|
|
|
|
\function{mkdir()},
|
|
|
|
\function{open()},
|
|
|
|
\function{read()},
|
|
|
|
\function{rename()},
|
|
|
|
\function{rmdir()},
|
|
|
|
\function{stat()},
|
|
|
|
\function{sync()},
|
|
|
|
\function{unlink()},
|
|
|
|
\function{write()},
|
|
|
|
as well as the exception \exception{error}. Note that the times
|
|
|
|
returned by \function{stat()} are floating-point values, like all time
|
|
|
|
values in MacPython.
|
1996-10-15 11:37:31 -03:00
|
|
|
|
1999-02-01 16:19:38 -04:00
|
|
|
One additional function is available:
|
|
|
|
|
|
|
|
\begin{funcdesc}{xstat}{path}
|
|
|
|
This function returns the same information as \function{stat()}, but
|
|
|
|
with three additional values appended: the size of the resource fork
|
|
|
|
of the file and its 4-character creator and type.
|
|
|
|
\end{funcdesc}
|
1994-01-01 21:22:07 -04:00
|
|
|
|
1998-07-23 14:55:31 -03:00
|
|
|
|
1998-08-10 15:40:22 -03:00
|
|
|
\section{\module{macpath} ---
|
1999-02-01 16:19:38 -04:00
|
|
|
MacOS path manipulation functions}
|
1998-07-23 14:55:31 -03:00
|
|
|
|
1999-03-02 12:37:17 -04:00
|
|
|
\declaremodule{standard}{macpath}
|
|
|
|
% Could be labeled \platform{Mac}, but the module should work anywhere and
|
|
|
|
% is distributed with the standard library.
|
1998-07-23 14:55:31 -03:00
|
|
|
\modulesynopsis{MacOS path manipulation functions.}
|
|
|
|
|
1998-02-18 11:21:26 -04:00
|
|
|
|
1999-02-01 16:19:38 -04:00
|
|
|
This module is the Macintosh implementation of the \module{os.path}
|
|
|
|
module. It is most portably accessed as \module{os.path}.
|
|
|
|
\refstmodindex{os.path}
|
1994-01-01 21:22:07 -04:00
|
|
|
|
|
|
|
The following functions are available in this module:
|
1998-02-18 11:21:26 -04:00
|
|
|
\function{normcase()},
|
|
|
|
\function{normpath()},
|
|
|
|
\function{isabs()},
|
|
|
|
\function{join()},
|
|
|
|
\function{split()},
|
|
|
|
\function{isdir()},
|
|
|
|
\function{isfile()},
|
|
|
|
\function{walk()},
|
|
|
|
\function{exists()}.
|
1999-02-01 16:19:38 -04:00
|
|
|
For other functions available in \module{os.path} dummy counterparts
|
1996-07-20 23:20:58 -03:00
|
|
|
are available.
|