style: format code using black

This commit is contained in:
jo 2023-02-01 11:16:58 +01:00 committed by Jonas L
parent c3e60f7cd4
commit 1e6c5a84d3
8 changed files with 7 additions and 6 deletions

View File

@ -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}")

View File

@ -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),

View File

@ -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:

View File

@ -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):

View File

@ -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

View File

@ -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"

View File

@ -21,6 +21,7 @@ AnyOutput = Annotated[
Field(discriminator="kind"),
]
# pylint: disable=too-few-public-methods
class FixtureConfig(BaseConfig):
public_url: AnyHttpUrl

View File

@ -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))