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 inspect_viewport(self): position = util.get_current_line_number() port = viewport.ViewPort.from_line(position, cache) if port.meta.get('visible') is False: cache.reset() cache.load_vwtasks() cache.load_tasks() template = ( "ViewPort inspection:\n" "--------------------\n" "Name: {0}\n" "Filter used: {1}\n" "Defaults used: {2}\n" "Ordering used: {3}\n" "Matching taskwarrior tasks: {4}\n" "Displayed tasks: {5}\n" "Tasks to be added: {6}\n" "Tasks to be deleted: {7}\n" ) if port is not None: # Load the tasks under the viewport port.load_tasks() to_add, to_del = port.get_tasks_to_add_and_del() # Fill in the interesting info in the template template_formatted = template.format( port.name, port.raw_filter, port.raw_defaults, port.sort, len(port.matching_tasks), len(port.tasks), ', '.join(map(unicode, to_add)), ', '.join(map(unicode, to_del)), ) # Show in the split lines = template_formatted.splitlines() util.show_in_split(lines, activate_cursorline=True)
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