Commit de97d64363d18103b9a460be36b57f369de804de

Authored by Goutte
1 parent 06eda8f7

Fix more bugs.

Showing 2 changed files with 10 additions and 9 deletions   Show diff stats
@@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
31 31
32 - [ ] Rework the images of Rosetta and Juno 32 - [ ] Rework the images of Rosetta and Juno
33 - [ ] Enable p67 33 - [ ] Enable p67
  34 +- [x] Re-lock Earth until we have better support
34 - [x] Add support for inputs STEREO-A, STEREO-B, L1 35 - [x] Add support for inputs STEREO-A, STEREO-B, L1
35 - [x] More ticks along X-axis (I tried, but it does not behave as expected) 36 - [x] More ticks along X-axis (I tried, but it does not behave as expected)
36 - [x] Smaller footer credits 37 - [x] Smaller footer credits
@@ -419,10 +419,8 @@ def retrieve_amda_netcdf(orbiter, what, started_at, stopped_at): @@ -419,10 +419,8 @@ def retrieve_amda_netcdf(orbiter, what, started_at, stopped_at):
419 return list(set(local_netc_files)) # remove possible dupes 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 :return: dict whose keys are datetime as str, values tuples of data 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,7 +597,8 @@ def generate_csv_contents(target_slug, input_slug, started_at, stopped_at):
599 return si.getvalue() 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 filename = "%s_%s_%s_%s.csv" % (target_slug, input_slug, 602 filename = "%s_%s_%s_%s.csv" % (target_slug, input_slug,
604 started_at.strftime(FILE_DATE_FMT), 603 started_at.strftime(FILE_DATE_FMT),
605 stopped_at.strftime(FILE_DATE_FMT)) 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,9 +619,10 @@ def generate_csv_file_if_needed(target_slug, input_slug, started_at, stopped_at)
620 log.info("Generating CSV '%s'..." % local_csv_file) 619 log.info("Generating CSV '%s'..." % local_csv_file)
621 try: 620 try:
622 with open(local_csv_file, mode="w+") as f: 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 log.info("Generation of '%s' done." % filename) 626 log.info("Generation of '%s' done." % filename)
627 except Exception as e: 627 except Exception as e:
628 from sys import exc_info 628 from sys import exc_info
@@ -694,7 +694,7 @@ def get_input_slug_from_query(inp=None): @@ -694,7 +694,7 @@ def get_input_slug_from_query(inp=None):
694 input_slug = request.args.get('input_slug', 'l1') 694 input_slug = request.args.get('input_slug', 'l1')
695 else: 695 else:
696 input_slug = inp 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 input_slug = 'l1' # be tolerant instead of yelling loudly 698 input_slug = 'l1' # be tolerant instead of yelling loudly
699 return input_slug 699 return input_slug
700 700