diff options
| author | Andrew <saintruler@gmail.com> | 2019-05-25 19:43:37 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2019-05-25 19:43:37 +0400 |
| commit | 3b7f288c424bc12caf431fe2ab336bff2de86af9 (patch) | |
| tree | 18db01edcca71666e3dd2d2b00a7804aa4c855a3 /day7/bootstrapper.py | |
| parent | 3f68d88666c832e0af50c5f4543ba3513c5fb0cb (diff) | |
Обновлен README.md
Diffstat (limited to 'day7/bootstrapper.py')
| -rw-r--r-- | day7/bootstrapper.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/day7/bootstrapper.py b/day7/bootstrapper.py deleted file mode 100644 index 60d5de8..0000000 --- a/day7/bootstrapper.py +++ /dev/null @@ -1,55 +0,0 @@ -import argparse -import shelve -from config import CONFIG_DB_PATH -from sys import argv - -parser = argparse.ArgumentParser() - -parser.add_argument( - '--chunk-size', type=int, default=1024, - help='Size of chunk that server uses when fetching data from connection' -) - -parser.add_argument( - '--bg-color', type=str, default='white', - help='Default background color of all webpages' -) - -parser.add_argument('--short-log', action='store_true') -parser.add_argument('--show-errors', action='store_true') - -parser.add_argument( - '--log', default='log.log', - help='File where log will be written' -) -parser.add_argument( - '--cookies-db', default='db/cookies.db', - help='Path to file where cookies will be stored' -) - -parser.add_argument( - '--host', default='0.0.0.0', - help='IP of interface where server will be started' -) -parser.add_argument( - '--port', type=int, default=8888, - help='Port on which server will be started' -) - - -args = parser.parse_known_args(argv[1:])[0] - -with (shelve.open(CONFIG_DB_PATH), shelve.open(args.cookies_db)) as (config, cookies): - config['chunk'] = args.chunk_size - config['short_log'] = args.short_log - config['log_path'] = args.log - config['show_errors'] = args.show_errors - config['cookies_db_path'] = args.cookies_db - config['host'] = args.host - config['port'] = args.port - - cookies['bg_color'] = args.bg_color - - -import http_handler -http_handler.main() |