fix(playout): py36 compatibility broken typings
This partially reverts commit 5505222df6
.
This commit is contained in:
parent
d93ded9dd0
commit
d6348d5575
|
@ -8,7 +8,7 @@ import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
from typing import Any, Dict, Optional
|
from typing import Optional
|
||||||
|
|
||||||
import click
|
import click
|
||||||
from libretime_api_client.v1 import ApiClient as LegacyClient
|
from libretime_api_client.v1 import ApiClient as LegacyClient
|
||||||
|
@ -93,14 +93,14 @@ def cli(log_level: str, log_filepath: Optional[Path], config_filepath: Optional[
|
||||||
if not LIQUIDSOAP_MIN_VERSION <= liq_version:
|
if not LIQUIDSOAP_MIN_VERSION <= liq_version:
|
||||||
raise Exception(f"Invalid liquidsoap version {liq_version}")
|
raise Exception(f"Invalid liquidsoap version {liq_version}")
|
||||||
|
|
||||||
fetch_queue: Queue[Dict[str, Any]] = Queue()
|
fetch_queue = Queue()
|
||||||
recorder_queue: Queue[Dict[str, Any]] = Queue()
|
recorder_queue = Queue()
|
||||||
push_queue: Queue[Dict[str, Any]] = Queue()
|
push_queue = Queue()
|
||||||
# This queue is shared between pypo-fetch and pypo-file, where pypo-file
|
# This queue is shared between pypo-fetch and pypo-file, where pypo-file
|
||||||
# is the consumer. Pypo-fetch will send every schedule it gets to pypo-file
|
# is the consumer. Pypo-fetch will send every schedule it gets to pypo-file
|
||||||
# and pypo will parse this schedule to determine which file has the highest
|
# and pypo will parse this schedule to determine which file has the highest
|
||||||
# priority, and retrieve it.
|
# priority, and retrieve it.
|
||||||
file_queue: Queue[Dict[str, Any]] = Queue()
|
file_queue = Queue()
|
||||||
|
|
||||||
pypo_liquidsoap = PypoLiquidsoap(liq_client)
|
pypo_liquidsoap = PypoLiquidsoap(liq_client)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import json
|
||||||
import time
|
import time
|
||||||
from queue import Queue as ThreadQueue
|
from queue import Queue as ThreadQueue
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from typing import Any, Dict
|
|
||||||
|
|
||||||
# For RabbitMQ
|
# For RabbitMQ
|
||||||
from kombu.connection import Connection
|
from kombu.connection import Connection
|
||||||
|
@ -33,8 +32,8 @@ class PypoMessageHandler(Thread):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
fetch_queue: ThreadQueue[Dict[str, Any]],
|
fetch_queue: ThreadQueue,
|
||||||
recorder_queue: ThreadQueue[Dict[str, Any]],
|
recorder_queue: ThreadQueue,
|
||||||
config: RabbitMQConfig,
|
config: RabbitMQConfig,
|
||||||
):
|
):
|
||||||
Thread.__init__(self)
|
Thread.__init__(self)
|
||||||
|
|
|
@ -9,7 +9,6 @@ from datetime import datetime
|
||||||
from queue import Empty, Queue
|
from queue import Empty, Queue
|
||||||
from subprocess import PIPE, Popen
|
from subprocess import PIPE, Popen
|
||||||
from threading import Thread, Timer
|
from threading import Thread, Timer
|
||||||
from typing import Any, Dict
|
|
||||||
|
|
||||||
from libretime_api_client.v1 import ApiClient as LegacyClient
|
from libretime_api_client.v1 import ApiClient as LegacyClient
|
||||||
from libretime_api_client.v2 import ApiClient
|
from libretime_api_client.v2 import ApiClient
|
||||||
|
@ -35,9 +34,9 @@ class PypoFetch(Thread):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
fetch_queue: Queue[Dict[str, Any]],
|
fetch_queue: Queue,
|
||||||
push_queue: Queue[Dict[str, Any]],
|
push_queue: Queue,
|
||||||
file_queue: Queue[Dict[str, Any]],
|
file_queue: Queue,
|
||||||
liq_client: LiquidsoapClient,
|
liq_client: LiquidsoapClient,
|
||||||
pypo_liquidsoap: PypoLiquidsoap,
|
pypo_liquidsoap: PypoLiquidsoap,
|
||||||
config: Config,
|
config: Config,
|
||||||
|
|
|
@ -4,7 +4,6 @@ import stat
|
||||||
import time
|
import time
|
||||||
from queue import Empty, Queue
|
from queue import Empty, Queue
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from typing import Any, Dict
|
|
||||||
|
|
||||||
from libretime_api_client.v2 import ApiClient
|
from libretime_api_client.v2 import ApiClient
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
@ -16,7 +15,7 @@ class PypoFile(Thread):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
file_queue: Queue[Dict[str, Any]],
|
file_queue: Queue,
|
||||||
api_client: ApiClient,
|
api_client: ApiClient,
|
||||||
):
|
):
|
||||||
Thread.__init__(self)
|
Thread.__init__(self)
|
||||||
|
|
|
@ -3,7 +3,6 @@ import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from typing import Any, Dict
|
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
|
@ -25,7 +24,7 @@ class PypoPush(Thread):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
push_queue: Queue[Dict[str, Any]],
|
push_queue: Queue,
|
||||||
pypo_liquidsoap: PypoLiquidsoap,
|
pypo_liquidsoap: PypoLiquidsoap,
|
||||||
config: Config,
|
config: Config,
|
||||||
):
|
):
|
||||||
|
@ -38,7 +37,7 @@ class PypoPush(Thread):
|
||||||
self.current_prebuffering_stream_id = None
|
self.current_prebuffering_stream_id = None
|
||||||
self.queue_id = 0
|
self.queue_id = 0
|
||||||
|
|
||||||
self.future_scheduled_queue: Queue[Dict[str, Any]] = Queue()
|
self.future_scheduled_queue = Queue()
|
||||||
self.pypo_liquidsoap = pypo_liquidsoap
|
self.pypo_liquidsoap = pypo_liquidsoap
|
||||||
|
|
||||||
self.plq = PypoLiqQueue(self.future_scheduled_queue, self.pypo_liquidsoap)
|
self.plq = PypoLiqQueue(self.future_scheduled_queue, self.pypo_liquidsoap)
|
||||||
|
|
|
@ -4,7 +4,6 @@ from collections import deque
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from queue import Empty, Queue
|
from queue import Empty, Queue
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from typing import Any, Dict
|
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
|
@ -25,7 +24,7 @@ class PypoLiqQueue(Thread):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
future_queue: Queue[Dict[str, Any]],
|
future_queue: Queue,
|
||||||
pypo_liquidsoap: PypoLiquidsoap,
|
pypo_liquidsoap: PypoLiquidsoap,
|
||||||
):
|
):
|
||||||
Thread.__init__(self)
|
Thread.__init__(self)
|
||||||
|
|
Loading…
Reference in New Issue