toggle active in config menu
This commit is contained in:
parent
a5f2f404b3
commit
a5eb6d1897
1 changed files with 15 additions and 0 deletions
15
config.py
15
config.py
|
@ -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)
|
||||
|
|
Reference in a new issue