From de97d64363d18103b9a460be36b57f369de804de Mon Sep 17 00:00:00 2001 From: Goutte Date: Thu, 30 Nov 2017 10:03:53 +0100 Subject: [PATCH] Fix more bugs. --- CHANGELOG.md | 1 + web/run.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a07e04b..beaf80c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - [ ] Rework the images of Rosetta and Juno - [ ] Enable p67 +- [x] Re-lock Earth until we have better support - [x] Add support for inputs STEREO-A, STEREO-B, L1 - [x] More ticks along X-axis (I tried, but it does not behave as expected) - [x] Smaller footer credits diff --git a/web/run.py b/web/run.py index d43afda..4ec3930 100755 --- a/web/run.py +++ b/web/run.py @@ -419,10 +419,8 @@ def retrieve_amda_netcdf(orbiter, what, started_at, stopped_at): return list(set(local_netc_files)) # remove possible dupes -def get_data_for_target( - target_config, - started_at, stopped_at, - input_slug='l1'): +def get_data_for_target(target_config, input_slug, + started_at, stopped_at): """ :return: dict whose keys are datetime as str, values tuples of data """ @@ -599,7 +597,8 @@ def generate_csv_contents(target_slug, input_slug, started_at, stopped_at): return si.getvalue() -def generate_csv_file_if_needed(target_slug, input_slug, started_at, stopped_at): +def generate_csv_file_if_needed(target_slug, input_slug, + started_at, stopped_at): filename = "%s_%s_%s_%s.csv" % (target_slug, input_slug, started_at.strftime(FILE_DATE_FMT), stopped_at.strftime(FILE_DATE_FMT)) @@ -620,9 +619,10 @@ def generate_csv_file_if_needed(target_slug, input_slug, started_at, stopped_at) log.info("Generating CSV '%s'..." % local_csv_file) try: with open(local_csv_file, mode="w+") as f: - f.write(generate_csv_contents(target_slug, - started_at=started_at, - stopped_at=stopped_at)) + f.write(generate_csv_contents( + target_slug=target_slug, input_slug=input_slug, + started_at=started_at, stopped_at=stopped_at + )) log.info("Generation of '%s' done." % filename) except Exception as e: from sys import exc_info @@ -694,7 +694,7 @@ def get_input_slug_from_query(inp=None): input_slug = request.args.get('input_slug', 'l1') else: input_slug = inp - if input_slug not in [i.slug for i in config.inputs]: + if input_slug not in [i['slug'] for i in config['inputs']]: input_slug = 'l1' # be tolerant instead of yelling loudly return input_slug -- libgit2 0.21.2