From a39d9cc9e3738b19565db92cc1e8d01191a55808 Mon Sep 17 00:00:00 2001 From: Tim Buckley Date: Mon, 3 Aug 2015 15:45:36 -0600 Subject: [PATCH] Add arguments to configure test repository and dstat logfile locations. --- export_static.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/export_static.py b/export_static.py index 50587e7..433a940 100644 --- a/export_static.py +++ b/export_static.py @@ -53,6 +53,12 @@ def init_django(args): settings.STATIC_URL = settings.STATIC_URL[1:] settings.USE_GZIP = args.gzip + if args.repository: + settings.TEST_REPOSITORIES = (args.repository,) + + if args.dstat: + settings.DSTAT_CSV = args.dstat + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stackviz.settings") django.setup() @@ -64,10 +70,19 @@ def main(): help="The output directory. Will be created if it " "doesn't already exist.") parser.add_argument("--ignore-bower", - help="Ignore missing Bower components.") + help="Ignore missing Bower components.", + action="store_true") parser.add_argument("--gzip", help="Enable gzip compression for data files.", action="store_true") + parser.add_argument("--repository", + help="The directory containing the `.testrepository` " + "to export. If not provided, the `settings.py` " + "configured value will be used.") + parser.add_argument("--dstat", + help="The path to the DStat log file (CSV-formatted) " + "to include. If not provided, the `settings.py` " + "configured value will be used.") args = parser.parse_args()