Migrate scripts to operatornotify.main_decorator.
This commit is contained in:
parent
5ce6cf8425
commit
d5a7fdb467
2 changed files with 4 additions and 8 deletions
|
@ -116,10 +116,9 @@ def fpk_argparse(args):
|
||||||
|
|
||||||
return return_status
|
return return_status
|
||||||
|
|
||||||
|
@operatornotify.main_decorator(subject='fdroidapk.py')
|
||||||
@vlogging.main_decorator
|
@vlogging.main_decorator
|
||||||
def main(argv):
|
def main(argv):
|
||||||
(notify_context, argv) = operatornotify.main_log_context(argv, subject='fdroidapk warnings')
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description=__doc__)
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
|
||||||
parser.add_argument('packages', nargs='+')
|
parser.add_argument('packages', nargs='+')
|
||||||
|
@ -127,8 +126,7 @@ def main(argv):
|
||||||
parser.add_argument('--destination', default='.')
|
parser.add_argument('--destination', default='.')
|
||||||
parser.set_defaults(func=fpk_argparse)
|
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__':
|
if __name__ == '__main__':
|
||||||
raise SystemExit(main(sys.argv[1:]))
|
raise SystemExit(main(sys.argv[1:]))
|
||||||
|
|
|
@ -527,10 +527,9 @@ def rarpar_argparse(args):
|
||||||
|
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
@operatornotify.main_decorator(subject='rarpar.py')
|
||||||
@vlogging.main_decorator
|
@vlogging.main_decorator
|
||||||
def main(argv):
|
def main(argv):
|
||||||
(notify_context, argv) = operatornotify.main_log_context(argv, subject='rarpar warnings')
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description=__doc__)
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
|
||||||
parser.add_argument('path')
|
parser.add_argument('path')
|
||||||
|
@ -550,8 +549,7 @@ def main(argv):
|
||||||
parser.add_argument('--dry', action='store_true')
|
parser.add_argument('--dry', action='store_true')
|
||||||
parser.set_defaults(func=rarpar_argparse)
|
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__':
|
if __name__ == '__main__':
|
||||||
raise SystemExit(main(sys.argv[1:]))
|
raise SystemExit(main(sys.argv[1:]))
|
||||||
|
|
Loading…
Reference in a new issue