mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-03-15 12:24:29 +00:00
Bulk convert comments above classes/functions/methods into proper docstrings
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user