Replace returnValue with return (#5736)

This commit is contained in:
Amber Brown 2019-07-23 23:00:55 +10:00 committed by GitHub
parent 18a466b84e
commit 4806651744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
177 changed files with 1359 additions and 1513 deletions

View file

@ -145,7 +145,7 @@ class ApplicationServiceTransactionWorkerStore(
for service in as_list:
if service.id == res["as_id"]:
services.append(service)
defer.returnValue(services)
return services
@defer.inlineCallbacks
def get_appservice_state(self, service):
@ -164,9 +164,9 @@ class ApplicationServiceTransactionWorkerStore(
desc="get_appservice_state",
)
if result:
defer.returnValue(result.get("state"))
return result.get("state")
return
defer.returnValue(None)
return None
def set_appservice_state(self, service, state):
"""Set the application service state.
@ -298,15 +298,13 @@ class ApplicationServiceTransactionWorkerStore(
)
if not entry:
defer.returnValue(None)
return None
event_ids = json.loads(entry["event_ids"])
events = yield self.get_events_as_list(event_ids)
defer.returnValue(
AppServiceTransaction(service=service, id=entry["txn_id"], events=events)
)
return AppServiceTransaction(service=service, id=entry["txn_id"], events=events)
def _get_last_txn(self, txn, service_id):
txn.execute(
@ -360,7 +358,7 @@ class ApplicationServiceTransactionWorkerStore(
events = yield self.get_events_as_list(event_ids)
defer.returnValue((upper_bound, events))
return (upper_bound, events)
class ApplicationServiceTransactionStore(ApplicationServiceTransactionWorkerStore):