aboutsummaryrefslogtreecommitdiff
path: root/roka.py
diff options
context:
space:
mode:
authorDylan Garrett <dylan.garrett@gmail.com>2021-06-13 14:20:15 -0700
committerDylan Garrett <dylan.garrett@gmail.com>2021-06-13 14:20:15 -0700
commit9ee86c545e14ade1fd14b7068bdda6cf5a7c47a9 (patch)
tree3fa8c8f8a76ee7fc4f0b7d324b49cd6eef9d9ebe /roka.py
parent23eb4d3a39c7f02506a9b735257bb5eaa6c3bb0e (diff)
downloadroka-9ee86c545e14ade1fd14b7068bdda6cf5a7c47a9.tar.gz
roka-9ee86c545e14ade1fd14b7068bdda6cf5a7c47a9.zip
Move base_url to config. Add README info about config override
Diffstat (limited to 'roka.py')
-rwxr-xr-xroka.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/roka.py b/roka.py
index 9ac88d1..b7fc849 100755
--- a/roka.py
+++ b/roka.py
@@ -97,17 +97,11 @@ if __name__ == '__main__':
parser.add_argument('--generate', dest='static_path', type=str, action='store',
help='Output directory to generate static files',
required=False)
- parser.add_argument('--base_url', dest='base_url', type=str, action='store',
- help='Base URL to use in static files',
- required=False)
parser.add_argument('--config', dest='config', type=str, action='store',
help='Json configuration instead of app.cfg',
required=False)
args = parser.parse_args()
- if args.static_path and not args.base_url or args.base_url and not args.static_path:
- parser.error('--generate and --base_url must be included together')
-
if args.config:
class objectview(object):
def __init__(self, d):
@@ -124,6 +118,6 @@ if __name__ == '__main__':
books.scan_books(root_path)
books.write_cache()
elif args.static_path:
- generate(args.static_path, args.base_url, root_path)
+ generate(args.static_path, app.config['BASE_URL'], root_path)
else:
app.run(host='127.0.0.1', port='8085', threaded=True)