diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-12-15 17:14:43 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-12-15 17:14:43 +0200 |
commit | bc1eb6165749d3ff8ed1846c37673cfed56ad9e9 (patch) | |
tree | a0ea343aeb0f6142f58f1ba85284a6a9774374eb /ick2/controllerapi.py | |
parent | 4cb311fe68585f3286e7ec013e1c82c242d9310d (diff) | |
download | ick2-bc1eb6165749d3ff8ed1846c37673cfed56ad9e9.tar.gz |
Refactor: give ControllerAPI the state object to use
It's cleaner than having ControllerAPI create it itself. Less coupling.
Diffstat (limited to 'ick2/controllerapi.py')
-rw-r--r-- | ick2/controllerapi.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py index 1ef71cc..fe28c29 100644 --- a/ick2/controllerapi.py +++ b/ick2/controllerapi.py @@ -18,14 +18,8 @@ import ick2 class ControllerAPI: - def __init__(self): - self._state = ick2.ControllerState() - - def get_state_directory(self): - return self._state.get_state_directory() - - def set_state_directory(self, dirname): - self._state.set_state_directory(dirname) + def __init__(self, state): + self._state = state def find_missing_route(self, missing_path): # pragma: no cover apis = { |