548
549 def __init__(self, session: Session, stream_id: StreamId,
550 audio_format: SuperAudioFormat,
551 cdn_url: CdnManager.CdnUrl, cache: CacheManager,552 audio_decrypt: AudioDecrypt, halt_listener: HaltListener):
553 self.__session = session
554 self.__stream_id = stream_id
63 def mark_supported(self) -> bool:
64 return True
65
66 def mark(self, read_ahead_limit: int) -> None: 67 self.__mark = self.__pos
68
69 def reset(self) -> None:
392 "An exception occurred. Reconnecting...")
393 self.close()
394
395 def on_message(self, ws: websocket.WebSocketApp, text: str): 396 obj = json.loads(text)
397 self.__dealer_client.wait_for_listener()
398 typ = MessageType.parse(obj.get("type"))
408 raise RuntimeError("Unknown message type for {}".format(
409 typ.value))
410
411 def on_open(self, ws: websocket.WebSocketApp): 412 if self.__closed:
413 self.__dealer_client.logger.fatal(
414 "I wonder what happened here... Terminating. [closed: {}]".
385 if self.__last_scheduled_ping is not None:
386 self.__scheduler.cancel(self.__last_scheduled_ping)
387
388 def on_failure(self, ws: websocket.WebSocketApp, error): 389 if self.__closed:
390 return
391 self.__dealer_client.logger.warning(
An unused argument can lead to confusions. It should be removed. If this variable is necessary, name the variable _
or start the name with unused
or _unused
.
def square(x, y=1):
return x * x
class MySubClass(MyClass):
def __init__(self, number):
self.value = 42 # argument `number` remains unused
def square(x):
return x * x
class MySubClass(MyClass):
def __init__(self, _):
self.value = 42