mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-26 18:27:41 +00:00
This change modifies the reported version number for km-config: if km-config is installed from a debian package, the package version will be output as well, e.g.: `km-config version 14.0.252-beta (package version 14.0.252-1+bionic1)` Otherwise the output will be identical to before: `km-config version 14.0.252-beta-local`. This change also modifies the script that sets the version number so that builds on Jenkins are now detected in addition to TC. This fixes #4579.
35 lines
1.4 KiB
Python
Executable file
35 lines
1.4 KiB
Python
Executable file
#!/usr/bin/python3
|
|
|
|
import argparse
|
|
import logging
|
|
|
|
from keyman_config import __versionwithtag__, __pkgversion__
|
|
from keyman_config.handle_install import download_and_install_package
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __pkgversion__:
|
|
versionstring = "%s (package version %s)" % (__versionwithtag__, __pkgversion__)
|
|
else:
|
|
versionstring = "%s" % __versionwithtag__
|
|
parser = argparse.ArgumentParser(description='Keyman keyboards installation and information')
|
|
parser.add_argument('--version', action='version', version='%(prog)s version ' + versionstring)
|
|
parser.add_argument('-v', '--verbose', action='store_true', help='verbose logging')
|
|
parser.add_argument('-vv', '--veryverbose', action='store_true', help='very verbose logging')
|
|
parser.add_argument('-i', '--install', action='store', nargs='?', help='install .kmp package')
|
|
|
|
args = parser.parse_args()
|
|
if args.verbose:
|
|
logging.basicConfig(level=logging.INFO, format='%(levelname)s:%(message)s')
|
|
elif args.veryverbose:
|
|
logging.basicConfig(level=logging.DEBUG, format='%(levelname)s:%(message)s')
|
|
else:
|
|
logging.basicConfig(format='%(levelname)s:%(message)s')
|
|
|
|
if args.install:
|
|
download_and_install_package(args.install)
|
|
else:
|
|
from keyman_config.view_installed import ViewInstalledWindow
|
|
w = ViewInstalledWindow()
|
|
w.run()
|
|
w.destroy()
|