equal
deleted
inserted
replaced
22 # ToDo after engelish is implemented set LANGUAGE_SELECTED = None |
22 # ToDo after engelish is implemented set LANGUAGE_SELECTED = None |
23 |
23 |
24 # We need the path of this file to find templates to translate |
24 # We need the path of this file to find templates to translate |
25 ESKP_PATH = os.path.dirname(os.path.abspath(__file__)) |
25 ESKP_PATH = os.path.dirname(os.path.abspath(__file__)) |
26 logging.basicConfig(filename=os.path.join(ESKP_PATH, 'eskp-app.log'), level=logging.DEBUG) |
26 logging.basicConfig(filename=os.path.join(ESKP_PATH, 'eskp-app.log'), level=logging.DEBUG) |
|
27 FILES= os.listdir(os.path.join(ESKP_PATH, 'static/images/uvmap')) |
27 |
28 |
28 app = Flask(__name__) |
29 app = Flask(__name__) |
29 babel = Babel(app) |
30 babel = Babel(app) |
30 |
31 |
31 app.config['BABEL_DEFAULT_LOCALE'] = 'de' |
32 app.config['BABEL_DEFAULT_LOCALE'] = 'de' |
47 content = publish_parts(rst_data, writer_name='html', settings_overrides=overrides)['html_body'] |
48 content = publish_parts(rst_data, writer_name='html', settings_overrides=overrides)['html_body'] |
48 return content |
49 return content |
49 |
50 |
50 |
51 |
51 def get_newest_date(): |
52 def get_newest_date(): |
52 files = os.listdir(os.path.join(ESKP_PATH, 'static/images/uvmap')) |
53 getdates = get_valid_dates(FILES) |
53 getdates = get_valid_dates(files) |
|
54 newest_date = getdates[-1] |
54 newest_date = getdates[-1] |
55 |
55 |
56 return newest_date |
56 return newest_date |
57 |
57 |
58 |
58 |
103 dates.remove(date) |
103 dates.remove(date) |
104 return dates |
104 return dates |
105 |
105 |
106 |
106 |
107 def get_o3lossuvmap_dates(date_show): |
107 def get_o3lossuvmap_dates(date_show): |
108 |
108 dates = get_valid_dates(FILES) |
109 files = os.listdir(os.path.join(ESKP_PATH,'static/images/uvmap')) |
|
110 dates = get_valid_dates(files) |
|
111 ndates = len(dates) |
109 ndates = len(dates) |
112 ind = dates.index(date_show) |
110 ind = dates.index(date_show) |
113 if ind ==0 : |
111 if ind ==0 : |
114 chosendates = [dates[ind+1]] |
112 chosendates = [dates[ind+1]] |
115 elif ind >= ndates - 1: |
113 elif ind >= ndates - 1: |