Migrate scripts to operatornotify.main_decorator.

This commit is contained in:
voussoir 2021-06-21 22:20:39 -07:00
parent 5ce6cf8425
commit d5a7fdb467
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
2 changed files with 4 additions and 8 deletions

View file

@ -116,10 +116,9 @@ def fpk_argparse(args):
return return_status
@operatornotify.main_decorator(subject='fdroidapk.py')
@vlogging.main_decorator
def main(argv):
(notify_context, argv) = operatornotify.main_log_context(argv, subject='fdroidapk warnings')
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('packages', nargs='+')
@ -127,8 +126,7 @@ def main(argv):
parser.add_argument('--destination', default='.')
parser.set_defaults(func=fpk_argparse)
with notify_context:
return betterhelp.single_main(argv, parser, __doc__)
return betterhelp.single_main(argv, parser, __doc__)
if __name__ == '__main__':
raise SystemExit(main(sys.argv[1:]))

View file

@ -527,10 +527,9 @@ def rarpar_argparse(args):
return status
@operatornotify.main_decorator(subject='rarpar.py')
@vlogging.main_decorator
def main(argv):
(notify_context, argv) = operatornotify.main_log_context(argv, subject='rarpar warnings')
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('path')
@ -550,8 +549,7 @@ def main(argv):
parser.add_argument('--dry', action='store_true')
parser.set_defaults(func=rarpar_argparse)
with notify_context:
return betterhelp.single_main(argv, parser, DOCSTRING)
return betterhelp.single_main(argv, parser, DOCSTRING)
if __name__ == '__main__':
raise SystemExit(main(sys.argv[1:]))