import sys from pyfzf.pyfzf import FzfPrompt from model import Model from bcolors import bcolors class Tag: def __init__(self): self.model = Model() self.fzf = FzfPrompt() def manage_tag(self, tid=None): if tid: tag = self.model.get_tag(tid) print(bcolors.HEADER + 'Managing tag: ' + tag['name'] + bcolors.ENDC) else: print(bcolors.HEADER + 'Managing tags' + bcolors.ENDC) tagsData = self.model.get_all_tags() if not tagsData: self.add_tag() tagsData = self.model.get_all_tags() tags = bcolors.WARNING for t in tagsData: tags += t['name'] + ' ' print(tags + bcolors.ENDC) self.manage_tag_menu(tid) def manage_tag_menu(self, tid=None): menu = input(bcolors.OKBLUE + '~tag: ' + bcolors.OKGREEN + 'What you want to do? (?/+-&