From bc1eb6165749d3ff8ed1846c37673cfed56ad9e9 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 15 Dec 2017 17:14:43 +0200 Subject: Refactor: give ControllerAPI the state object to use It's cleaner than having ControllerAPI create it itself. Less coupling. --- ick2/controllerapi.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'ick2/controllerapi.py') 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 = { -- cgit v1.2.1