def modify(self, modstring): # If no modstring was passed as argument, ask the user interactively if not modstring: with util.current_line_highlighted(): modstring = util.get_input("Enter modifications: ") # We might have two same tasks in the range, make sure we do not pass the # same uuid twice unique_tasks = set(vimwikitask.task['uuid'] for vimwikitask in self.tasks) uuids = list(unique_tasks) # Generate the arguments from the modstring args = util.tw_modstring_to_args(modstring) # Modify all tasks at once output = util.tw_execute_safely(self.tw, uuids + ['mod'] + args) # Update the touched tasks in buffer, if needed cache.load_tasks() cache.update_vwtasks_from_tasks() cache.update_vwtasks_in_buffer() # Output the feedback from TW if output: print(output[-1]) cache.buffer.push()
def modify(self, modstring): # If no modstring was passed as argument, ask the user interactively if not modstring: with util.current_line_highlighted(): modstring = util.get_input("Enter modifications: ") # We might have two same tasks in the range, make sure we do not pass the # same uuid twice unique_tasks = set(vimwikitask.task['uuid'] for vimwikitask in self.tasks) uuids = list(unique_tasks) # Generate the arguments from the modstring args = util.tw_modstring_to_args(modstring) # Modify all tasks at once output = util.tw_execute_safely(self.tw, uuids + ['mod'] + args) # Update the touched tasks in buffer, if needed cache.load_tasks() cache.update_vwtasks_from_tasks() cache.update_vwtasks_in_buffer() # Output the feedback from TW if output: print(output[-1])
def execute(self): if self.colorful: output = util.tw_execute_colorful(self.tw, self.full_args, allow_failure=False, maxwidth=self.maxwidth, maxheight=self.maxheight) else: output = util.tw_execute_safely(self.tw, self.full_args) util.show_in_split( output, size=self.size, name=self.split_name, vertical=self.vertical, activate_cursorline=self.cursorline, )
def execute(self): args = self.args + [self.command] + self.tw_extra_args if self.colorful: output = util.tw_execute_colorful(self.tw, args, allow_failure=False, maxwidth=self.maxwidth, maxheight=self.maxheight) else: output = util.tw_execute_safely(self.tw, args) util.show_in_split( output, name=self.split_name, vertical=self.vertical, activate_cursorline=self.cursorline, )
def info(self): for vimwikitask in self.tasks: out = util.tw_execute_safely(self.tw, [vimwikitask.uuid, 'info']) if out: util.show_in_split(out, name='info', activate_cursorline=True) break # Show only one task