@@ -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