From f071f07795ee06116f2465c420f7fbf7950acc90 Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Tue, 18 Sep 2012 10:02:59 +0800 Subject: [PATCH] Clean up pep8 E502, E711 violations Updated pep8 version requirement to 1.3.3. Fixed E502 and E711 errors. E711 is ignored because of sqlalchemy statements. All ignores are to be removed in the next sequence of patches. Change-Id: I27155166a60be14521d958e1cc7c06ebcc90f1fd --- .mailmap | 1 + glance/common/utils.py | 2 +- glance/registry/client.py | 4 ++-- tools/test-requires | 2 +- tox.ini | 3 ++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.mailmap b/.mailmap index ac9e6535c1..173333bede 100644 --- a/.mailmap +++ b/.mailmap @@ -17,3 +17,4 @@ +Zhongyue Luo diff --git a/glance/common/utils.py b/glance/common/utils.py index 919c1b9856..68ddd1d721 100644 --- a/glance/common/utils.py +++ b/glance/common/utils.py @@ -386,7 +386,7 @@ def get_terminal_size(): height_width = func.get(platform.os.name, _get_terminal_size_unknownOS)() - if height_width == None: + if height_width is None: raise exception.Invalid() for i in height_width: diff --git a/glance/registry/client.py b/glance/registry/client.py index e39c125e53..d3390af128 100644 --- a/glance/registry/client.py +++ b/glance/registry/client.py @@ -89,8 +89,8 @@ class RegistryClient(BaseClient): action, **kwargs) status = res.status request_id = res.getheader('x-openstack-request-id') - msg = _("Registry request %(method)s %(action)s HTTP %(status)s"\ - " request id %(request_id)s") + msg = _("Registry request %(method)s %(action)s HTTP %(status)s" + " request id %(request_id)s") LOG.debug(msg % locals()) except: diff --git a/tools/test-requires b/tools/test-requires index 5783b28e4b..0a89113817 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -11,7 +11,7 @@ nose nose-exclude openstack.nose_plugin>=0.7 nosehtmloutput>=0.0.3 -pep8==1.1 +pep8==1.3.3 sphinx>=1.1.2 requests diff --git a/tox.ini b/tox.ini index 918ea876e0..c3368a9ee1 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,8 @@ commands = nosetests {posargs} downloadcache = ~/cache/pip [testenv:pep8] -commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack . +deps = pep8==1.3.3 +commands = pep8 --ignore=E121,E122,E123,E124,E125,E126,E127,E128,E711 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack . [testenv:cover] setenv = NOSE_WITH_COVERAGE=1