Created more abstract level for data sources

This commit is contained in:
Maximilian Giller 2019-02-23 20:41:01 +01:00
parent 1b9ed82b40
commit d102c7c639
2 changed files with 7 additions and 4 deletions

View file

@ -0,0 +1,4 @@
class DataSourceInterface (object):
"""Interface for child interfaces that fetch data."""
def is_available (self):
raise NotImplementedError("Functions needs to be implemented")

View file

@ -1,8 +1,7 @@
class WeatherInterface (object):
"""Interface for fetching and processing weather forecast information."""
def is_available (self):
raise NotImplementedError("Functions needs to be implemented")
from DataSourceInterface import DataSourceInterface
class WeatherInterface (DataSourceInterface):
"""Interface for fetching and processing weather forecast information."""
def get_forecast_in_days (self, offset_by_days, location):
raise NotImplementedError("Functions needs to be implemented")