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) @fromjson.when_object(six.binary_type)
def str_fromjson(datatype, value): def str_fromjson(datatype, value):
if (isinstance(value, six.string_types) if (isinstance(value, six.string_types) or
or isinstance(value, six.integer_types) isinstance(value, six.integer_types) or
or isinstance(value, float)): isinstance(value, float)):
return six.text_type(value).encode('utf8') 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" log.debug("Selecting a protocol for the following request :\n"
"headers: %s\nbody: %s", request.headers.items(), "headers: %s\nbody: %s", request.headers.items(),
request.content_length and ( request.content_length and (
request.content_length > 512 request.content_length > 512 and
and request.body[:512] request.body[:512] or
or request.body) request.body) or '')
or '')
protocol = None protocol = None
path = str(request.path) path = str(request.path)
assert path.startswith(self._webpath) assert path.startswith(self._webpath)

View File

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

View File

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