File: api-3.py

package info (click to toggle)
python-distro 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 812 kB
  • sloc: python: 2,477; sh: 149; makefile: 66
file content (15 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python3

import distro

# Not the full API, but enough to flex the package.
print(distro.id())
print(distro.name())
print(distro.name(pretty=True))
print(distro.version())
print(distro.version(pretty=True))
print(distro.info())

# Use lsb_release for enhanced information.
assert len(distro.lsb_release_info()) > 0, (
    "Why isn't lsb_release(1) available?")