Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nkakouros committed Dec 24, 2021
1 parent cbb47c6 commit 4d8d40a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
31 changes: 14 additions & 17 deletions taskwiki/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 4d8d40a

Please sign in to comment.