[Python-checkins] cpython: Restore mostly-alphabetic sorting of os functions.

georg.brandl python-checkins at python.org
Sun Jun 24 12:51:53 CEST 2012


http://hg.python.org/cpython/rev/e03d7651959f
changeset:   77693:e03d7651959f
user:        Georg Brandl <georg at python.org>
date:        Sun Jun 24 12:50:06 2012 +0200
summary:
  Restore mostly-alphabetic sorting of os functions.

files:
  Doc/library/os.rst |  343 ++++++++++++++++----------------
  1 files changed, 168 insertions(+), 175 deletions(-)


diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -96,6 +96,13 @@
 process and user.
 
 
+.. function:: ctermid()
+
+   Return the filename corresponding to the controlling terminal of the process.
+
+   Availability: Unix.
+
+
 .. data:: environ
 
    A mapping object representing the string environment. For example,
@@ -177,6 +184,28 @@
    .. versionadded:: 3.2
 
 
+.. function:: getenv(key, default=None)
+
+   Return the value of the environment variable *key* if it exists, or
+   *default* if it doesn't. *key*, *default* and the result are str.
+
+   On Unix, keys and values are decoded with :func:`sys.getfilesystemencoding`
+   and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you
+   would like to use a different encoding.
+
+   Availability: most flavors of Unix, Windows.
+
+
+.. function:: getenvb(key, default=None)
+
+   Return the value of the environment variable *key* if it exists, or
+   *default* if it doesn't. *key*, *default* and the result are bytes.
+
+   Availability: most flavors of Unix.
+
+   .. versionadded:: 3.2
+
+
 .. function:: get_exec_path(env=None)
 
    Returns the list of directories that will be searched for a named
@@ -188,13 +217,6 @@
    .. versionadded:: 3.2
 
 
-.. function:: ctermid()
-
-   Return the filename corresponding to the controlling terminal of the process.
-
-   Availability: Unix.
-
-
 .. function:: getegid()
 
    Return the effective group id of the current process.  This corresponds to the
@@ -253,17 +275,6 @@
       obtained with :func:`sysconfig.get_config_var`.
 
 
-.. function:: initgroups(username, gid)
-
-   Call the system initgroups() to initialize the group access list with all of
-   the groups of which the specified username is a member, plus the specified
-   group id.
-
-   Availability: Unix.
-
-   .. versionadded:: 3.2
-
-
 .. function:: getlogin()
 
    Return the name of the user logged in on the controlling terminal of the
@@ -317,78 +328,70 @@
 
    .. index:: single: process; scheduling priority
 
