Platform-specific constants and implementations (xonsh.platform
)¶
Functions¶
Module for platform-specific constants and implementations, as well as compatibility layers to make use of the ‘best’ implementation available on a platform.
-
xonsh.platform.
scandir
()¶ This is either os.scandir on Python 3.5+ or a function providing a compatibility layer for it. It is recommended for iterations over directory entries at a significantly higher speed than os.listdir on Python 3.5+. It also caches properties that are commonly used for filtering.
Parameters: path (str) – The path to scan for entries. Returns: A generator yielding DirEntry instances.
Constants¶
-
xonsh.platform.
BASH_COMPLETIONS_DEFAULT
¶ A possibly empty tuple with default paths to Bash completions known for the current platform.
-
xonsh.platform.
DEFAULT_ENCODING
¶ Default string encoding.
-
xonsh.platform.
HAS_PYGMENTS
¶ True
if pygments is available, elseFalse
.
-
xonsh.platform.
LINUX_DISTRO
¶ The id of the Linux distribution running on, possibly ‘unknown’.
Ǹone
on non-Linux platforms.
-
xonsh.platform.
ON_ANACONDA
¶ True
if executed in an Anaconda instance, elseFalse
.
-
xonsh.platform.
ON_DARWIN
¶ True
if executed on a Darwin platform, elseFalse
.
-
xonsh.platform.
ON_LINUX
¶ True
if executed on a Linux platform, elseFalse
.
-
xonsh.platform.
ON_POSIX
¶ True
if executed on a POSIX-compliant platform, elseFalse
.
-
xonsh.platform.
ON_WINDOWS
¶ True
if executed on a native Windows platform, elseFalse
.
-
xonsh.platform.
PLATFORM_INFO
¶ The constants of this module as dictionary.
-
xonsh.platform.
PYGMENTS_VERSION
¶ pygments.__version__ version if available, else
Ǹone
.
-
xonsh.platform.
PYTHON_VERSION_INFO
¶ Version of Python interpreter as three-value tuple.