Rename list_calls to iter_calls and makes it an iterator.
This commit is contained in:
@@ -298,10 +298,7 @@ class WSRoot(object):
|
||||
return res
|
||||
|
||||
context = None
|
||||
calls = protocol.list_calls(request)
|
||||
|
||||
if isinstance(calls, CallContext):
|
||||
calls = [calls]
|
||||
calls = list(protocol.iter_calls(request))
|
||||
|
||||
if len(calls) != 1:
|
||||
raise NotImplementedError("Batch calls are not yet supported")
|
||||
|
||||
@@ -16,8 +16,8 @@ class RestProtocol(object):
|
||||
return True
|
||||
return request.headers.get('Content-Type') in self.content_types
|
||||
|
||||
def list_calls(self, request):
|
||||
return CallContext(request)
|
||||
def iter_calls(self, request):
|
||||
yield CallContext(request)
|
||||
|
||||
def extract_path(self, context):
|
||||
path = context.request.path
|
||||
|
||||
@@ -21,8 +21,8 @@ class DummyProtocol(object):
|
||||
def accept(self, req):
|
||||
return True
|
||||
|
||||
def list_calls(self, req):
|
||||
return CallContext(req)
|
||||
def iter_calls(self, req):
|
||||
yield CallContext(req)
|
||||
|
||||
def extract_path(self, context):
|
||||
return ['touch']
|
||||
|
||||
Reference in New Issue
Block a user