Kaydet (Commit) 7706c2da authored tarafından Brett Cannon's avatar Brett Cannon

Update references specifying "Macintosh" to mean OS X semantics and not Mac OS

9.

Applies patch #1095802.  Thanks Jack Jansen.
üst 22c0706a
...@@ -239,9 +239,8 @@ ...@@ -239,9 +239,8 @@
program name (set by \cfunction{Py_SetProgramName()} above) and some program name (set by \cfunction{Py_SetProgramName()} above) and some
environment variables. The returned string consists of a series of environment variables. The returned string consists of a series of
directory names separated by a platform dependent delimiter directory names separated by a platform dependent delimiter
character. The delimiter character is \character{:} on \UNIX, character. The delimiter character is \character{:} on \UNIX and Mac OS X,
\character{;} on Windows, and \character{\e n} (the \ASCII{} \character{;} on Windows. The returned string points into
newline character) on Macintosh. The returned string points into
static storage; the caller should not modify its value. The value static storage; the caller should not modify its value. The value
is available to Python code as the list is available to Python code as the list
\code{sys.path}\withsubitem{(in module sys)}{\ttindex{path}}, which \code{sys.path}\withsubitem{(in module sys)}{\ttindex{path}}, which
...@@ -272,7 +271,7 @@ ...@@ -272,7 +271,7 @@
this is formed from the ``official'' name of the operating system, this is formed from the ``official'' name of the operating system,
converted to lower case, followed by the major revision number; converted to lower case, followed by the major revision number;
e.g., for Solaris 2.x, which is also known as SunOS 5.x, the value e.g., for Solaris 2.x, which is also known as SunOS 5.x, the value
is \code{'sunos5'}. On Macintosh, it is \code{'mac'}. On Windows, is \code{'sunos5'}. On Mac OS X, it is \code{'darwin'}. On Windows,
it is \code{'win'}. The returned string points into static storage; it is \code{'win'}. The returned string points into static storage;
the caller should not modify its value. The value is available to the caller should not modify its value. The value is available to
Python code as \code{sys.platform}. Python code as \code{sys.platform}.
......
...@@ -34,7 +34,7 @@ values from C values. ...@@ -34,7 +34,7 @@ values from C values.
Return true when the interpreter runs out of stack space. This is a Return true when the interpreter runs out of stack space. This is a
reliable check, but is only available when \constant{USE_STACKCHECK} reliable check, but is only available when \constant{USE_STACKCHECK}
is defined (currently on Windows using the Microsoft Visual \Cpp{} is defined (currently on Windows using the Microsoft Visual \Cpp{}
compiler and on the Macintosh). \constant{USE_CHECKSTACK} will be compiler). \constant{USE_CHECKSTACK} will be
defined automatically; you should never change the definition in defined automatically; you should never change the definition in
your own code. your own code.
\end{cfuncdesc} \end{cfuncdesc}
......
...@@ -298,7 +298,7 @@ platform-neutral representation into whatever is appropriate on your ...@@ -298,7 +298,7 @@ platform-neutral representation into whatever is appropriate on your
current platform before actually using the pathname. This makes your current platform before actually using the pathname. This makes your
setup script portable across operating systems, which of course is one setup script portable across operating systems, which of course is one
of the major goals of the Distutils. In this spirit, all pathnames in of the major goals of the Distutils. In this spirit, all pathnames in
this document are slash-separated. (Mac OS programmers should keep in this document are slash-separated. (Mac OS 9 programmers should keep in
mind that the \emph{absence} of a leading slash indicates a relative mind that the \emph{absence} of a leading slash indicates a relative
path, the opposite of the Mac OS convention with colons.) path, the opposite of the Mac OS convention with colons.)
...@@ -1021,7 +1021,6 @@ python setup.py sdist ...@@ -1021,7 +1021,6 @@ python setup.py sdist
script or config file), \command{sdist} creates the archive of the script or config file), \command{sdist} creates the archive of the
default format for the current platform. The default format is a gzip'ed default format for the current platform. The default format is a gzip'ed
tar file (\file{.tar.gz}) on \UNIX, and ZIP file on Windows. tar file (\file{.tar.gz}) on \UNIX, and ZIP file on Windows.
\XXX{no Mac OS support here}
You can specify as many formats as you like using the You can specify as many formats as you like using the
\longprogramopt{formats} option, for example: \longprogramopt{formats} option, for example:
...@@ -2059,9 +2058,9 @@ regular filename character, and \code{[\var{range}]} matches any of the ...@@ -2059,9 +2058,9 @@ regular filename character, and \code{[\var{range}]} matches any of the
characters in \var{range} (e.g., \code{a-z}, \code{a-zA-Z}, characters in \var{range} (e.g., \code{a-z}, \code{a-zA-Z},
\code{a-f0-9\_.}). The definition of ``regular filename character'' is \code{a-f0-9\_.}). The definition of ``regular filename character'' is
platform-specific: on \UNIX{} it is anything except slash; on Windows platform-specific: on \UNIX{} it is anything except slash; on Windows
anything except backslash or colon; on Mac OS anything except colon. anything except backslash or colon; on Mac OS 9 anything except colon.
\XXX{Windows and Mac OS support not there yet} \XXX{Windows support not there yet}
%\section{Creating a built distribution: the %\section{Creating a built distribution: the
...@@ -2759,7 +2758,8 @@ This module provides the EMXCCompiler class, a subclass of \class{UnixCCompiler} ...@@ -2759,7 +2758,8 @@ This module provides the EMXCCompiler class, a subclass of \class{UnixCCompiler}
\modulesynopsis{Metrowerks CodeWarrior support} \modulesynopsis{Metrowerks CodeWarrior support}
Contains \class{MWerksCompiler}, an implementation of the abstract Contains \class{MWerksCompiler}, an implementation of the abstract
\class{CCompiler} class for MetroWerks CodeWarrior on the Macintosh. Needs work to support CW on Windows. \class{CCompiler} class for MetroWerks CodeWarrior on the pre-Mac OS X Macintosh.
Needs work to support CW on Windows or Mac OS X.
%\subsection{Utility modules} %\subsection{Utility modules}
...@@ -2999,7 +2999,7 @@ starts or ends with a slash. ...@@ -2999,7 +2999,7 @@ starts or ends with a slash.
Return \var{pathname} with \var{new_root} prepended. If \var{pathname} is Return \var{pathname} with \var{new_root} prepended. If \var{pathname} is
relative, this is equivalent to \samp{os.path.join(new_root,pathname)} relative, this is equivalent to \samp{os.path.join(new_root,pathname)}
Otherwise, it requires making \var{pathname} relative and then joining the Otherwise, it requires making \var{pathname} relative and then joining the
two, which is tricky on DOS/Windows and Mac OS. two, which is tricky on DOS/Windows.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{check_environ}{} \begin{funcdesc}{check_environ}{}
......
...@@ -374,7 +374,7 @@ called automatically unless there's an entry in the ...@@ -374,7 +374,7 @@ called automatically unless there's an entry in the
\cdata{_PyImport_Inittab} table. The easiest way to handle this is to \cdata{_PyImport_Inittab} table. The easiest way to handle this is to
statically initialize your statically-linked modules by directly statically initialize your statically-linked modules by directly
calling \cfunction{initspam()} after the call to calling \cfunction{initspam()} after the call to
\cfunction{Py_Initialize()} or \cfunction{PyMac_Initialize()}: \cfunction{Py_Initialize()}:
\begin{verbatim} \begin{verbatim}
int int
...@@ -426,7 +426,6 @@ system uses; see the chapters about building extension modules ...@@ -426,7 +426,6 @@ system uses; see the chapters about building extension modules
(chapter \ref{building}) and additional information that pertains only (chapter \ref{building}) and additional information that pertains only
to building on Windows (chapter \ref{building-on-windows}) for more to building on Windows (chapter \ref{building-on-windows}) for more
information about this. information about this.
% XXX Add information about Mac OS
If you can't use dynamic loading, or if you want to make your module a If you can't use dynamic loading, or if you want to make your module a
permanent part of the Python interpreter, you will have to change the permanent part of the Python interpreter, you will have to change the
......
...@@ -142,7 +142,7 @@ python setup.py install ...@@ -142,7 +142,7 @@ python setup.py install
On \UNIX, you'd run this command from a shell prompt; on Windows, you On \UNIX, you'd run this command from a shell prompt; on Windows, you
have to open a command prompt window (``DOS box'') and do it there; on have to open a command prompt window (``DOS box'') and do it there; on
Mac OS, things are a tad more complicated (see below). Mac OS X, you open a \command{Terminal} window to get a shell prompt.
\subsection{Platform variations} \subsection{Platform variations}
...@@ -262,7 +262,8 @@ If you don't choose an installation directory---i.e., if you just run ...@@ -262,7 +262,8 @@ If you don't choose an installation directory---i.e., if you just run
\code{setup.py install}---then the \command{install} command installs to \code{setup.py install}---then the \command{install} command installs to
the standard location for third-party Python modules. This location the standard location for third-party Python modules. This location
varies by platform and by how you built/installed Python itself. On varies by platform and by how you built/installed Python itself. On
\UNIX{} and Mac OS, it also depends on whether the module distribution \UNIX{} (and Mac OS X, which is also Unix-based),
it also depends on whether the module distribution
being installed is pure Python or contains extensions (``non-pure''): being installed is pure Python or contains extensions (``non-pure''):
\begin{tableiv}{l|l|l|c}{textrm}% \begin{tableiv}{l|l|l|c}{textrm}%
{Platform}{Standard installation location}{Default value}{Notes} {Platform}{Standard installation location}{Default value}{Notes}
...@@ -278,14 +279,6 @@ being installed is pure Python or contains extensions (``non-pure''): ...@@ -278,14 +279,6 @@ being installed is pure Python or contains extensions (``non-pure''):
{\filenq{\filevar{prefix}}} {\filenq{\filevar{prefix}}}
{\filenq{C:\textbackslash{}Python}} {\filenq{C:\textbackslash{}Python}}
{(2)} {(2)}
\lineiv{Mac OS (pure)}
{\filenq{\filevar{prefix}:Lib:site-packages}}
{\filenq{Python:Lib:site-packages}}
{}
\lineiv{Mac OS (non-pure)}
{\filenq{\filevar{prefix}:Lib:site-packages}}
{\filenq{Python:Lib:site-packages}}
{}
\end{tableiv} \end{tableiv}
\noindent Notes: \noindent Notes:
...@@ -302,8 +295,8 @@ being installed is pure Python or contains extensions (``non-pure''): ...@@ -302,8 +295,8 @@ being installed is pure Python or contains extensions (``non-pure''):
\filevar{prefix} and \filevar{exec-prefix} stand for the directories \filevar{prefix} and \filevar{exec-prefix} stand for the directories
that Python is installed to, and where it finds its libraries at that Python is installed to, and where it finds its libraries at
run-time. They are always the same under Windows and Mac OS, and very run-time. They are always the same under Windows, and very
often the same under \UNIX. You can find out what your Python often the same under \UNIX and Mac OS X. You can find out what your Python
installation uses for \filevar{prefix} and \filevar{exec-prefix} by installation uses for \filevar{prefix} and \filevar{exec-prefix} by
running Python in interactive mode and typing a few simple commands. running Python in interactive mode and typing a few simple commands.
Under \UNIX, just type \code{python} at the shell prompt. Under Under \UNIX, just type \code{python} at the shell prompt. Under
...@@ -658,7 +651,7 @@ environment variables, such as Mac OS 9, the configuration ...@@ -658,7 +651,7 @@ environment variables, such as Mac OS 9, the configuration
variables supplied by the Distutils are the only ones you can use.) variables supplied by the Distutils are the only ones you can use.)
See section~\ref{config-files} for details. See section~\ref{config-files} for details.
% XXX need some Windows and Mac OS examples---when would custom % XXX need some Windows examples---when would custom
% installation schemes be needed on those platforms? % installation schemes be needed on those platforms?
...@@ -764,7 +757,7 @@ apply, values from ``earlier'' files are overridden by ``later'' files. ...@@ -764,7 +757,7 @@ apply, values from ``earlier'' files are overridden by ``later'' files.
\label{config-filenames} \label{config-filenames}
The names and locations of the configuration files vary slightly across The names and locations of the configuration files vary slightly across
platforms. On \UNIX, the three configuration files (in the order they platforms. On \UNIX and Mac OS X, the three configuration files (in the order they
are processed) are: are processed) are:
\begin{tableiii}{l|l|c}{textrm} \begin{tableiii}{l|l|c}{textrm}
{Type of file}{Location and filename}{Notes} {Type of file}{Location and filename}{Notes}
...@@ -773,7 +766,7 @@ are processed) are: ...@@ -773,7 +766,7 @@ are processed) are:
\lineiii{local}{\filenq{setup.cfg}}{(3)} \lineiii{local}{\filenq{setup.cfg}}{(3)}
\end{tableiii} \end{tableiii}
On Windows, the configuration files are: And on Windows, the configuration files are:
\begin{tableiii}{l|l|c}{textrm} \begin{tableiii}{l|l|c}{textrm}
{Type of file}{Location and filename}{Notes} {Type of file}{Location and filename}{Notes}
\lineiii{system}{\filenq{\filevar{prefix}\textbackslash{}Lib\textbackslash{}distutils\textbackslash{}distutils.cfg}}{(4)} \lineiii{system}{\filenq{\filevar{prefix}\textbackslash{}Lib\textbackslash{}distutils\textbackslash{}distutils.cfg}}{(4)}
...@@ -781,14 +774,6 @@ On Windows, the configuration files are: ...@@ -781,14 +774,6 @@ On Windows, the configuration files are:
\lineiii{local}{\filenq{setup.cfg}}{(3)} \lineiii{local}{\filenq{setup.cfg}}{(3)}
\end{tableiii} \end{tableiii}
And on Mac OS, they are:
\begin{tableiii}{l|l|c}{textrm}
{Type of file}{Location and filename}{Notes}
\lineiii{system}{\filenq{\filevar{prefix}:Lib:distutils:distutils.cfg}}{(6)}
\lineiii{personal}{N/A}{}
\lineiii{local}{\filenq{setup.cfg}}{(3)}
\end{tableiii}
\noindent Notes: \noindent Notes:
\begin{description} \begin{description}
\item[(1)] Strictly speaking, the system-wide configuration file lives \item[(1)] Strictly speaking, the system-wide configuration file lives
...@@ -818,9 +803,6 @@ And on Mac OS, they are: ...@@ -818,9 +803,6 @@ And on Mac OS, they are:
defined, no personal configuration file will be found or used. (In defined, no personal configuration file will be found or used. (In
other words, the Distutils make no attempt to guess your home other words, the Distutils make no attempt to guess your home
directory on Windows.) directory on Windows.)
\item[(6)] (See also notes (1) and (4).) The default installation
prefix is just \file{Python:}, so under Python 1.6 and later this is
normally\file{Python:Lib:distutils:distutils.cfg}.
\end{description} \end{description}
......
...@@ -135,8 +135,8 @@ The module was found as dynamically loadable shared library. ...@@ -135,8 +135,8 @@ The module was found as dynamically loadable shared library.
\end{datadesc} \end{datadesc}
\begin{datadesc}{PY_RESOURCE} \begin{datadesc}{PY_RESOURCE}
The module was found as a Macintosh resource. This value can only be The module was found as a Mac OS 9 resource. This value can only be
returned on a Macintosh. returned on a Mac OS 9 or earlier Macintosh.
\end{datadesc} \end{datadesc}
\begin{datadesc}{PKG_DIRECTORY} \begin{datadesc}{PKG_DIRECTORY}
......
This diff is collapsed.
...@@ -16,9 +16,9 @@ search path. ...@@ -16,9 +16,9 @@ search path.
It starts by constructing up to four directories from a head and a It starts by constructing up to four directories from a head and a
tail part. For the head part, it uses \code{sys.prefix} and tail part. For the head part, it uses \code{sys.prefix} and
\code{sys.exec_prefix}; empty heads are skipped. For \code{sys.exec_prefix}; empty heads are skipped. For
the tail part, it uses the empty string (on Macintosh or Windows) or the tail part, it uses the empty string (on Windows) or
it uses first \file{lib/python\shortversion/site-packages} and then it uses first \file{lib/python\shortversion/site-packages} and then
\file{lib/site-python} (on \UNIX). For each of the distinct \file{lib/site-python} (on \UNIX and Macintosh). For each of the distinct
head-tail combinations, it sees if it refers to an existing directory, head-tail combinations, it sees if it refers to an existing directory,
and if so, adds it to \code{sys.path} and also inspects the newly added and if so, adds it to \code{sys.path} and also inspects the newly added
path for configuration files. path for configuration files.
......
...@@ -146,7 +146,6 @@ files in. The list is: ...@@ -146,7 +146,6 @@ files in. The list is:
\item The directory named by the \envvar{TMP} environment variable. \item The directory named by the \envvar{TMP} environment variable.
\item A platform-specific location: \item A platform-specific location:
\begin{itemize} \begin{itemize}
\item On Macintosh, the \file{Temporary Items} folder.
\item On RiscOS, the directory named by the \item On RiscOS, the directory named by the
\envvar{Wimp\$ScrapDir} environment variable. \envvar{Wimp\$ScrapDir} environment variable.
\item On Windows, the directories \item On Windows, the directories
......
...@@ -15,7 +15,8 @@ different levels, i.e. to handle clicks in a single dialog window in a ...@@ -15,7 +15,8 @@ different levels, i.e. to handle clicks in a single dialog window in a
non-standard way it is not necessary to override the complete event non-standard way it is not necessary to override the complete event
handling. handling.
The \module{FrameWork} is still very much work-in-progress, and the Work on the \module{FrameWork} has pretty much stopped, now that
\module{PyObjC} is available for full Cocoa access from Python, and the
documentation describes only the most important functionality, and not documentation describes only the most important functionality, and not
in the most logical manner at that. Examine the source or the examples in the most logical manner at that. Examine the source or the examples
for more details. The following are some comments posted on the for more details. The following are some comments posted on the
......
\section{\module{mac} ---
Implementations for the \module{os} module}
\declaremodule{builtin}{mac}
\platform{Mac}
\modulesynopsis{Implementations for the \module{os} module.}
This module implements the Mac OS 9 operating system dependent functionality
provided by the standard module \module{os}\refstmodindex{os}. It is
best accessed through the \module{os} module. This module is only available in
MacPython-OS9, on MacPython-OSX \module{posix} is used.
The following functions are available in this module:
\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-OS9.
\section{\module{macpath} --- \section{\module{macpath} ---
MacOS path manipulation functions} MacOS path manipulation functions}
...@@ -41,9 +8,10 @@ values in MacPython-OS9. ...@@ -41,9 +8,10 @@ values in MacPython-OS9.
\modulesynopsis{MacOS path manipulation functions.} \modulesynopsis{MacOS path manipulation functions.}
This module is the Macintosh implementation of the \module{os.path} This module is the Mac OS 9 (and earlier) implementation of the \module{os.path}
module. It is most portably accessed as module. It can be used to manipulate old-style Macintosh pathnames on Mac OS
\module{os.path}\refstmodindex{os.path}. Refer to the X (or any other platform).
Refer to the
\citetitle[../lib/lib.html]{Python Library Reference} for \citetitle[../lib/lib.html]{Python Library Reference} for
documentation of \module{os.path}. documentation of \module{os.path}.
......
...@@ -6,13 +6,8 @@ ...@@ -6,13 +6,8 @@
\modulesynopsis{Access to Internet Config.} \modulesynopsis{Access to Internet Config.}
This module provides access to Macintosh Internet This module provides access to various internet-related preferences
Config\index{Internet Config} package, set through \program{System Preferences} or the \program{Finder}.
which stores preferences for Internet programs such as mail address,
default homepage, etc. Also, Internet Config contains an elaborate set
of mappings from Macintosh creator/type codes to foreign filename
extensions plus information on how to transfer files (binary, ascii,
etc.). Since MacOS 9, this module is a control panel named Internet.
There is a low-level companion module There is a low-level companion module
\module{icglue}\refbimodindex{icglue} which provides the basic \module{icglue}\refbimodindex{icglue} which provides the basic
...@@ -92,7 +87,7 @@ complete incomplete URLs. ...@@ -92,7 +87,7 @@ complete incomplete URLs.
\begin{methoddesc}{mapfile}{file} \begin{methoddesc}{mapfile}{file}
Return the mapping entry for the given \var{file}, which can be passed Return the mapping entry for the given \var{file}, which can be passed
as either a filename or an \function{macfs.FSSpec()} result, and which as either a filename or an \function{FSSpec()} result, and which
need not exist. need not exist.
The mapping entry is returned as a tuple \code{(\var{version}, The mapping entry is returned as a tuple \code{(\var{version},
...@@ -122,7 +117,7 @@ The mapping entry is returned in the same format as for \var{mapfile}. ...@@ -122,7 +117,7 @@ The mapping entry is returned in the same format as for \var{mapfile}.
\begin{methoddesc}{settypecreator}{file} \begin{methoddesc}{settypecreator}{file}
Given an existing \var{file}, specified either as a filename or as an Given an existing \var{file}, specified either as a filename or as an
\function{macfs.FSSpec()} result, set its creator and type correctly based \function{FSSpec()} result, set its creator and type correctly based
on its extension. The finder is told about the change, so the finder on its extension. The finder is told about the change, so the finder
icon will be updated quickly. icon will be updated quickly.
\end{methoddesc} \end{methoddesc}
...@@ -14,11 +14,10 @@ Note the capitalization of the module name; this is a historical ...@@ -14,11 +14,10 @@ Note the capitalization of the module name; this is a historical
artifact. artifact.
\begin{datadesc}{runtimemodel} \begin{datadesc}{runtimemodel}
Either\code{'carbon'} or \code{'macho'}. This Always \code{'macho'}, from Python 2.4 on.
signifies whether this Python uses the Mac OS X and Mac OS 9 compatible In earlier versions of Python the value could
CarbonLib style or the Mac OS also be \code{'ppc'} for the classic Mac OS 8 runtime model or
X-only Mach-O style. In earlier versions of Python the value could \code{'carbon'} for the Mac OS 9 runtime model.
also be \code{'ppc'} for the classic Mac OS 8 runtime model.
\end{datadesc} \end{datadesc}
\begin{datadesc}{linkmodel} \begin{datadesc}{linkmodel}
...@@ -26,8 +25,9 @@ The way the interpreter has been linked. As extension modules may be ...@@ -26,8 +25,9 @@ The way the interpreter has been linked. As extension modules may be
incompatible between linking models, packages could use this information to give incompatible between linking models, packages could use this information to give
more decent error messages. The value is one of \code{'static'} for a more decent error messages. The value is one of \code{'static'} for a
statically linked Python, \code{'framework'} for Python in a Mac OS X framework, statically linked Python, \code{'framework'} for Python in a Mac OS X framework,
\code{'shared'} for Python in a standard unix shared library and \code{'shared'} for Python in a standard unix shared library.
\code{'cfm'} for the Mac OS 9-compatible Python. Older Pythons could also have the value
\code{'cfm'} for Mac OS 9-compatible Python.
\end{datadesc} \end{datadesc}
\begin{excdesc}{Error} \begin{excdesc}{Error}
...@@ -39,84 +39,16 @@ Symbolic names for all known error codes are defined in the standard ...@@ -39,84 +39,16 @@ Symbolic names for all known error codes are defined in the standard
module \refmodule{macerrors}.\refstmodindex{macerrors} module \refmodule{macerrors}.\refstmodindex{macerrors}
\end{excdesc} \end{excdesc}
\begin{funcdesc}{SetEventHandler}{handler}
In the inner interpreter loop Python will occasionally check for events,
unless disabled with \function{ScheduleParams()}. With this function you
can pass a Python event-handler function that will be called if an event
is available. The event is passed as parameter and the function should return
non-zero if the event has been fully processed, otherwise event processing
continues (by passing the event to the console window package, for instance).
Call \function{SetEventHandler()} without a parameter to clear the
event handler. Setting an event handler while one is already set is an
error.
Availability: MacPython-OS9.
\end{funcdesc}
\begin{funcdesc}{SchedParams}{\optional{doint\optional{, evtmask\optional{,
besocial\optional{, interval\optional{,
bgyield}}}}}}
Influence the interpreter inner loop event handling. \var{Interval}
specifies how often (in seconds, floating point) the interpreter
should enter the event processing code. When true, \var{doint} causes
interrupt (command-dot) checking to be done. \var{evtmask} tells the
interpreter to do event processing for events in the mask (redraws,
mouseclicks to switch to other applications, etc). The \var{besocial}
flag gives other processes a chance to run. They are granted minimal
runtime when Python is in the foreground and \var{bgyield} seconds per
\var{interval} when Python runs in the background.
All parameters are optional, and default to the current value. The return
value of this function is a tuple with the old values of these options.
Initial defaults are that all processing is enabled, checking is done every
quarter second and the processor is given up for a quarter second when in the
background.
The most common use case is to call \code{SchedParams(0, 0)} to completely disable
event handling in the interpreter mainloop.
Availability: MacPython-OS9.
\end{funcdesc}
\begin{funcdesc}{HandleEvent}{ev}
Pass the event record \var{ev} back to the Python event loop, or
possibly to the handler for the \code{sys.stdout} window (based on the
compiler used to build Python). This allows Python programs that do
their own event handling to still have some command-period and
window-switching capability.
If you attempt to call this function from an event handler set through
\function{SetEventHandler()} you will get an exception.
Availability: MacPython-OS9.
\end{funcdesc}
\begin{funcdesc}{GetErrorString}{errno} \begin{funcdesc}{GetErrorString}{errno}
Return the textual description of MacOS error code \var{errno}. Return the textual description of MacOS error code \var{errno}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{splash}{resid}
This function will put a splash window
on-screen, with the contents of the DLOG resource specified by
\var{resid}. Calling with a zero argument will remove the splash
screen. This function is useful if you want an applet to post a splash screen
early in initialization without first having to load numerous
extension modules.
Availability: MacPython-OS9.
\end{funcdesc}
\begin{funcdesc}{DebugStr}{message \optional{, object}} \begin{funcdesc}{DebugStr}{message \optional{, object}}
On Mac OS 9, drop to the low-level debugger with message \var{message}. The On Mac OS X the string is simply printed to stderr (on older
optional \var{object} argument is not used, but can easily be Mac OS systems more elaborate functionality was available),
inspected from the debugger. On Mac OS X the string is simply printed but it provides a convenient location to attach a breakpoint
to stderr. in a low-level debugger like \program{gdb}.
Note that you should use this function with extreme care: if no
low-level debugger like MacsBug is installed this call will crash your
system. It is intended mainly for developers of Python extension
modules.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{SysBeep}{} \begin{funcdesc}{SysBeep}{}
...@@ -155,6 +87,4 @@ or when the current interpreter is not running from a fullblown application ...@@ -155,6 +87,4 @@ or when the current interpreter is not running from a fullblown application
bundle. A script runs from an application bundle either when it has been bundle. A script runs from an application bundle either when it has been
started with \program{pythonw} instead of \program{python} or when running started with \program{pythonw} instead of \program{python} or when running
as an applet. as an applet.
On Mac OS 9 the method always returns \code{True}.
\end{funcdesc} \end{funcdesc}
\chapter{MacPython OSA Modules \label{scripting}} \chapter{MacPython OSA Modules \label{scripting}}
Python has a fairly complete implementation of the Open Scripting This chapter describes the current implementation of the Open Scripting
Architecture (OSA, also commonly referred to as AppleScript), allowing Architecure (OSA, also commonly referred to as AppleScript) for Python, allowing
you to control scriptable applications from your Python program, you to control scriptable applications from your Python program,
and with a fairly pythonic interface. and with a fairly pythonic interface. Development on this set of modules
has stopped, and a replacement is expected for Python 2.5.
For a description of the various components of AppleScript and OSA, and For a description of the various components of AppleScript and OSA, and
to get an understanding of the architecture and terminology, you should to get an understanding of the architecture and terminology, you should
......
...@@ -21,17 +21,7 @@ touch with ...@@ -21,17 +21,7 @@ touch with
\modulesynopsis{Helper module for BuildApplet, BuildApplication and \modulesynopsis{Helper module for BuildApplet, BuildApplication and
macfreeze.} macfreeze.}
\deprecated{2.4}
\section{\module{py_resource} --- Resources from Python code}
\declaremodule[pyresource]{standard}{py_resource}
\platform{Mac}
\modulesynopsis{Helper to create \texttt{'PYC~'} resources for compiled
applications.}
This module is primarily used as a help module for
\program{BuildApplet} and \program{BuildApplication}. It is able to
store compiled Python code as \texttt{'PYC~'} resources in a file.
\section{\module{cfmfile} --- Code Fragment Resource module} \section{\module{cfmfile} --- Code Fragment Resource module}
\declaremodule{standard}{cfmfile} \declaremodule{standard}{cfmfile}
...@@ -43,6 +33,7 @@ accompanying ``cfrg'' resources. It can parse them and merge them, and is ...@@ -43,6 +33,7 @@ accompanying ``cfrg'' resources. It can parse them and merge them, and is
used by BuildApplication to combine all plugin modules to a single used by BuildApplication to combine all plugin modules to a single
executable. executable.
\deprecated{2.4}
\section{\module{icopen} --- Internet Config replacement for \method{open()}} \section{\module{icopen} --- Internet Config replacement for \method{open()}}
\declaremodule{standard}{icopen} \declaremodule{standard}{icopen}
...@@ -79,30 +70,6 @@ script is run under MacPython, as a MacPython applet or under OSX Python. ...@@ -79,30 +70,6 @@ script is run under MacPython, as a MacPython applet or under OSX Python.
A low-level interface to Navigation Services. A low-level interface to Navigation Services.
\section{\module{mkcwproject} --- Create CodeWarrior projects}
\declaremodule{standard}{mkcwproject}
\platform{Mac}
\modulesynopsis{Create CodeWarrior projects.}
\refmodindex{distutils}
\module{mkcwproject} creates project files for the Metrowerks CodeWarrior
development environment. It is a helper module for
\module{distutils} but can be used separately for more
control.
\section{\module{nsremote} --- Wrapper around Netscape OSA modules}
\declaremodule{standard}{nsremote}
\platform{Mac}
\modulesynopsis{Wrapper around Netscape OSA modules.}
\module{nsremote} is a wrapper around the Netscape OSA modules that
allows you to easily send your browser to a given URL. A related
module that may be of interest is the \module{webbrowser} module,
documented in the \citetitle[../lib/lib.html]{Python Library
Reference}.
\section{\module{PixMapWrapper} --- Wrapper for PixMap objects} \section{\module{PixMapWrapper} --- Wrapper for PixMap objects}
\declaremodule{standard}{PixMapWrapper} \declaremodule{standard}{PixMapWrapper}
\platform{Mac} \platform{Mac}
...@@ -112,43 +79,6 @@ Reference}. ...@@ -112,43 +79,6 @@ Reference}.
allows access to the fields by name. It also has methods to convert allows access to the fields by name. It also has methods to convert
to and from \module{PIL} images. to and from \module{PIL} images.
\section{\module{preferences} --- Application preferences manager}
\declaremodule{standard}{preferences}
\platform{Mac}
\modulesynopsis{Nice application preferences manager with support for
defaults.}
The \module{preferences} module allows storage of user preferences in
the system-wide preferences folder, with defaults coming from the
application itself and the possibility to override preferences for
specific situations.
\section{\module{pythonprefs} --- Preferences manager for Python}
\declaremodule{standard}{pythonprefs}
\platform{Mac}
\modulesynopsis{Specialized preferences manager for the Python
interpreter.}
This module is a specialization of the \refmodule{preferences} module
that allows reading and writing of the preferences for the Python
interpreter.
\section{\module{quietconsole} --- Non-visible standard output}
\declaremodule{standard}{quietconsole}
\platform{Mac}
\modulesynopsis{Buffered, non-visible standard output.}
\module{quietconsole} allows you to keep stdio output in a buffer
without displaying it (or without displaying the stdout window
altogether, if set with \program{EditPythonPrefs}) until you try to read from
stdin or disable the buffering, at which point all the saved output is
sent to the window. Good for programs with graphical user interfaces
that do want to display their output at a crash.
\section{\module{videoreader} --- Read QuickTime movies} \section{\module{videoreader} --- Read QuickTime movies}
\declaremodule{standard}{videoreader} \declaremodule{standard}{videoreader}
\platform{Mac} \platform{Mac}
......
This diff is collapsed.
...@@ -3105,8 +3105,7 @@ in text files are automatically altered slightly when data is read or ...@@ -3105,8 +3105,7 @@ in text files are automatically altered slightly when data is read or
written. This behind-the-scenes modification to file data is fine for written. This behind-the-scenes modification to file data is fine for
\ASCII{} text files, but it'll corrupt binary data like that in JPEGs or \ASCII{} text files, but it'll corrupt binary data like that in JPEGs or
\file{.EXE} files. Be very careful to use binary mode when reading and \file{.EXE} files. Be very careful to use binary mode when reading and
writing such files. (Note that the precise semantics of text mode on writing such files.
the Macintosh depends on the underlying C library being used.)
\subsection{Methods of File Objects \label{fileMethods}} \subsection{Methods of File Objects \label{fileMethods}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment