Bulk convert comments above classes/functions/methods into proper docstrings

This commit is contained in:
Ian Renton
2026-02-27 14:21:35 +00:00
parent 068c732796
commit 6b18ec6f88
63 changed files with 540 additions and 349 deletions

View File

@@ -10,8 +10,8 @@ from core.constants import HTTP_HEADERS
from spotproviders.spot_provider import SpotProvider
# Spot provider using websockets.
class WebsocketSpotProvider(SpotProvider):
"""Spot provider using websockets."""
def __init__(self, provider_config, url):
super().__init__(provider_config)
@@ -60,7 +60,8 @@ class WebsocketSpotProvider(SpotProvider):
logging.debug("Received data from " + self.name + " spot API.")
except Exception as e:
logging.exception("Exception processing message from Websocket Spot Provider (" + self.name + ")")
logging.exception(
"Exception processing message from Websocket Spot Provider (" + self.name + ")")
except Exception as e:
self.status = "Error"
@@ -69,7 +70,8 @@ class WebsocketSpotProvider(SpotProvider):
self.status = "Disconnected"
sleep(5) # Wait before trying to reconnect
# Convert a WS message received from the API into a spot. The exact message data (in bytes) is provided here so the
# subclass implementations can handle the message as string, JSON, XML, whatever the API actually provides.
def ws_message_to_spot(self, bytes):
raise NotImplementedError("Subclasses must implement this method")
"""Convert a WS message received from the API into a spot. The exact message data (in bytes) is provided here so the
subclass implementations can handle the message as string, JSON, XML, whatever the API actually provides."""
raise NotImplementedError("Subclasses must implement this method")