diff --git a/flaskr/content.py b/flaskr/content.py index 0d5e93c..88f1928 100644 --- a/flaskr/content.py +++ b/flaskr/content.py @@ -1,7 +1,10 @@ from collections import namedtuple -from yaml import safe_load as yaml_safe_load from os.path import abspath, dirname, join +from yaml import safe_load as yaml_safe_load + +# Move this to ENV, perhaps +base_url = "https://travel-footprint-calculator.irap.omp.eu" PROJECT_DIRECTORY = abspath(dirname(dirname(__file__))) @@ -21,7 +24,7 @@ class Struct(object): def __new__(cls, data): if isinstance(data, dict): return namedtuple( - 'Struct', data.iterkeys() + 'Struct', data.keys() )( *(Struct(val) for val in data.values()) ) @@ -33,9 +36,6 @@ class Struct(object): content = Struct(content_dict) -# Move this to ENV, perhaps -base_url = "https://travel-footprint-calculator.irap.omp.eu" - # For Python3? # def dict2obj(d): diff --git a/flaskr/controllers/main_controller.py b/flaskr/controllers/main_controller.py index f856c5c..9f151cf 100644 --- a/flaskr/controllers/main_controller.py +++ b/flaskr/controllers/main_controller.py @@ -154,8 +154,9 @@ def gather_addresses(from_list, from_file): for address in addresses: if not address: continue - if type(address).__name__ == 'str': - address = unicode(address, 'utf-8') + # if type(address).__name__ == 'str': + # address = str(address).encode('utf-8') + address = str(address) if to_ignore.match(address) is not None: continue clean_addresses.append(address) diff --git a/requirements.txt b/requirements.txt index 2293621..93b4f67 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ Flask-DebugToolbar==0.10.0 Flask-Login==0.4.0 Flask-Mail==0.9.1 Flask-Script==2.0.5 -Flask-SQLAlchemy==2.1 +Flask-SQLAlchemy==2.5.1 Flask-WTF==0.14 Flask-Sessionstore==0.4.5 Flask-Session-Captcha==1.2.0 -- libgit2 0.21.2