Skip to content

Commit 4d8d40a

Browse files
committed
wip
1 parent cbb47c6 commit 4d8d40a

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ RUN apk add --no-cache \
6969
make \
7070
patchelf \
7171
tzdata \
72-
xdg-utils \
7372
xvfb-run
7473
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
7574

taskwiki/main.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ def __init__(self):
8686
if not self.tasks:
8787
print("No tasks selected.")
8888

89-
self.taskopen_notes_folder = (
90-
util.get_var("taskwiki_taskopen_notes_folder", default="~/tasknotes")
91-
)
92-
93-
self.taskopen_notes_regex = (
94-
util.get_var("taskwiki_taskopen_notes_regex") or "Notes"
95-
)
96-
9789
@classmethod
9890
def save_action(cls, method, *args):
9991
cls.last_action = {'method': method, 'args': args}
@@ -152,15 +144,20 @@ def open(self):
152144
@errors.pretty_exception_handler
153145
def note(self):
154146
for vimwikitask in self.tasks:
155-
if self.taskopen_notes_regex not in [
156-
a["description"] for a in vimwikitask.task["annotations"]
157-
]:
158-
self.annotate(self.taskopen_notes_regex)
159-
160-
note_path = os.path.join(self.taskopen_notes_folder,
161-
vimwikitask.task["uuid"] + ".md")
162-
vim.command("edit " + note_path)
163-
break # Add not to only one task
147+
try:
148+
_cmd = subprocess.check_output(
149+
"taskopen",
150+
"-n",
151+
vimwikitask["id"],
152+
stderr=subprocess.PIPE,
153+
)
154+
except FileNotFoundError as e:
155+
print(e.strerror)
156+
except subprocess.CalledProcessError as e:
157+
print(e.stderr)
158+
159+
vim.command("edit " + _cmd.stdout)
160+
break # Add note to only one task
164161

165162
@errors.pretty_exception_handler
166163
def edit(self):

0 commit comments

Comments
 (0)