From 9ffba71b368e8e58cd81c4c07e60c9f3dfc1405f Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Wed, 21 Sep 2011 13:59:16 +0200 Subject: [PATCH] PEP8 compliance --- wsme/__init__.py | 1 - wsme/controller.py | 5 ++--- wsme/exc.py | 3 +++ wsme/restxml.py | 2 +- wsme/tests/protocol.py | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wsme/__init__.py b/wsme/__init__.py index ecbb04e..ee4a877 100644 --- a/wsme/__init__.py +++ b/wsme/__init__.py @@ -1,3 +1,2 @@ from controller import expose, validate, WSRoot from types import wsattr, wsproperty - diff --git a/wsme/controller.py b/wsme/controller.py index 650ed01..ce92876 100644 --- a/wsme/controller.py +++ b/wsme/controller.py @@ -117,8 +117,8 @@ class WSRoot(object): r = dict(faultcode="Server", faultstring=str(excinfo[1])) if self._debug: - r['debuginfo'] = ("Traceback:\n%s\n" % - "\n".join(traceback.format_exception(*excinfo))) + r['debuginfo'] = "Traceback:\n%s\n" % ( + "\n".join(traceback.format_exception(*excinfo))) return r def _lookup_function(self, path): @@ -133,4 +133,3 @@ class WSRoot(object): raise exc.UnknownFunction('/'.join(path)) return a, a._wsme_definition - diff --git a/wsme/exc.py b/wsme/exc.py index 2d1c3ed..54e22f5 100644 --- a/wsme/exc.py +++ b/wsme/exc.py @@ -3,9 +3,11 @@ import __builtin__ if '_' not in __builtin__.__dict__: __builtin__._ = lambda s: s + class ClientSideError(RuntimeError): pass + class InvalidInput(ClientSideError): def __init__(self, fieldname, value, msg=''): self.fieldname = fieldname @@ -19,6 +21,7 @@ class InvalidInput(ClientSideError): def __str__(self): return unicode(self).encode('utf8', 'ignore') + class UnknownFunction(ClientSideError): def __init__(self, name): self.name = name diff --git a/wsme/restxml.py b/wsme/restxml.py index e270272..2bb1448 100644 --- a/wsme/restxml.py +++ b/wsme/restxml.py @@ -56,7 +56,7 @@ def binary_toxml(datatype, key, value): el.text = base64.encodestring(value) return el - + class RestXmlProtocol(RestProtocol): name = 'REST+XML' dataformat = 'xml' diff --git a/wsme/tests/protocol.py b/wsme/tests/protocol.py index 0cf039f..fb01fde 100644 --- a/wsme/tests/protocol.py +++ b/wsme/tests/protocol.py @@ -14,9 +14,9 @@ import wsme.types warnings.filterwarnings('ignore', module='webob.dec') - binarysample = r'\x00\xff\x43' + class CallException(RuntimeError): def __init__(self, faultcode, faultstring, debuginfo): self.faultcode = faultcode