LinuxDistribution

Provides information about a OS distribution. This package creates a private module-global instance of this class with default initialization arguments, that is used by the consolidated accessor functions_ and single source accessor functions_. By using default initialization arguments, that module-global instance returns data about the current OS distribution (i.e. the distro this package runs on). Normally, it is not necessary to create additional instances of this class. However, in situations where control is needed over the exact data sources that are used, instances of this class can be created with a specific distro release file, or a specific os-release file, or without invoking the lsb_release command.

Members

Functions

_distro_release_info_impl
dstring[dstring] _distro_release_info_impl()

Get the information items from the specified distro release file.

_lsb_release_info_impl
dstring[dstring] _lsb_release_info_impl()

Get the information items from the lsb_release command output.

_os_release_info_impl
dstring[dstring] _os_release_info_impl()

Get the information items from the specified os-release file.

_parse_distro_release_file
dstring[dstring] _parse_distro_release_file(string filepath)

Parse a distro release file.

build_number
dstring build_number(bool best = false)

Return the build number of the current distribution. For details, see :func:distro.build_number.

codename
dstring codename()

Return the codename of the OS distribution. For details, see :func:distro.codename.

distro_release_attr
dstring distro_release_attr(dstring attribute)

Return a single named information item from the distro release file data source of the OS distribution. For details, see :func:distro.distro_release_attr.

distro_release_info
dstring[dstring] distro_release_info()

Return a dictionary containing key-value pairs for the information items from the distro release file data source of the OS distribution. For details, see :func:distro.distro_release_info.

id
dstring id()

Return the distro ID of the OS distribution, as a string. For details, see :func:distro.id.

info
VersionInfo info(bool pretty = false, bool best = false)

Return certain machine-readable information about the OS distribution. For details, see :func:distro.info.

like
dstring like()

Return the IDs of distributions that are like the OS distribution. For details, see :func:distro.like.

linux_distribution
auto linux_distribution(bool full_distribution_name = true)

Return information about the OS distribution that is compatible with Python's :func:platform.linux_distribution, supporting a subset of its parameters. For details, see :func:distro.linux_distribution.

lsb_release_attr
dstring lsb_release_attr(dstring attribute)

Return a single named information item from the lsb_release command output data source of the OS distribution. For details, see :func:distro.lsb_release_attr.

lsb_release_info
dstring[dstring] lsb_release_info()

Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the OS distribution. For details, see :func:distro.lsb_release_info.

major_version
dstring major_version(bool best = false)

Return the major version number of the current distribution. For details, see :func:distro.major_version.

minor_version
dstring minor_version(bool best = false)

Return the minor version number of the current distribution. For details, see :func:distro.minor_version.

name
dstring name(bool pretty = false)

Return the name of the OS distribution, as a string. For details, see :func:distro.name.

os_release_attr
dstring os_release_attr(dstring attribute)

Return a single named information item from the os-release file data source of the OS distribution. For details, see :func:distro.os_release_attr.

os_release_info
dstring[dstring] os_release_info()

Return a dictionary containing key-value pairs for the information items from the os-release file data source of the OS distribution. For details, see :func:distro.os_release_info.

toString
dstring toString()

Return repr of all info

uname_attr
dstring uname_attr(dstring attribute)

Return a single named information item from the uname command output data source of the OS distribution. For details, see :func:distro.uname_release_attr.

uname_info
auto uname_info()

Return a dictionary containing key-value pairs for the information items from the uname command data source of the OS distribution. For details, see :func:distro.uname_info.

version_
dstring version_(bool pretty = false, bool best = false)

Return the version of the OS distribution, as a string. For details, see :func:distro.version.

version_parts
auto version_parts(bool best = false)

Return the version of the OS distribution, as a tuple of version numbers. For details, see :func:distro.version_parts.

Static functions

_parse_distro_release_content
dstring[dstring] _parse_distro_release_content(const dstring line)

Parse a line from a distro release file.

_parse_lsb_release_content
dstring[dstring] _parse_lsb_release_content(const dstring[] lines)

Parse the output of the lsb_release command.

_parse_os_release_content
dstring[dstring] _parse_os_release_content(const dstring[] lines)

Parse the lines of an os-release file.

create
LinuxDistribution create(bool include_lsb = true, string os_release_file = "", string distro_release_file = "", bool include_uname = true)

The initialization method of this class gathers information from the available data sources, and stores that in private instance attributes. Subsequent access to the information items uses these private instance attributes, so that the data sources are read only once.

Meta