How to use the distro.lsb_release_info function in distro

To help you get started, we’ve selected a few distro examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nir0s / distro / tests / test_ld.py View on Github external
MODULE_DISTROI.info(best=False))
        self.assertEqual(distro.info(best=False),
            MODULE_DISTROI.info())
        self.assertEqual(distro.info(best=True),
            MODULE_DISTROI.info(best=True))
        self.assertEqual(distro.info(),
            MODULE_DISTROI.info(pretty=False))
        self.assertEqual(distro.info(pretty=False),
            MODULE_DISTROI.info())
        self.assertEqual(distro.info(pretty=True),
            MODULE_DISTROI.info(pretty=True))

        self.assertEqual(distro.os_release_info(),
            MODULE_DISTROI.os_release_info())

        self.assertEqual(distro.lsb_release_info(),
            MODULE_DISTROI.lsb_release_info())

        self.assertEqual(distro.distro_release_info(),
            MODULE_DISTROI.distro_release_info())

        os_release_keys = [
            'name',
            'version',
            'id',
            'id_like',
            'pretty_name',
            'version_id',
            'codename',
        ]
        for key in os_release_keys:
            self.assertEqual(distro.os_release_attr(key),
github nir0s / distro / query_local_distro.py View on Github external
from __future__ import print_function

from pprint import pformat

import distro


def pprint(obj):
    for line in pformat(obj).split('\n'):
        print(4 * ' ' + line)


print('os_release_info:')
pprint(distro.os_release_info())
print('lsb_release_info:')
pprint(distro.lsb_release_info())
print('distro_release_info:')
pprint(distro.distro_release_info())
print('id: {0}'.format(distro.id()))
print('name: {0}'.format(distro.name()))
print('name_pretty: {0}'.format(distro.name(True)))
print('version: {0}'.format(distro.version()))
print('version_pretty: {0}'.format(distro.version(True)))
print('like: {0}'.format(distro.like()))
print('codename: {0}'.format(distro.codename()))
print('linux_distribution_full: {0}'.format(distro.linux_distribution()))
print('linux_distribution: {0}'.format(distro.linux_distribution(False)))
print('major_version: {0}'.format(distro.major_version()))
print('minor_version: {0}'.format(distro.minor_version()))
print('build_number: {0}'.format(distro.build_number()))