diff -r 8f14ec7ffd07 -r a4f39dc4db6a eskp.py --- a/eskp.py Fri Mar 11 09:47:55 2016 +0100 +++ b/eskp.py Fri Mar 11 10:00:23 2016 +0100 @@ -24,6 +24,7 @@ # We need the path of this file to find templates to translate ESKP_PATH = os.path.dirname(os.path.abspath(__file__)) logging.basicConfig(filename=os.path.join(ESKP_PATH, 'eskp-app.log'), level=logging.DEBUG) +FILES= os.listdir(os.path.join(ESKP_PATH, 'static/images/uvmap')) app = Flask(__name__) babel = Babel(app) @@ -49,8 +50,7 @@ def get_newest_date(): - files = os.listdir(os.path.join(ESKP_PATH, 'static/images/uvmap')) - getdates = get_valid_dates(files) + getdates = get_valid_dates(FILES) newest_date = getdates[-1] return newest_date @@ -105,9 +105,7 @@ def get_o3lossuvmap_dates(date_show): - - files = os.listdir(os.path.join(ESKP_PATH,'static/images/uvmap')) - dates = get_valid_dates(files) + dates = get_valid_dates(FILES) ndates = len(dates) ind = dates.index(date_show) if ind ==0 :