mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-21 03:55:27 +00:00
Use successResultOf
in renderSynchronously
Get rid of [].append trick when dealing with the deferred.
This commit is contained in:
parent
e2fc1fc07e
commit
c061f6830e
@ -2969,9 +2969,8 @@ def renderSynchronously(ss):
|
|||||||
:param _StorageStatus ss: a StorageStatus instance.
|
:param _StorageStatus ss: a StorageStatus instance.
|
||||||
"""
|
"""
|
||||||
elem = StorageStatusElement(ss.storage, ss.nickname)
|
elem = StorageStatusElement(ss.storage, ss.nickname)
|
||||||
result = []
|
deferred = flattenString(None, elem)
|
||||||
flattenString(None, elem).addCallback(result.append)
|
return unittest.TestCase().successResultOf(deferred)
|
||||||
return result[0]
|
|
||||||
|
|
||||||
class MyBucketCountingCrawler(BucketCountingCrawler):
|
class MyBucketCountingCrawler(BucketCountingCrawler):
|
||||||
def finished_prefix(self, cycle, prefix):
|
def finished_prefix(self, cycle, prefix):
|
||||||
|
Loading…
Reference in New Issue
Block a user