From 7eaa4f7be212848873263c165946781aada7b9ee Mon Sep 17 00:00:00 2001 From: Arnas Udovicius Date: Wed, 9 Jan 2019 09:03:04 +0200 Subject: [PATCH] manage time slots --- config.py | 70 +++++++++++++++++++++++++------------------------------ model.py | 30 ++++++++++++++++++++++++ tag.py | 22 ++++++++++++++++- 3 files changed, 83 insertions(+), 39 deletions(-) diff --git a/config.py b/config.py index b5ac04f..8c3ac1d 100644 --- a/config.py +++ b/config.py @@ -58,7 +58,7 @@ q - exit self.manage() elif menu == 't': - self.manage_timeslot() + self.manage_time_slot_menu() self.manage_menu() elif menu == '<': @@ -78,10 +78,13 @@ q - exit self.params.update('done', not done) self.screen.add_message('parameter "done" has been toggled') - def manage_timeslot(self): - self.manage_timeslot_menu() + def manage_time_slot_menu(self): + tsData = self.model.get_all_time_slots() + if tsData: + self.info = ' | '.join(['%s:%s' % (t['name'], t['description']) for t in tsData]) + '\n' + else: + self.info = None - def manage_timeslot_menu(self): about = ''' Short instruction ----------------- @@ -91,7 +94,7 @@ Short instruction < - back q - exit ''' - self.screen.change_path('~config/time_slot', '?+-