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):
|
def manage(self):
|
||||||
print(bcolors.HEADER + 'Managing configs' + bcolors.ENDC)
|
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'
|
done = 'off'
|
||||||
if self.params.get('done'):
|
if self.params.get('done'):
|
||||||
done = 'on'
|
done = 'on'
|
||||||
|
@ -33,6 +39,10 @@ class Config:
|
||||||
self.manage_about()
|
self.manage_about()
|
||||||
self.manage_menu()
|
self.manage_menu()
|
||||||
|
|
||||||
|
elif menu == '!':
|
||||||
|
self.toggle_active()
|
||||||
|
self.manage()
|
||||||
|
|
||||||
elif menu == 'v':
|
elif menu == 'v':
|
||||||
self.toggle_done()
|
self.toggle_done()
|
||||||
self.manage()
|
self.manage()
|
||||||
|
@ -61,6 +71,11 @@ t - manage time slots
|
||||||
q - exit
|
q - exit
|
||||||
''' + bcolors.ENDC)
|
''' + 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):
|
def toggle_done(self):
|
||||||
done = self.params.get('done')
|
done = self.params.get('done')
|
||||||
self.params.update('done', not done)
|
self.params.update('done', not done)
|
||||||
|
|
Reference in a new issue