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¶ Trueif pygments is available, elseFalse.
-
xonsh.platform.LINUX_DISTRO¶ The id of the Linux distribution running on, possibly ‘unknown’.
Ǹoneon non-Linux platforms.
-
xonsh.platform.ON_ANACONDA¶ Trueif executed in an Anaconda instance, elseFalse.
-
xonsh.platform.ON_DARWIN¶ Trueif executed on a Darwin platform, elseFalse.
-
xonsh.platform.ON_LINUX¶ Trueif executed on a Linux platform, elseFalse.
-
xonsh.platform.ON_POSIX¶ Trueif executed on a POSIX-compliant platform, elseFalse.
-
xonsh.platform.ON_WINDOWS¶ Trueif 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.