Guido van Rossum | ecde781 | 1995-03-28 13:35:14 +0000 | [diff] [blame] | 1 | \chapter{Macintosh Specific Services} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 2 | |
Guido van Rossum | 8675115 | 1995-02-28 17:14:32 +0000 | [diff] [blame] | 3 | The modules in this chapter are available on the Apple Macintosh only. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 4 | |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 5 | Aside from the modules described here there are also interfaces to |
| 6 | various MacOS toolboxes, which are currently not extensively |
| 7 | described. The toolboxes for which modules exist are: |
| 8 | \code{AE} (Apple Events), |
| 9 | \code{Cm} (Component Manager), |
| 10 | \code{Ctl} (Control Manager), |
| 11 | \code{Dlg} (Dialog Manager), |
| 12 | \code{Evt} (Event Manager), |
| 13 | \code{Fm} (Font Manager), |
| 14 | \code{List} (List Manager), |
| 15 | \code{Menu} (Moenu Manager), |
| 16 | \code{Qd} (QuickDraw), |
| 17 | \code{Qt} (QuickTime), |
| 18 | \code{Res} (Resource Manager and Handles), |
| 19 | \code{Scrap} (Scrap Manager), |
| 20 | \code{Snd} (Sound Manager), |
| 21 | \code{TE} (TextEdit), |
| 22 | \code{Waste} (non-Apple TextEdit replacement) and |
| 23 | \code{Win} (Window Manager). |
| 24 | |
| 25 | If applicable the module will define a number of Python objects for |
| 26 | the various structures declared by the toolbox, and operations will be |
| 27 | implemented as methods of the object. Other operations will be |
| 28 | implemented as functions in the module. Not all operations possible in |
| 29 | C will also be possible in Python (callbacks are often a problem), and |
| 30 | parameters will occasionally be different in Python (input and output |
| 31 | buffers, especially). All methods and functions have a \code{__doc__} |
| 32 | string describing their arguments and return values, and for |
| 33 | additional description you are referred to Inside Mac or similar |
| 34 | works. |
| 35 | |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 36 | \section{Built-in Module \sectcode{mac}} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 37 | |
| 38 | \bimodindex{mac} |
| 39 | This module provides a subset of the operating system dependent |
| 40 | functionality provided by the optional built-in module \code{posix}. |
| 41 | It is best accessed through the more portable standard module |
| 42 | \code{os}. |
| 43 | |
| 44 | The following functions are available in this module: |
| 45 | \code{chdir}, |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 46 | \code{close}, |
| 47 | \code{dup}, |
| 48 | \code{fdopen}, |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 49 | \code{getcwd}, |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 50 | \code{lseek}, |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 51 | \code{listdir}, |
| 52 | \code{mkdir}, |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 53 | \code{open}, |
| 54 | \code{read}, |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 55 | \code{rename}, |
| 56 | \code{rmdir}, |
| 57 | \code{stat}, |
| 58 | \code{sync}, |
| 59 | \code{unlink}, |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 60 | \code{write}, |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 61 | as well as the exception \code{error}. |
| 62 | |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 63 | \section{Standard Module \sectcode{macpath}} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 64 | |
| 65 | \stmodindex{macpath} |
| 66 | This module provides a subset of the pathname manipulation functions |
| 67 | available from the optional standard module \code{posixpath}. It is |
| 68 | best accessed through the more portable standard module \code{os}, as |
| 69 | \code{os.path}. |
| 70 | |
| 71 | The following functions are available in this module: |
| 72 | \code{normcase}, |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 73 | \code{normpath}, |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 74 | \code{isabs}, |
| 75 | \code{join}, |
| 76 | \code{split}, |
| 77 | \code{isdir}, |
| 78 | \code{isfile}, |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 79 | \code{walk}, |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 80 | \code{exists}. |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 81 | For other functions available in \code{posixpath} dummy counterparts |
| 82 | are available. |