Commit de97d64363d18103b9a460be36b57f369de804de
1 parent
06eda8f7
Exists in
master
and in
2 other branches
Fix more bugs.
Showing
2 changed files
with
10 additions
and
9 deletions
Show diff stats
CHANGELOG.md
... | ... | @@ -31,6 +31,7 @@ |
31 | 31 | |
32 | 32 | - [ ] Rework the images of Rosetta and Juno |
33 | 33 | - [ ] Enable p67 |
34 | +- [x] Re-lock Earth until we have better support | |
34 | 35 | - [x] Add support for inputs STEREO-A, STEREO-B, L1 |
35 | 36 | - [x] More ticks along X-axis (I tried, but it does not behave as expected) |
36 | 37 | - [x] Smaller footer credits | ... | ... |
web/run.py
... | ... | @@ -419,10 +419,8 @@ def retrieve_amda_netcdf(orbiter, what, started_at, stopped_at): |
419 | 419 | return list(set(local_netc_files)) # remove possible dupes |
420 | 420 | |
421 | 421 | |
422 | -def get_data_for_target( | |
423 | - target_config, | |
424 | - started_at, stopped_at, | |
425 | - input_slug='l1'): | |
422 | +def get_data_for_target(target_config, input_slug, | |
423 | + started_at, stopped_at): | |
426 | 424 | """ |
427 | 425 | :return: dict whose keys are datetime as str, values tuples of data |
428 | 426 | """ |
... | ... | @@ -599,7 +597,8 @@ def generate_csv_contents(target_slug, input_slug, started_at, stopped_at): |
599 | 597 | return si.getvalue() |
600 | 598 | |
601 | 599 | |
602 | -def generate_csv_file_if_needed(target_slug, input_slug, started_at, stopped_at): | |
600 | +def generate_csv_file_if_needed(target_slug, input_slug, | |
601 | + started_at, stopped_at): | |
603 | 602 | filename = "%s_%s_%s_%s.csv" % (target_slug, input_slug, |
604 | 603 | started_at.strftime(FILE_DATE_FMT), |
605 | 604 | stopped_at.strftime(FILE_DATE_FMT)) |
... | ... | @@ -620,9 +619,10 @@ def generate_csv_file_if_needed(target_slug, input_slug, started_at, stopped_at) |
620 | 619 | log.info("Generating CSV '%s'..." % local_csv_file) |
621 | 620 | try: |
622 | 621 | with open(local_csv_file, mode="w+") as f: |
623 | - f.write(generate_csv_contents(target_slug, | |
624 | - started_at=started_at, | |
625 | - stopped_at=stopped_at)) | |
622 | + f.write(generate_csv_contents( | |
623 | + target_slug=target_slug, input_slug=input_slug, | |
624 | + started_at=started_at, stopped_at=stopped_at | |
625 | + )) | |
626 | 626 | log.info("Generation of '%s' done." % filename) |
627 | 627 | except Exception as e: |
628 | 628 | from sys import exc_info |
... | ... | @@ -694,7 +694,7 @@ def get_input_slug_from_query(inp=None): |
694 | 694 | input_slug = request.args.get('input_slug', 'l1') |
695 | 695 | else: |
696 | 696 | input_slug = inp |
697 | - if input_slug not in [i.slug for i in config.inputs]: | |
697 | + if input_slug not in [i['slug'] for i in config['inputs']]: | |
698 | 698 | input_slug = 'l1' # be tolerant instead of yelling loudly |
699 | 699 | return input_slug |
700 | 700 | ... | ... |