PEP8 compliance

This commit is contained in:
Christophe de Vienne
2011-09-21 13:59:16 +02:00
parent db326ab2ea
commit 9ffba71b36
5 changed files with 7 additions and 6 deletions

View File

@@ -1,3 +1,2 @@
from controller import expose, validate, WSRoot
from types import wsattr, wsproperty

View File

@@ -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

View File

@@ -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

View File

@@ -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'

View File

@@ -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