Skip to content
Snippets Groups Projects
Commit 2a91799f authored by Paul "LeoNerd" Evans's avatar Paul "LeoNerd" Evans
Browse files

Minor syntax neatenings

parent fcf1dec8
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,7 @@ class ApplicationServiceApi(SimpleHttpClient): ...@@ -73,7 +73,7 @@ class ApplicationServiceApi(SimpleHttpClient):
@defer.inlineCallbacks @defer.inlineCallbacks
def query_3pu(self, service, protocol, fields): def query_3pu(self, service, protocol, fields):
uri = service.url + ("/3pu/%s" % urllib.quote(protocol)) uri = "%s/3pu/%s" % (service.url, urllib.quote(protocol))
response = None response = None
try: try:
response = yield self.get_json(uri, fields) response = yield self.get_json(uri, fields)
...@@ -84,7 +84,7 @@ class ApplicationServiceApi(SimpleHttpClient): ...@@ -84,7 +84,7 @@ class ApplicationServiceApi(SimpleHttpClient):
@defer.inlineCallbacks @defer.inlineCallbacks
def query_3pl(self, service, protocol, fields): def query_3pl(self, service, protocol, fields):
uri = service.url + ("/3pl/%s" % urllib.quote(protocol)) uri = "%s/3pl/%s" % (service.url, urllib.quote(protocol))
response = None response = None
try: try:
response = yield self.get_json(uri, fields) response = yield self.get_json(uri, fields)
......
...@@ -172,13 +172,10 @@ class ApplicationServicesHandler(object): ...@@ -172,13 +172,10 @@ class ApplicationServicesHandler(object):
def query_3pu(self, protocol, fields): def query_3pu(self, protocol, fields):
services = yield self._get_services_for_3pn(protocol) services = yield self._get_services_for_3pn(protocol)
deferreds = [] results = yield defer.DeferredList([
for service in services: self.appservice_api.query_3pu(service, protocol, fields)
deferreds.append(self.appservice_api.query_3pu( for service in services
service, protocol, fields ], consumeErrors=True)
))
results = yield defer.DeferredList(deferreds, consumeErrors=True)
ret = [] ret = []
for (success, result) in results: for (success, result) in results:
...@@ -199,13 +196,10 @@ class ApplicationServicesHandler(object): ...@@ -199,13 +196,10 @@ class ApplicationServicesHandler(object):
def query_3pl(self, protocol, fields): def query_3pl(self, protocol, fields):
services = yield self._get_services_for_3pn(protocol) services = yield self._get_services_for_3pn(protocol)
deferreds = [] results = yield defer.DeferredList([
for service in services: self.appservice_api.query_3pl(service, protocol, fields)
deferreds.append(self.appservice_api.query_3pl( for service in services
service, protocol, fields ], consumeErrors=True)
))
results = yield defer.DeferredList(deferreds, consumeErrors=True)
ret = [] ret = []
for (success, result) in results: for (success, result) in results:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment