Kaydet (Commit) 4e21dc9e authored tarafından Fred Drake's avatar Fred Drake

- make this section format

- start cleaning up the markup for consistency
- comment out the reference to a MS KnowledgeBase article that doesn't
  seem to be present at msdn.microsoft.com; hopefully someone can
  point out an alternate source for the relevant information
üst 5e75f150
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
\versionadded{2.3} \versionadded{2.3}
\begin{notice}[note] \begin{notice}
Specific platforms listed alphabetically, with Linux included in the \UNIX Specific platforms listed alphabetically, with Linux included in the
section. \UNIX{} section.
\end{notice} \end{notice}
\subsection{Cross Platform} \subsection{Cross Platform}
...@@ -38,52 +38,46 @@ ...@@ -38,52 +38,46 @@
\begin{funcdesc}{machine}{} \begin{funcdesc}{machine}{}
Returns the machine type, e.g. \code{'i386'}. Returns the machine type, e.g. \code{'i386'}.
An empty string is returned if the value cannot be determined. An empty string is returned if the value cannot be determined.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{node}{} \begin{funcdesc}{node}{}
Returns the computer's network name (may not be fully qualified!) Returns the computer's network name (may not be fully qualified!).
An empty string is returned if the value cannot be determined. An empty string is returned if the value cannot be determined.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{platform}{aliased=0, terse=0} \begin{funcdesc}{platform}{aliased=0, terse=0}
Returns a single string identifying the underlying platform Returns a single string identifying the underlying platform
with as much useful information as possible. with as much useful information as possible.
The output is intended to be \emph{human readable} rather than The output is intended to be \emph{human readable} rather than
machine parseable. It may look different on different machine parseable. It may look different on different platforms and
platforms and this is intended. this is intended.
If \code{aliased} is true, the function will use aliases for If \var{aliased} is true, the function will use aliases for various
various platforms that report system names which differ from platforms that report system names which differ from their common
their common names, e.g. SunOS will be reported as names, for example SunOS will be reported as Solaris. The
Solaris. The \function{system_alias()} function is used to implement \function{system_alias()} function is used to implement this.
this.
Setting terse to true causes the function to return only the
absolute minimum information needed to identify the platform.
\end{funcdesc}
Setting \var{terse} to true causes the function to return only the
absolute minimum information needed to identify the platform.
\end{funcdesc}
\begin{funcdesc}{processor}{} \begin{funcdesc}{processor}{}
Returns the (real) processor name, e.g. 'amdk6' Returns the (real) processor name, e.g. \code{'amdk6'}.
An empty string is returned if the value cannot be An empty string is returned if the value cannot be determined. Note
determined. Note that many platforms do not provide this that many platforms do not provide this information or simply return
information or simply return the same value as for \function{machine()}, the same value as for \function{machine()}. NetBSD does this.
e.g. NetBSD does this.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{python_build}{} \begin{funcdesc}{python_build}{}
Returns a tuple \code{(buildno, builddate)} stating the Python Returns a tuple \code{(\var{buildno}, \var{builddate})} stating the
build number and date as strings. Python build number and date as strings.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{python_compiler}{} \begin{funcdesc}{python_compiler}{}
Returns a string identifying the compiler used for compiling Returns a string identifying the compiler used for compiling Python.
Python.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{python_version}{} \begin{funcdesc}{python_version}{}
...@@ -94,43 +88,41 @@ ...@@ -94,43 +88,41 @@
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{python_version_tuple}{} \begin{funcdesc}{python_version_tuple}{}
Returns the Python version as tuple \code{(major, minor, patchlevel)} Returns the Python version as tuple \code{(\var{major}, \var{minor},
of strings. \var{patchlevel})} of strings.
Note that unlike the Python \code{sys.version}, the returned value Note that unlike the Python \code{sys.version}, the returned value
will always include the patchlevel (it defaults to 0). will always include the patchlevel (it defaults to \code{'0'}).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{release}{} \begin{funcdesc}{release}{}
Returns the system's release, e.g. \code{'2.2.0'} or \code{'NT'} Returns the system's release, e.g. \code{'2.2.0'} or \code{'NT'}
An empty string is returned if the value cannot be determined. An empty string is returned if the value cannot be determined.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{system}{} \begin{funcdesc}{system}{}
Returns the system/OS name, e.g. \code{'Linux'}, \code{'Windows'}, or \code{'Java'}. Returns the system/OS name, e.g. \code{'Linux'}, \code{'Windows'},
or \code{'Java'}.
An empty string is returned if the value cannot be determined. An empty string is returned if the value cannot be determined.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{system_alias}{system, release, version} \begin{funcdesc}{system_alias}{system, release, version}
Returns \code{(system, release, version)} aliased to common Returns \code{(\var{system}, \var{release}, \var{version})} aliased
marketing names used for some systems. to common marketing names used for some systems. It also does some
reordering of the information in some cases where it would otherwise
It also does some reordering of the information in some cases cause confusion.
where it would otherwise cause confusion.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{version}{} \begin{funcdesc}{version}{}
Returns the system's release version, e.g. \code{'#3 on degas'}. Returns the system's release version, e.g. \code{'\#3 on degas'}.
An empty string is returned if the value cannot be determined. An empty string is returned if the value cannot be determined.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{uname}{} \begin{funcdesc}{uname}{}
Fairly portable uname interface. Returns a tuple Fairly portable uname interface. Returns a tuple of strings
of strings \code{(system, node, release, version, machine, processor)} \code{(\var{system}, \var{node}, \var{release}, \var{version},
identifying the underlying platform. \var{machine}, \var{processor})} identifying the underlying
platform.
Note that unlike the \function{os.uname()} function this also returns Note that unlike the \function{os.uname()} function this also returns
possible processor information as additional tuple entry. possible processor information as additional tuple entry.
...@@ -138,86 +130,92 @@ ...@@ -138,86 +130,92 @@
Entries which cannot be determined are set to \code{''}. Entries which cannot be determined are set to \code{''}.
\end{funcdesc} \end{funcdesc}
\subsection{Java Platform} \subsection{Java Platform}
\begin{funcdesc}{java_ver}{release='', vendor='', vminfo=('','',''), osinfo=('','','')} \begin{funcdesc}{java_ver}{release='', vendor='', vminfo=('','',''),
Version interface for JPython. osinfo=('','','')}
Version interface for JPython.
Returns a tuple \code{(release, vendor, vminfo, osinfo)} with vminfo being
a tuple \code{(vm_name, vm_release, vm_vendor)} and osinfo being a Returns a tuple \code{(\var{release}, \var{vendor}, \var{vminfo},
tuple \code{(os_name, os_version, os_arch)}. \var{osinfo})} with \var{vminfo} being a tuple \code{(\var{vm_name},
\var{vm_release}, \var{vm_vendor})} and \var{osinfo} being a tuple
Values which cannot be determined are set to the defaults \code{(\var{os_name}, \var{os_version}, \var{os_arch})}.
given as parameters (which all default to \code{''}). Values which cannot be determined are set to the defaults
given as parameters (which all default to \code{''}).
\end{funcdesc} \end{funcdesc}
\subsection{Windows Platform} \subsection{Windows Platform}
\begin{funcdesc}{win32_ver}{release='', version='', csd='', ptype=''} \begin{funcdesc}{win32_ver}{release='', version='', csd='', ptype=''}
Get additional version information from the Windows Registry Get additional version information from the Windows Registry
and return a tuple \code{(version, csd, ptype)} referring to version and return a tuple \code{(\var{version}, \var{csd}, \var{ptype})}
number, CSD level and OS type (multi/single processor). referring to version number, CSD level and OS type (multi/single
processor).
As a hint: ptype returns \code{'Uniprocessor Free'} on single
processor NT machines and \code{'Multiprocessor Free'} on multi
processor machines. The \emph{'Free'} refers to the OS version being
free of debugging code. It could also state \emph{'Checked'} which
means the OS version uses debugging code, i.e. code that
checks arguments, ranges, etc.
\begin{notice}[note]
This function only works if Mark Hammond's \module{win32all}
package is installed and (obviously) only runs on Win32
compatible platforms.
\end{notice}
As a hint: \var{ptype} is \code{'Uniprocessor Free'} on single
processor NT machines and \code{'Multiprocessor Free'} on multi
processor machines. The \emph{'Free'} refers to the OS version being
free of debugging code. It could also state \emph{'Checked'} which
means the OS version uses debugging code, i.e. code that
checks arguments, ranges, etc.
\begin{notice}[note]
This function only works if Mark Hammond's \module{win32all}
package is installed and (obviously) only runs on Win32
compatible platforms.
\end{notice}
\end{funcdesc} \end{funcdesc}
\subsubsection{Win95/98 specific} \subsubsection{Win95/98 specific}
\begin{funcdesc}{popen}{cmd, mode='r', bufsize=None} \begin{funcdesc}{popen}{cmd, mode='r', bufsize=None}
Portable \function{popen()} interface. Portable \function{popen()} interface. Find a working popen
Find a working popen implementation preferring \function{win32pipe.popen}. implementation preferring \function{win32pipe.popen()}. On Windows
On NT \function{win32pipe} should work; on Win9x NT, \function{win32pipe.popen()} should work; on Windows 9x it hangs
it hangs due to bugs in the MS C lib. due to bugs in the MS C library.
\seetext{MS KnowledgeBase article Q150956.} % This KnowledgeBase article appears to be missing...
%See also \ulink{MS KnowledgeBase article Q150956}{}.
\end{funcdesc} \end{funcdesc}
\subsection{Mac Platform} \subsection{Mac OS Platform}
\begin{funcdesc}{mac_ver}{release='', versioninfo=('','',''), machine=''} \begin{funcdesc}{mac_ver}{release='', versioninfo=('','',''), machine=''}
Get MacOS version information and return it as tuple \code{(release, Get Mac OS version information and return it as tuple
versioninfo, machine)} with versioninfo being a tuple \code{(version, \code{(\var{release}, \var{versioninfo}, \var{machine})} with
dev_stage, non_release_version)}. \var{versioninfo} being a tuple \code{(\var{version},
\var{dev_stage}, \var{non_release_version})}.
Entries which cannot be determined are set to \code{''}. All tuple
entries are strings. Entries which cannot be determined are set to \code{''}. All tuple
entries are strings.
Documentation for the underlying gestalt() API is available online Documentation for the underlying \cfunction{gestalt()} API is
at \url{http://www.rgaros.nl/gestalt/} available online at \url{http://www.rgaros.nl/gestalt/}.
\end{funcdesc} \end{funcdesc}
\subsection{\UNIX{} Platforms} \subsection{\UNIX{} Platforms}
\begin{funcdesc}{dist}{distname='',version='',id='',supported_dists=('SuSE','debian','redhat','mandrake')} \begin{funcdesc}{dist}{distname='', version='', id='',
Tries to determine the name of the OS distribution name supported_dists=('SuSE','debian','redhat','mandrake')}
Tries to determine the name of the OS distribution name
Returns a tuple \code{(distname, version, id)} which defaults to the Returns a tuple \code{(\var{distname}, \var{version}, \var{id})}
args given as parameters. which defaults to the args given as parameters.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{libc_ver}{executable=sys.executable, lib='', version='', chunksize=2048} \begin{funcdesc}{libc_ver}{executable=sys.executable, lib='',
Tries to determine the libc version against which the version='', chunksize=2048}
file executable (defaults to the Python interpreter) is linked. Tries to determine the libc version against which the file
executable (defaults to the Python interpreter) is linked. Returns
Returns a tuple of strings \code{(lib, version)} which default to the a tuple of strings \code{(\var{lib}, \var{version})} which default
given parameters in case the lookup fails. to the given parameters in case the lookup fails.
Note that the function has intimate knowledge of how different Note that this function has intimate knowledge of how different
libc versions add symbols to the executable is probably only libc versions add symbols to the executable is probably only
useable for executables compiled using \emph{gcc}. useable for executables compiled using \program{gcc}.
The file is read and scanned in chunks of chunksize bytes. The file is read and scanned in chunks of \var{chunksize} bytes.
\end{funcdesc} \end{funcdesc}
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