Undocumented
Class |
|
Thread handler making it easier for parent to handle thread exceptions. |
Function | cd |
Undocumented |
Function | enable |
Undocumented |
Function | has |
Cleanly determine whether ``stream`` has a useful ``.fileno()``. |
Function | helpline |
Yield an object's first docstring line, or None if there was no docstring. |
Function | isatty |
Cleanly determine whether ``stream`` is a TTY. |
Function | task |
Return key tuple for use sorting dotted task names, via e.g. `sorted`. |
Constant | LOG |
Undocumented |
Variable |
|
Undocumented |
Variable | log |
Undocumented |
Cleanly determine whether ``stream`` has a useful ``.fileno()``. .. note:: This function helps determine if a given file-like object can be used with various terminal-oriented modules and functions such as `select`, `termios`, and `tty`. For most of those, a fileno is all that is required; they'll function even if ``stream.isatty()`` is ``False``. :param stream: A file-like object. :returns: ``True`` if ``stream.fileno()`` returns an integer, ``False`` otherwise (this includes when ``stream`` lacks a ``fileno`` method). .. versionadded:: 1.0
Cleanly determine whether ``stream`` is a TTY. Specifically, first try calling ``stream.isatty()``, and if that fails (e.g. due to lacking the method entirely) fallback to `os.isatty`. .. note:: Most of the time, we don't actually care about true TTY-ness, but merely whether the stream seems to have a fileno (per `has_fileno`). However, in some cases (notably the use of `pty.fork` to present a local pseudoterminal) we need to tell if a given stream has a valid fileno but *isn't* tied to an actual terminal. Thus, this function. :param stream: A file-like object. :returns: A boolean depending on the result of calling ``.isatty()`` and/or `os.isatty`. .. versionadded:: 1.0