mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 03:34:49 -04:00
Update black, and run auto formatting over the codebase (#9381)
- Update black version to the latest
- Run black auto formatting over the codebase
- Run autoformatting according to [`docs/code_style.md
`](80d6dc9783/docs/code_style.md
)
- Update `code_style.md` docs around installing black to use the correct version
This commit is contained in:
parent
5636e597c3
commit
0a00b7ff14
271 changed files with 2802 additions and 1713 deletions
|
@ -83,15 +83,13 @@ class BackgroundFileConsumer:
|
|||
self._producer.resumeProducing()
|
||||
|
||||
def unregisterProducer(self):
|
||||
"""Part of IProducer interface
|
||||
"""
|
||||
"""Part of IProducer interface"""
|
||||
self._producer = None
|
||||
if not self._finished_deferred.called:
|
||||
self._bytes_queue.put_nowait(None)
|
||||
|
||||
def write(self, bytes):
|
||||
"""Part of IProducer interface
|
||||
"""
|
||||
"""Part of IProducer interface"""
|
||||
if self._write_exception:
|
||||
raise self._write_exception
|
||||
|
||||
|
@ -107,8 +105,7 @@ class BackgroundFileConsumer:
|
|||
self._producer.pauseProducing()
|
||||
|
||||
def _writer(self):
|
||||
"""This is run in a background thread to write to the file.
|
||||
"""
|
||||
"""This is run in a background thread to write to the file."""
|
||||
try:
|
||||
while self._producer or not self._bytes_queue.empty():
|
||||
# If we've paused the producer check if we should resume the
|
||||
|
@ -135,13 +132,11 @@ class BackgroundFileConsumer:
|
|||
self._file_obj.close()
|
||||
|
||||
def wait(self):
|
||||
"""Returns a deferred that resolves when finished writing to file
|
||||
"""
|
||||
"""Returns a deferred that resolves when finished writing to file"""
|
||||
return make_deferred_yieldable(self._finished_deferred)
|
||||
|
||||
def _resume_paused_producer(self):
|
||||
"""Gets called if we should resume producing after being paused
|
||||
"""
|
||||
"""Gets called if we should resume producing after being paused"""
|
||||
if self._paused_producer and self._producer:
|
||||
self._paused_producer = False
|
||||
self._producer.resumeProducing()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue