From 4d8d40aea54ff14c36bff11c0889bf56c3df68c9 Mon Sep 17 00:00:00 2001 From: Nikolaos Kakouros Date: Fri, 24 Dec 2021 13:08:09 +0000 Subject: [PATCH] wip --- Dockerfile | 1 - taskwiki/main.py | 31 ++++++++++++++----------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 855cce568..fe40b3644 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,7 +69,6 @@ RUN apk add --no-cache \ make \ patchelf \ tzdata \ - xdg-utils \ xvfb-run RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime diff --git a/taskwiki/main.py b/taskwiki/main.py index 855a1dd7f..5c937b624 100644 --- a/taskwiki/main.py +++ b/taskwiki/main.py @@ -86,14 +86,6 @@ def __init__(self): if not self.tasks: print("No tasks selected.") - self.taskopen_notes_folder = ( - util.get_var("taskwiki_taskopen_notes_folder", default="~/tasknotes") - ) - - self.taskopen_notes_regex = ( - util.get_var("taskwiki_taskopen_notes_regex") or "Notes" - ) - @classmethod def save_action(cls, method, *args): cls.last_action = {'method': method, 'args': args} @@ -152,15 +144,20 @@ def open(self): @errors.pretty_exception_handler def note(self): for vimwikitask in self.tasks: - if self.taskopen_notes_regex not in [ - a["description"] for a in vimwikitask.task["annotations"] - ]: - self.annotate(self.taskopen_notes_regex) - - note_path = os.path.join(self.taskopen_notes_folder, - vimwikitask.task["uuid"] + ".md") - vim.command("edit " + note_path) - break # Add not to only one task + try: + _cmd = subprocess.check_output( + "taskopen", + "-n", + vimwikitask["id"], + stderr=subprocess.PIPE, + ) + except FileNotFoundError as e: + print(e.strerror) + except subprocess.CalledProcessError as e: + print(e.stderr) + + vim.command("edit " + _cmd.stdout) + break # Add note to only one task @errors.pretty_exception_handler def edit(self):