toggle active in config menu

This commit is contained in:
Arnas Udovicius 2018-03-13 22:49:47 +02:00
parent a5f2f404b3
commit a5eb6d1897

View file

@ -15,6 +15,12 @@ class Config:
def manage(self):
print(bcolors.HEADER + 'Managing configs' + bcolors.ENDC)
active = 'off'
if self.params.get('active'):
active = 'on'
print(bcolors.WARNING + 'Show current tasks: [' + active + ']' + bcolors.ENDC)
done = 'off'
if self.params.get('done'):
done = 'on'
@ -33,6 +39,10 @@ class Config:
self.manage_about()
self.manage_menu()
elif menu == '!':
self.toggle_active()
self.manage()
elif menu == 'v':
self.toggle_done()
self.manage()
@ -61,6 +71,11 @@ t - manage time slots
q - exit
''' + bcolors.ENDC)
def toggle_active(self):
active = self.params.get('active')
self.params.update('active', not active)
print(bcolors.OKBLUE + '[parameter "active" has been toggled]' + bcolors.ENDC)
def toggle_done(self):
done = self.params.get('done')
self.params.update('done', not done)