style: format code using black
This commit is contained in:
parent
9c9b06e13e
commit
bd76971312
|
@ -86,7 +86,9 @@ def process_http_requests(ipc_queue, http_retry_queue_path):
|
||||||
with open(http_retry_queue_path, "wb") as pickle_file:
|
with open(http_retry_queue_path, "wb") as pickle_file:
|
||||||
pickle.dump(retry_queue, pickle_file)
|
pickle.dump(retry_queue, pickle_file)
|
||||||
return
|
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:
|
if shutdown:
|
||||||
return
|
return
|
||||||
logger.exception(f"Unhandled exception in StatusReporter {exception}")
|
logger.exception(f"Unhandled exception in StatusReporter {exception}")
|
||||||
|
|
|
@ -47,7 +47,6 @@ class StatsCollector:
|
||||||
self,
|
self,
|
||||||
output: AnyOutput,
|
output: AnyOutput,
|
||||||
) -> Dict[str, Stats]:
|
) -> Dict[str, Stats]:
|
||||||
|
|
||||||
response = self._session.get(
|
response = self._session.get(
|
||||||
url=self.get_output_url(output),
|
url=self.get_output_url(output),
|
||||||
auth=(output.admin_user, output.admin_password),
|
auth=(output.admin_user, output.admin_password),
|
||||||
|
|
|
@ -235,7 +235,6 @@ class PypoFetch(Thread):
|
||||||
|
|
||||||
# Download all the media and put playlists in liquidsoap "annotate" format
|
# Download all the media and put playlists in liquidsoap "annotate" format
|
||||||
try:
|
try:
|
||||||
|
|
||||||
# Make sure cache_dir exists
|
# Make sure cache_dir exists
|
||||||
download_dir = self.cache_dir
|
download_dir = self.cache_dir
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -28,7 +28,6 @@ def create_liquidsoap_annotation(media):
|
||||||
# with the metadata we get from Airtime. (You can modify metadata in Airtime's library,
|
# with the metadata we get from Airtime. (You can modify metadata in Airtime's library,
|
||||||
# which doesn't get saved back to the file.)
|
# which doesn't get saved back to the file.)
|
||||||
if "metadata" in media:
|
if "metadata" in media:
|
||||||
|
|
||||||
if "artist_name" in media["metadata"]:
|
if "artist_name" in media["metadata"]:
|
||||||
artist_name = media["metadata"]["artist_name"]
|
artist_name = media["metadata"]["artist_name"]
|
||||||
if isinstance(artist_name, str):
|
if isinstance(artist_name, str):
|
||||||
|
|
|
@ -118,7 +118,6 @@ class ShowRecorder(Thread):
|
||||||
return self.p is not None
|
return self.p is not None
|
||||||
|
|
||||||
def upload_file(self, filepath):
|
def upload_file(self, filepath):
|
||||||
|
|
||||||
filename = os.path.split(filepath)[1]
|
filename = os.path.split(filepath)[1]
|
||||||
|
|
||||||
# files is what requests actually expects
|
# files is what requests actually expects
|
||||||
|
|
|
@ -64,6 +64,7 @@ class GeneralConfig(BaseModel):
|
||||||
# StorageConfig
|
# StorageConfig
|
||||||
########################################################################################
|
########################################################################################
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
class StorageConfig(BaseModel):
|
class StorageConfig(BaseModel):
|
||||||
path: str = "/srv/libretime"
|
path: str = "/srv/libretime"
|
||||||
|
@ -75,6 +76,7 @@ class StorageConfig(BaseModel):
|
||||||
# DatabaseConfig
|
# DatabaseConfig
|
||||||
########################################################################################
|
########################################################################################
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
class DatabaseConfig(BaseModel):
|
class DatabaseConfig(BaseModel):
|
||||||
host: str = "localhost"
|
host: str = "localhost"
|
||||||
|
@ -94,6 +96,7 @@ class DatabaseConfig(BaseModel):
|
||||||
# RabbitMQConfig
|
# RabbitMQConfig
|
||||||
########################################################################################
|
########################################################################################
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
class RabbitMQConfig(BaseModel):
|
class RabbitMQConfig(BaseModel):
|
||||||
host: str = "localhost"
|
host: str = "localhost"
|
||||||
|
|
|
@ -21,6 +21,7 @@ AnyOutput = Annotated[
|
||||||
Field(discriminator="kind"),
|
Field(discriminator="kind"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
class FixtureConfig(BaseConfig):
|
class FixtureConfig(BaseConfig):
|
||||||
public_url: AnyHttpUrl
|
public_url: AnyHttpUrl
|
||||||
|
|
|
@ -39,7 +39,6 @@ for setup in glob("*/setup.py"):
|
||||||
and isinstance(node.value.func, ast.Name)
|
and isinstance(node.value.func, ast.Name)
|
||||||
and node.value.func.id == "setup"
|
and node.value.func.id == "setup"
|
||||||
):
|
):
|
||||||
|
|
||||||
for keyword in node.value.keywords:
|
for keyword in node.value.keywords:
|
||||||
if keyword.arg == "install_requires":
|
if keyword.arg == "install_requires":
|
||||||
requires.extend(ast.literal_eval(keyword.value))
|
requires.extend(ast.literal_eval(keyword.value))
|
||||||
|
|
Loading…
Reference in New Issue