From 6ab73764eac0cb6261be2f9820950d299cd93185 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Mon, 15 Jan 2018 17:15:36 -0800 Subject: [PATCH] make run-benchmarks.py work (with no args) --- benchmarks/run-benchmarks.py | 10 ++++++---- warcprox/main.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/benchmarks/run-benchmarks.py b/benchmarks/run-benchmarks.py index 8267806..4491a8b 100755 --- a/benchmarks/run-benchmarks.py +++ b/benchmarks/run-benchmarks.py @@ -215,9 +215,9 @@ if __name__ == '__main__': args.cacert = os.path.join(tmpdir, 'benchmark-warcprox-ca.pem') args.certs_dir = os.path.join(tmpdir, 'benchmark-warcprox-ca') args.directory = os.path.join(tmpdir, 'warcs') - if args.rethinkdb_servers: - args.rethinkdb_db = 'benchmarks_{:%Y%m%d%H%M%S}' % ( - datetime.datetime.utcnow()) + # if args.rethinkdb_servers: + # args.rethinkdb_db = 'benchmarks_{:%Y%m%d%H%M%S}' % ( + # datetime.datetime.utcnow()) start_servers() logging.info( @@ -247,7 +247,9 @@ if __name__ == '__main__': logging.info('SKIPPED') logging.info('===== baseline benchmark finished =====') - warcprox_controller = warcprox.main.init_controller(args) + options = warcprox.Options(**vars(args)) + warcprox_controller = warcprox.controller.WarcproxController(options) + warcprox_controller_thread = threading.Thread( target=warcprox_controller.run_until_shutdown) warcprox_controller_thread.start() diff --git a/warcprox/main.py b/warcprox/main.py index 3c93504..a55e682 100644 --- a/warcprox/main.py +++ b/warcprox/main.py @@ -61,7 +61,7 @@ class BetterArgumentDefaultsHelpFormatter( else: return argparse.ArgumentDefaultsHelpFormatter._get_help_string(self, action) -def _build_arg_parser(prog): +def _build_arg_parser(prog='warcprox'): arg_parser = argparse.ArgumentParser(prog=prog, description='warcprox - WARC writing MITM HTTP/S proxy', formatter_class=BetterArgumentDefaultsHelpFormatter)