from pyfzf.pyfzf import FzfPrompt from model import Model from screen import Screen class Tag: def __init__(self): self.model = Model() self.fzf = FzfPrompt() self.screen = Screen() self.header = '' self.info = None def manage_tag(self, tid=None): if tid: tag = self.model.get_tag(tid) self.header = 'Managing tag: ' + tag['name'] else: self.header = 'Managing tags' tagsData = self.model.get_all_tags() if not tagsData: self.add_tag() tagsData = self.model.get_all_tags() self.info = ' '.join([t['name'] for t in tagsData]) + '\n' self.manage_tag_menu(tid) def manage_tag_menu(self, tid=None): about = ''' Short instruction ----------------- ? - help (this dialog) / - search tag + - add tag - - remove tag & - search linked tasks < - back q - exit ''' self.screen.change_path('~tag', '?/+-&