summaryrefslogtreecommitdiff
path: root/ick_controller.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-12-15 17:14:43 +0200
committerLars Wirzenius <liw@liw.fi>2017-12-15 17:14:43 +0200
commitbc1eb6165749d3ff8ed1846c37673cfed56ad9e9 (patch)
treea0ea343aeb0f6142f58f1ba85284a6a9774374eb /ick_controller.py
parent4cb311fe68585f3286e7ec013e1c82c242d9310d (diff)
downloadick2-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 'ick_controller.py')
-rw-r--r--ick_controller.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/ick_controller.py b/ick_controller.py
index 7c611a8..85c0bca 100644
--- a/ick_controller.py
+++ b/ick_controller.py
@@ -89,12 +89,11 @@ def main():
ick2.log.log('info', msg_text='Ick2 controller starts', config=config)
- api = ick2.ControllerAPI()
- ick2.log.log('info', msg_text='created ControllerAPI')
+ state = ick2.ControllerState()
+ state.set_state_directory(config['statedir'])
- api.set_state_directory(config['statedir'])
- ick2.log.log(
- 'info', msg_text='called ControllerAPI.set_state_directory')
+ api = ick2.ControllerAPI(state)
+ ick2.log.log('info', msg_text='created ControllerAPI')
application = apifw.create_bottle_application(
api, counter, dict_logger, config)