-   Get program scheduling priority. The value *which* is one of
+   Get program scheduling priority.  The value *which* is one of
    :const:`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who*
    is interpreted relative to *which* (a process identifier for
    :const:`PRIO_PROCESS`, process group identifier for :const:`PRIO_PGRP`, and a
-   user ID for :const:`PRIO_USER`). A zero value for *who* denotes
+   user ID for :const:`PRIO_USER`).  A zero value for *who* denotes
    (respectively) the calling process, the process group of the calling process,
    or the real user ID of the calling process.
 
-   Availability: Unix
+   Availability: Unix.
 
    .. versionadded:: 3.3
 
-.. function:: getresuid()
-
-   Return a tuple (ruid, euid, suid) denoting the current process's
-   real, effective, and saved user ids.
-
-   Availability: Unix.
-
-   .. versionadded:: 3.2
-
-
-.. function:: getresgid()
-
-   Return a tuple (rgid, egid, sgid) denoting the current process's
-   real, effective, and saved group ids.
-
-   Availability: Unix.
-
-   .. versionadded:: 3.2
-
-
-.. function:: getuid()
-
-   .. index:: single: user; id
-
-   Return the current process's user id.
-
-   Availability: Unix.
-
-
-.. function:: getenv(key, default=None)
-
-   Return the value of the environment variable *key* if it exists, or
-   *default* if it doesn't. *key*, *default* and the result are str.
-
-   On Unix, keys and values are decoded with :func:`sys.getfilesystemencoding`
-   and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you
-   would like to use a different encoding.
-
-   Availability: most flavors of Unix, Windows.
-
-
-.. function:: getenvb(key, default=None)
-
-   Return the value of the environment variable *key* if it exists, or
-   *default* if it doesn't. *key*, *default* and the result are bytes.
-
-   Availability: most flavors of Unix.
-
-   .. versionadded:: 3.2
 
 .. data:: PRIO_PROCESS
           PRIO_PGRP
           PRIO_USER
 
-   Parameters for :func:`getpriority` and :func:`setpriority` functions.
+   Parameters for the :func:`getpriority` and :func:`setpriority` functions.
 
    Availability: Unix.
 
    .. versionadded:: 3.3
 
+
+.. function:: getresuid()
+
+   Return a tuple (ruid, euid, suid) denoting the current process's
+   real, effective, and saved user ids.
+
+   Availability: Unix.
+
+   .. versionadded:: 3.2
+
+
+.. function:: getresgid()
+
+   Return a tuple (rgid, egid, sgid) denoting the current process's
+   real, effective, and saved group ids.
+
+   Availability: Unix.
+
+   .. versionadded:: 3.2
+
+
+.. function:: getuid()
+
+   .. index:: single: user; id
+
+   Return the current process's user id.
+
+   Availability: Unix.
+
+
+.. function:: initgroups(username, gid)
+
+   Call the system initgroups() to initialize the group access list with all of
+   the groups of which the specified username is a member, plus the specified
+   group id.
+
+   Availability: Unix.
+
+   .. versionadded:: 3.2
+
+
 .. function:: putenv(key, value)
 
    .. index:: single: environment variables; setting
@@ -1269,27 +1272,13 @@
 
 
 .. data:: F_OK
-
-   Value to pass as the *mode* parameter of :func:`access` to test the existence of
-   *path*.
-
-
-.. data:: R_OK
-
-   Value to include in the *mode* parameter of :func:`access` to test the
-   readability of *path*.
-
-
-.. data:: W_OK
-
-   Value to include in the *mode* parameter of :func:`access` to test the
-   writability of *path*.
-
-
-.. data:: X_OK
-
-   Value to include in the *mode* parameter of :func:`access` to determine if
-   *path* can be executed.
+          R_OK
+          W_OK
+          X_OK
+
+   Values to pass as the *mode* parameter of :func:`access` to test the
+   existence, readability, writability and executability of *path*,
+   respectively.
 
 
 .. function:: chdir(path)
@@ -1308,29 +1297,6 @@
       on some platforms.
 
 
-.. function:: fchdir(fd)
-
-   Change the current working directory to the directory represented by the file
-   descriptor *fd*.  The descriptor must refer to an opened directory, not an
-   open file.  From Python 3.3, this is equivalent to ``os.chdir(fd)``.
-
-   Availability: Unix.
-
-
-.. function:: getcwd()
-
-   Return a string representing the current working directory.
-
-   Availability: Unix, Windows.
-
-
-.. function:: getcwdb()
-
-   Return a bytestring representing the current working directory.
-
-   Availability: Unix, Windows.
-
-
 .. function:: chflags(path, flags, *, follow_symlinks=True)
 
    Set the flags of *path* to the numeric *flags*. *flags* may take a combination
@@ -1357,12 +1323,6 @@
       The *follow_symlinks* argument.
 
 
-.. function:: chroot(path)
-
-   Change the root directory of the current process to *path*. Availability:
-   Unix.
-
-
 .. function:: chmod(path, mode, *, dir_fd=None, follow_symlinks=True)
 
    Change the mode of *path* to the numeric *mode*. *mode* may take one of the
@@ -1425,6 +1385,35 @@
       and the *dir_fd* and *follow_symlinks* arguments.
 
 
+.. function:: chroot(path)
+
+   Change the root directory of the current process to *path*. Availability:
+   Unix.
+
+
+.. function:: fchdir(fd)
+
+   Change the current working directory to the directory represented by the file
+   descriptor *fd*.  The descriptor must refer to an opened directory, not an
+   open file.  From Python 3.3, this is equivalent to ``os.chdir(fd)``.
+
+   Availability: Unix.
+
+
+.. function:: getcwd()
+
+   Return a string representing the current working directory.
+
+   Availability: Unix, Windows.
+
+
+.. function:: getcwdb()
+
+   Return a bytestring representing the current working directory.
+
+   Availability: Unix, Windows.
+
+
 .. function:: lchflags(path, flags)
 
    Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do
@@ -1518,60 +1507,6 @@
       Added the *dir_fd* parameter.
 
 
-.. function:: mkfifo(path, mode=0o666, *, dir_fd=None)
-
-   Create a FIFO (a named pipe) named *path* with numeric mode *mode*.
-   The current umask value is first masked out from the mode.
-
-   This function can also support :ref:`paths relative to directory descriptors
-   <dir_fd>`.
-
-   FIFOs are pipes that can be accessed like regular files.  FIFOs exist until they
-   are deleted (for example with :func:`os.unlink`). Generally, FIFOs are used as
-   rendezvous between "client" and "server" type processes: the server opens the
-   FIFO for reading, and the client opens it for writing.  Note that :func:`mkfifo`
-   doesn't open the FIFO --- it just creates the rendezvous point.
-
-   Availability: Unix.
-
-   .. versionadded:: 3.3
-      The *dir_fd* argument.
-
-
-.. function:: mknod(filename, mode=0o600, device=0, *, dir_fd=None)
-
-   Create a filesystem node (file, device special file or named pipe) named
-   *filename*. *mode* specifies both the permissions to use and the type of node
-   to be created, being combined (bitwise OR) with one of ``stat.S_IFREG``,
-   ``stat.S_IFCHR``, ``stat.S_IFBLK``, and ``stat.S_IFIFO`` (those constants are
-   available in :mod:`stat`).  For ``stat.S_IFCHR`` and ``stat.S_IFBLK``,
-   *device* defines the newly created device special file (probably using
-   :func:`os.makedev`), otherwise it is ignored.
-
-   This function can also support :ref:`paths relative to directory descriptors
-   <dir_fd>`.
-
-   .. versionadded:: 3.3
-      The *dir_fd* argument.
-
-
-.. function:: major(device)
-
-   Extract the device major number from a raw device number (usually the
-   :attr:`st_dev` or :attr:`st_rdev` field from :c:type:`stat`).
-
-
-.. function:: minor(device)
-
-   Extract the device minor number from a raw device number (usually the
-   :attr:`st_dev` or :attr:`st_rdev` field from :c:type:`stat`).
-
-
-.. function:: makedev(major, minor)
-
-   Compose a raw device number from the major and minor device numbers.
-
-
 .. function:: mkdir(path, mode=0o777, *, dir_fd=None)
 
    Create a directory named *path* with numeric mode *mode*.
@@ -1618,6 +1553,60 @@
       The *exist_ok* parameter.
 
 
+.. function:: mkfifo(path, mode=0o666, *, dir_fd=None)
+
+   Create a FIFO (a named pipe) named *path* with numeric mode *mode*.
+   The current umask value is first masked out from the mode.
+
+   This function can also support :ref:`paths relative to directory descriptors
+   <dir_fd>`.
+
+   FIFOs are pipes that can be accessed like regular files.  FIFOs exist until they
+   are deleted (for example with :func:`os.unlink`). Generally, FIFOs are used as
+   rendezvous between "client" and "server" type processes: the server opens the
+   FIFO for reading, and the client opens it for writing.  Note that :func:`mkfifo`
+   doesn't open the FIFO --- it just creates the rendezvous point.
+
+   Availability: Unix.
+
+   .. versionadded:: 3.3
+      The *dir_fd* argument.
+
+
+.. function:: mknod(filename, mode=0o600, device=0, *, dir_fd=None)
+
+   Create a filesystem node (file, device special file or named pipe) named
+   *filename*. *mode* specifies both the permissions to use and the type of node
+   to be created, being combined (bitwise OR) with one of ``stat.S_IFREG``,
+   ``stat.S_IFCHR``, ``stat.S_IFBLK``, and ``stat.S_IFIFO`` (those constants are
+   available in :mod:`stat`).  For ``stat.S_IFCHR`` and ``stat.S_IFBLK``,
+   *device* defines the newly created device special file (probably using
+   :func:`os.makedev`), otherwise it is ignored.
+
+   This function can also support :ref:`paths relative to directory descriptors
+   <dir_fd>`.
+
+   .. versionadded:: 3.3
+      The *dir_fd* argument.
+
+
+.. function:: major(device)
+
+   Extract the device major number from a raw device number (usually the
+   :attr:`st_dev` or :attr:`st_rdev` field from :c:type:`stat`).
+
+
+.. function:: minor(device)
+
+   Extract the device minor number from a raw device number (usually the
+   :attr:`st_dev` or :attr:`st_rdev` field from :c:type:`stat`).
+
+
+.. function:: makedev(major, minor)
+
+   Compose a raw device number from the major and minor device numbers.
+
+
 .. function:: pathconf(path, name)
 
    Return system configuration information relevant to a named file. *name*
@@ -1956,6 +1945,7 @@
 
    .. versionadded:: 3.3
 
+
 .. data:: supports_effective_ids
 
    An object implementing collections.Set indicating which functions in the
@@ -1973,6 +1963,7 @@
 
    .. versionadded:: 3.3
 
+
 .. data:: supports_fd
 
    An object implementing collections.Set indicating which functions in the
@@ -1993,6 +1984,7 @@
 
    .. versionadded:: 3.3
 
+
 .. data:: supports_follow_symlinks
 
    An object implementing collections.Set indicating which functions in the
@@ -2011,6 +2003,7 @@
 
    .. versionadded:: 3.3
 
+
 .. function:: symlink(source, link_name, target_is_directory=False, *, dir_fd=None)
 
    Create a symbolic link pointing to *source* named *link_name*.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list