From d102c7c639211144b511e77f4dcc96b818757ecd Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Sat, 23 Feb 2019 20:41:01 +0100 Subject: [PATCH] Created more abstract level for data sources --- Calendar/DataSourceInterface.py | 4 ++++ Calendar/WeatherInterface.py | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 Calendar/DataSourceInterface.py diff --git a/Calendar/DataSourceInterface.py b/Calendar/DataSourceInterface.py new file mode 100644 index 0000000..c7d7ecd --- /dev/null +++ b/Calendar/DataSourceInterface.py @@ -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") \ No newline at end of file diff --git a/Calendar/WeatherInterface.py b/Calendar/WeatherInterface.py index 4db2d79..3140746 100644 --- a/Calendar/WeatherInterface.py +++ b/Calendar/WeatherInterface.py @@ -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")