File: display-version.py

package info (click to toggle)
python-blessed 1.25-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,812 kB
  • sloc: python: 14,645; makefile: 13; sh: 7
file content (17 lines) | stat: -rwxr-xr-x 426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python

from blessed import Terminal

term = Terminal()

print('Checking software version (XTVERSION) ...', end='', flush=True)

sv = term.get_software_version()

if sv is None:
    print('No response.')
    print(term.bright_red('This terminal does NOT support XTVERSION.'))
else:
    print()
    maybe_version = f', version {sv.version}' if sv.version else ''
    print(f'Terminal: {sv.name}{maybe_version}')