Fix pep8 errors
- E722 do not use bare 'except' Replace bare except clauses with explicit exception types. - E741 ambiguous variable name 'l' Rename 'l' to 'locale' In addition this patch squashes 684782 to use older werkzeug version to not face with exceptions. Generally this patch fixes lodgeit CI. Also, add tox jobs to in-tree zuul config These were defined in project-config, but we don't need to manage that centrally. Change-Id: Id750715472f88fa5dba0a2414fb1667df4a6dc40 Signed-off-by: David Pursehouse <dpursehouse@collab.net>
This commit is contained in:
parent
ab592381b0
commit
2d4b0ebee6
10
.zuul.yaml
Normal file
10
.zuul.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
- project:
|
||||
check:
|
||||
jobs:
|
||||
- tox-pep8
|
||||
- tox-py27
|
||||
gate:
|
||||
jobs:
|
||||
- tox-pep8
|
||||
- tox-py27
|
||||
|
@ -13,5 +13,5 @@ import subprocess
|
||||
|
||||
try:
|
||||
lodgeit_version = subprocess.check_output(['git', 'rev-parse', 'HEAD'])[:7]
|
||||
except:
|
||||
except Exception:
|
||||
lodgeit_version = ""
|
||||
|
@ -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__
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,5 @@
|
||||
Jinja2
|
||||
Werkzeug
|
||||
Werkzeug<0.16
|
||||
Pygments
|
||||
SQLAlchemy==0.9.7
|
||||
simplejson
|
||||
|
Loading…
Reference in New Issue
Block a user