From 1e6c5a84d3d9cc7e446574760d313c5623ad7d3e Mon Sep 17 00:00:00 2001
From: jo <ljonas@riseup.net>
Date: Wed, 1 Feb 2023 11:16:58 +0100
Subject: [PATCH] style: format code using black

---
 analyzer/libretime_analyzer/status_reporter.py         | 4 +++-
 playout/libretime_playout/history/stats.py             | 1 -
 playout/libretime_playout/player/fetch.py              | 1 -
 playout/libretime_playout/player/liquidsoap_gateway.py | 1 -
 playout/libretime_playout/recorder.py                  | 1 -
 shared/libretime_shared/config/_models.py              | 3 +++
 shared/tests/config/base_test.py                       | 1 +
 tools/extract_requirements.py                          | 1 -
 8 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/analyzer/libretime_analyzer/status_reporter.py b/analyzer/libretime_analyzer/status_reporter.py
index 9d1ff5f34..70ee82927 100644
--- a/analyzer/libretime_analyzer/status_reporter.py
+++ b/analyzer/libretime_analyzer/status_reporter.py
@@ -86,7 +86,9 @@ def process_http_requests(ipc_queue, http_retry_queue_path):
             with open(http_retry_queue_path, "wb") as pickle_file:
                 pickle.dump(retry_queue, pickle_file)
             return
-        except Exception as exception:  # Terrible top-level exception handler to prevent the thread from dying, just in case.
+        except (
+            Exception
+        ) as exception:  # Terrible top-level exception handler to prevent the thread from dying, just in case.
             if shutdown:
                 return
             logger.exception(f"Unhandled exception in StatusReporter {exception}")
diff --git a/playout/libretime_playout/history/stats.py b/playout/libretime_playout/history/stats.py
index 2e56e95a4..323865fab 100644
--- a/playout/libretime_playout/history/stats.py
+++ b/playout/libretime_playout/history/stats.py
@@ -47,7 +47,6 @@ class StatsCollector:
         self,
         output: AnyOutput,
     ) -> Dict[str, Stats]:
-
         response = self._session.get(
             url=self.get_output_url(output),
             auth=(output.admin_user, output.admin_password),
diff --git a/playout/libretime_playout/player/fetch.py b/playout/libretime_playout/player/fetch.py
index 121bc2259..03fff1c25 100644
--- a/playout/libretime_playout/player/fetch.py
+++ b/playout/libretime_playout/player/fetch.py
@@ -234,7 +234,6 @@ class PypoFetch(Thread):
 
         # Download all the media and put playlists in liquidsoap "annotate" format
         try:
-
             # Make sure cache_dir exists
             download_dir = self.cache_dir
             try:
diff --git a/playout/libretime_playout/player/liquidsoap_gateway.py b/playout/libretime_playout/player/liquidsoap_gateway.py
index a75550426..403af9eed 100644
--- a/playout/libretime_playout/player/liquidsoap_gateway.py
+++ b/playout/libretime_playout/player/liquidsoap_gateway.py
@@ -28,7 +28,6 @@ def create_liquidsoap_annotation(media):
     # with the metadata we get from Airtime. (You can modify metadata in Airtime's library,
     # which doesn't get saved back to the file.)
     if "metadata" in media:
-
         if "artist_name" in media["metadata"]:
             artist_name = media["metadata"]["artist_name"]
             if isinstance(artist_name, str):
diff --git a/playout/libretime_playout/recorder.py b/playout/libretime_playout/recorder.py
index 890d0e816..ad0a93f44 100644
--- a/playout/libretime_playout/recorder.py
+++ b/playout/libretime_playout/recorder.py
@@ -118,7 +118,6 @@ class ShowRecorder(Thread):
         return self.p is not None
 
     def upload_file(self, filepath):
-
         filename = os.path.split(filepath)[1]
 
         # files is what requests actually expects
diff --git a/shared/libretime_shared/config/_models.py b/shared/libretime_shared/config/_models.py
index 26d3a364c..79929a12e 100644
--- a/shared/libretime_shared/config/_models.py
+++ b/shared/libretime_shared/config/_models.py
@@ -64,6 +64,7 @@ class GeneralConfig(BaseModel):
 # StorageConfig
 ########################################################################################
 
+
 # pylint: disable=too-few-public-methods
 class StorageConfig(BaseModel):
     path: str = "/srv/libretime"
@@ -75,6 +76,7 @@ class StorageConfig(BaseModel):
 # DatabaseConfig
 ########################################################################################
 
+
 # pylint: disable=too-few-public-methods
 class DatabaseConfig(BaseModel):
     host: str = "localhost"
@@ -94,6 +96,7 @@ class DatabaseConfig(BaseModel):
 # RabbitMQConfig
 ########################################################################################
 
+
 # pylint: disable=too-few-public-methods
 class RabbitMQConfig(BaseModel):
     host: str = "localhost"
diff --git a/shared/tests/config/base_test.py b/shared/tests/config/base_test.py
index 0aa51496e..6d540d4f2 100644
--- a/shared/tests/config/base_test.py
+++ b/shared/tests/config/base_test.py
@@ -21,6 +21,7 @@ AnyOutput = Annotated[
     Field(discriminator="kind"),
 ]
 
+
 # pylint: disable=too-few-public-methods
 class FixtureConfig(BaseConfig):
     public_url: AnyHttpUrl
diff --git a/tools/extract_requirements.py b/tools/extract_requirements.py
index 7d1eb887c..fa96e1b9b 100755
--- a/tools/extract_requirements.py
+++ b/tools/extract_requirements.py
@@ -39,7 +39,6 @@ for setup in glob("*/setup.py"):
             and isinstance(node.value.func, ast.Name)
             and node.value.func.id == "setup"
         ):
-
             for keyword in node.value.keywords:
                 if keyword.arg == "install_requires":
                     requires.extend(ast.literal_eval(keyword.value))