1.1 --- a/eskp.py Fri Mar 11 09:47:55 2016 +0100
1.2 +++ b/eskp.py Fri Mar 11 10:00:23 2016 +0100
1.3 @@ -24,6 +24,7 @@
1.4 # We need the path of this file to find templates to translate
1.5 ESKP_PATH = os.path.dirname(os.path.abspath(__file__))
1.6 logging.basicConfig(filename=os.path.join(ESKP_PATH, 'eskp-app.log'), level=logging.DEBUG)
1.7 +FILES= os.listdir(os.path.join(ESKP_PATH, 'static/images/uvmap'))
1.8
1.9 app = Flask(__name__)
1.10 babel = Babel(app)
1.11 @@ -49,8 +50,7 @@
1.12
1.13
1.14 def get_newest_date():
1.15 - files = os.listdir(os.path.join(ESKP_PATH, 'static/images/uvmap'))
1.16 - getdates = get_valid_dates(files)
1.17 + getdates = get_valid_dates(FILES)
1.18 newest_date = getdates[-1]
1.19
1.20 return newest_date
1.21 @@ -105,9 +105,7 @@
1.22
1.23
1.24 def get_o3lossuvmap_dates(date_show):
1.25 -
1.26 - files = os.listdir(os.path.join(ESKP_PATH,'static/images/uvmap'))
1.27 - dates = get_valid_dates(files)
1.28 + dates = get_valid_dates(FILES)
1.29 ndates = len(dates)
1.30 ind = dates.index(date_show)
1.31 if ind ==0 :