mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-07 01:15:33 +00:00
We can't initialize Sentry during module initialization because our `initialize_sentry` logs some status info. Setting the logging level later on is then a no-op, breaking verbose and very-verbose logging. This change fixes this by putting Sentry initialization into a separate method that gets called after we set the log level. Also refactor some common code into methods that appear in all our executables.
23 lines
649 B
Python
Executable file
23 lines
649 B
Python
Executable file
#!/usr/bin/python3
|
|
|
|
import argparse
|
|
|
|
from keyman_config import add_standard_arguments, initialize_logging, initialize_sentry
|
|
from keyman_config.uninstall_kmp import uninstall_kmp
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description='Uninstall a Keyman keyboard package.')
|
|
parser.add_argument('id', help='Keyman keyboard id')
|
|
parser.add_argument('-s', '--shared', action='store_true', help='Uninstall from shared area /usr/local')
|
|
add_standard_arguments(parser)
|
|
|
|
args = parser.parse_args()
|
|
|
|
initialize_logging(args)
|
|
initialize_sentry()
|
|
|
|
uninstall_kmp(args.id, args.shared)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|