Fix pep8 w503 errors

W503 doesn't allow binary ops at start of line, so this fixes
it.

Change-Id: I945950f8cb457414fe7d7b4638e99412275b3a06
This commit is contained in:
Chris Dent 2015-02-18 14:09:59 +00:00
parent da67a34cc7
commit bad1c3edfb
4 changed files with 10 additions and 11 deletions

View File

@ -169,9 +169,9 @@ def dict_fromjson(datatype, value):
@fromjson.when_object(six.binary_type)
def str_fromjson(datatype, value):
if (isinstance(value, six.string_types)
or isinstance(value, six.integer_types)
or isinstance(value, float)):
if (isinstance(value, six.string_types) or
isinstance(value, six.integer_types) or
isinstance(value, float)):
return six.text_type(value).encode('utf8')

View File

@ -145,10 +145,9 @@ class WSRoot(object):
log.debug("Selecting a protocol for the following request :\n"
"headers: %s\nbody: %s", request.headers.items(),
request.content_length and (
request.content_length > 512
and request.body[:512]
or request.body)
or '')
request.content_length > 512 and
request.body[:512] or
request.body) or '')
protocol = None
path = str(request.path)
assert path.startswith(self._webpath)

View File

@ -586,8 +586,8 @@ def inspect_class(class_):
attrdef = attr
else:
if attr not in native_types and (
inspect.isclass(attr)
or isinstance(attr, (list, dict))):
inspect.isclass(attr) or
isinstance(attr, (list, dict))):
register_type(attr)
attrdef = getattr(class_, '__wsattrclass__', wsattr)(attr)

View File

@ -490,8 +490,8 @@ class FunctionDocumenter(autodoc.MethodDocumenter):
@staticmethod
def can_document_member(member, membername, isattr, parent):
return (isinstance(parent, ServiceDocumenter)
and wsme.api.iswsmefunction(member))
return (isinstance(parent, ServiceDocumenter) and
wsme.api.iswsmefunction(member))
def import_object(self):
ret = super(FunctionDocumenter, self).import_object()