hat.event.backends.lmdb.manager.main
1import argparse 2import sys 3 4from hat.event.backends.lmdb.manager import copy 5from hat.event.backends.lmdb.manager import query 6 7 8def create_argument_parser() -> argparse.ArgumentParser: 9 parser = argparse.ArgumentParser() 10 subparsers = parser.add_subparsers(dest='action', required=True) 11 12 query.create_argument_parser(subparsers) 13 copy.create_argument_parser(subparsers) 14 15 return parser 16 17 18def main(): 19 parser = create_argument_parser() 20 args = parser.parse_args() 21 22 if args.action == 'query': 23 query.query(args) 24 25 elif args.action == 'copy': 26 copy.copy(args) 27 28 else: 29 raise ValueError('unsupported action') 30 31 32if __name__ == '__main__': 33 sys.argv[0] = 'hat-event-lmdb-manager' 34 sys.exit(main())
def
create_argument_parser() -> argparse.ArgumentParser:
def
main():