mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-28 18:22:05 +00:00
Allow spotting upstream to cluster. #39
This commit is contained in:
@@ -5,6 +5,12 @@ import pytz
|
||||
from core.data_store import DATA_STORE
|
||||
|
||||
|
||||
class SpotSubmissionError(Exception):
|
||||
"""Raised by a provider's submit_spot() when the upstream service refused or didn't accept the spot. The message
|
||||
is returned in the API / showed on the web UI. This is probably a user error, so we log a warning rather than a big
|
||||
stack trace like we would if we got some unexpected exception."""
|
||||
|
||||
|
||||
class SpotProvider:
|
||||
"""Generic spot provider class. Subclasses of this query the individual APIs for data."""
|
||||
|
||||
@@ -61,7 +67,8 @@ class SpotProvider:
|
||||
raise NotImplementedError("Subclasses must implement this method")
|
||||
|
||||
def can_submit_spot(self, activity):
|
||||
"""Return True if this provider supports submitting spots upstream for the given activity."""
|
||||
"""Return True if this provider supports submitting spots upstream for the given activity. Activity can be None,
|
||||
to check whether this provider supports submitting spots that have no activity."""
|
||||
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user