Merge pull request #6 from kokarare1212/deepsource-fix-398ac89c
Use literal syntax instead of function calls to create data structure
This commit is contained in:
commit
e93aba1f77
|
@ -15,7 +15,7 @@ class AudioKeyManager(PacketsReceiver):
|
|||
_AUDIO_KEY_REQUEST_TIMEOUT: int = 20
|
||||
_seqHolder: int = 0
|
||||
_seqHolderLock: threading.Condition = threading.Condition()
|
||||
_callbacks: dict[int, AudioKeyManager.Callback] = dict()
|
||||
_callbacks: dict[int, AudioKeyManager.Callback] = {}
|
||||
_session: Session = None
|
||||
|
||||
def __init__(self, session: Session):
|
||||
|
|
|
@ -15,7 +15,7 @@ import threading
|
|||
class ChannelManager(Closeable, PacketsReceiver.PacketsReceiver):
|
||||
CHUNK_SIZE: int = 128 * 1024
|
||||
_LOGGER: logging = logging.getLogger(__name__)
|
||||
_channels: dict[int, Channel] = dict()
|
||||
_channels: dict[int, Channel] = {}
|
||||
_seqHolder: int = 0
|
||||
_seqHolderLock: threading.Condition = threading.Condition()
|
||||
_executorService: concurrent.futures.ThreadPoolExecutor = concurrent.futures.ThreadPoolExecutor(
|
||||
|
|
|
@ -60,11 +60,11 @@ class Session(Closeable, SubListener, DealerClient.MessageListener):
|
|||
_authLock: threading.Condition = threading.Condition()
|
||||
_authLockBool: bool = False
|
||||
_client: requests.Session = None
|
||||
_closeListeners: list[Session.CloseListener] = list()
|
||||
_closeListeners: list[Session.CloseListener] = []
|
||||
_closeListenersLock: threading.Condition = threading.Condition()
|
||||
_reconnectionListeners: list[Session.ReconnectionListener] = list()
|
||||
_reconnectionListeners: list[Session.ReconnectionListener] = []
|
||||
_reconnectionListenersLock: threading.Condition = threading.Condition()
|
||||
_userAttributes: dict[str, str] = dict()
|
||||
_userAttributes: dict[str, str] = {}
|
||||
_conn: Session.ConnectionHolder = None
|
||||
_cipherPair: CipherPair = None
|
||||
_receiver: Session.Receiver = None
|
||||
|
@ -379,10 +379,9 @@ class Session(Closeable, SubListener, DealerClient.MessageListener):
|
|||
with self._closeListenersLock:
|
||||
for listener in self._closeListeners:
|
||||
listener.on_closed()
|
||||
self._closeListeners: list[Session.CloseListener] = list()
|
||||
self._closeListeners: list[Session.CloseListener] = []
|
||||
|
||||
self._reconnectionListeners: list[
|
||||
Session.ReconnectionListener] = list()
|
||||
self._reconnectionListeners: list[Session.ReconnectionListener] = []
|
||||
|
||||
self._LOGGER.info("Closed session. device_id: {}".format(
|
||||
self._inner.device_id))
|
||||
|
|
|
@ -17,11 +17,11 @@ class MercuryClient(PacketsReceiver.PacketsReceiver, Closeable):
|
|||
_MERCURY_REQUEST_TIMEOUT: int = 3
|
||||
_seqHolder: int = 1
|
||||
_seqHolderLock: threading.Condition = threading.Condition()
|
||||
_callbacks: dict[int, Callback] = dict()
|
||||
_callbacks: dict[int, Callback] = {}
|
||||
_removeCallbackLock: threading.Condition = threading.Condition()
|
||||
_subscriptions: list[MercuryClient.InternalSubListener] = list()
|
||||
_subscriptions: list[MercuryClient.InternalSubListener] = []
|
||||
_subscriptionsLock: threading.Condition = threading.Condition()
|
||||
_partials: dict[int, bytes] = dict()
|
||||
_partials: dict[int, bytes] = {}
|
||||
_session: Session = None
|
||||
|
||||
def __init__(self, session: Session):
|
||||
|
|
|
@ -22,7 +22,7 @@ class Player(Closeable, PlayerSession.Listener, AudioSink.Listener):
|
|||
_conf: PlayerConfiguration = None
|
||||
_events: Player.EventsDispatcher = None
|
||||
_sink: AudioSink = None
|
||||
_metrics: dict[str, PlaybackMetrics] = dict()
|
||||
_metrics: dict[str, PlaybackMetrics] = {}
|
||||
_state: StateWrapper = None
|
||||
_playerSession: PlayerSession = None
|
||||
_releaseLineFuture = None
|
||||
|
|
|
@ -19,7 +19,7 @@ class DeviceStateHandler:
|
|||
_LOGGER: logging = logging.getLogger(__name__)
|
||||
_session: Session = None
|
||||
_deviceInfo: Connect.DeviceInfo = None
|
||||
_listeners: list[DeviceStateHandler.Listener] = list()
|
||||
_listeners: list[DeviceStateHandler.Listener] = []
|
||||
_putState: Connect.PutStateRequest = None
|
||||
_putStateWorker: concurrent.futures.ThreadPoolExecutor = (
|
||||
concurrent.futures.ThreadPoolExecutor())
|
||||
|
|
Loading…
Reference in New Issue