diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..bd9ba2b --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,10 @@ +- project: + check: + jobs: + - tox-pep8 + - tox-py27 + gate: + jobs: + - tox-pep8 + - tox-py27 + diff --git a/lodgeit/__init__.py b/lodgeit/__init__.py index ed4ff83..521f335 100644 --- a/lodgeit/__init__.py +++ b/lodgeit/__init__.py @@ -13,5 +13,5 @@ import subprocess try: lodgeit_version = subprocess.check_output(['git', 'rev-parse', 'HEAD'])[:7] -except: +except Exception: lodgeit_version = "" diff --git a/lodgeit/i18n/__init__.py b/lodgeit/i18n/__init__.py index 3fa716a..f4884ff 100644 --- a/lodgeit/i18n/__init__.py +++ b/lodgeit/i18n/__init__.py @@ -64,10 +64,10 @@ def list_languages(): os.path.isdir(os.path.join(folder, filename)): continue try: - l = Locale.parse(filename) + locale = Locale.parse(filename) except UnknownLocaleError: continue - languages.append((str(l), l.display_name)) + languages.append((str(locale), locale.display_name)) languages.sort(key=lambda x: x[1].lower()) return languages @@ -170,7 +170,7 @@ class _TranslationProxy(object): def __repr__(self): try: return 'i' + repr(unicode(self.value)) - except: + except ValueError: return '<%s broken>' % self.__class__.__name__ diff --git a/lodgeit/utils.py b/lodgeit/utils.py index f4e0bde..34235e0 100644 --- a/lodgeit/utils.py +++ b/lodgeit/utils.py @@ -26,7 +26,7 @@ from lodgeit.i18n import get_translations try: from hashlib import sha1 -except: +except ImportError: from sha import new as sha1 #: Jinja2 Environment for our template handling diff --git a/requirements.txt b/requirements.txt index d6cbb84..e748eb4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Jinja2 -Werkzeug +Werkzeug<0.16 Pygments SQLAlchemy==0.9.7 simplejson diff --git a/tox.ini b/tox.ini index d22eb75..79fc2dc 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,7 @@ deps = -r{toxinidir}/requirements.txt commands = nosetests [testenv:pep8] +basepython = python2 commands = flake8 [flake8]