Exemple #1
0
    def update_from_tw():
        """
        Updates all the incomplete tasks in the vimwiki file if the info from TW is different.
        """

        cache.load_tasks()
        cache.load_vwtasks()
        cache.update_vwtasks_from_tasks()
        cache.update_vwtasks_in_buffer()
        cache.evaluate_viewports()
Exemple #2
0
    def update_from_tw():
        """
        Updates all the incomplete tasks in the vimwiki file if the info from TW is different.
        """

        cache.load_tasks()
        cache.load_vwtasks()
        cache.update_vwtasks_from_tasks()
        cache.update_vwtasks_in_buffer()
        cache.evaluate_viewports()
Exemple #3
0
    def update_to_tw():
        """
        Updates all tasks that differ from their TaskWarrior representation.
        """

        cache.reset()
        cache.load_tasks()
        cache.load_vwtasks()
        cache.save_tasks()
        cache.update_vwtasks_in_buffer()
        cache.evaluate_viewports()
Exemple #4
0
    def update_to_tw():
        """
        Updates all tasks that differ from their TaskWarrior representation.
        """

        cache.reset()
        cache.load_tasks()
        cache.load_vwtasks()
        cache.save_tasks()
        cache.update_vwtasks_in_buffer()
        cache.evaluate_viewports()
Exemple #5
0
    def update_from_tw():
        """
        Updates all the incomplete tasks in the vimwiki file if the info from TW is different.
        """

        cache.reset()
        cache.load_tasks()
        cache.load_vwtasks(buffer_has_authority=False)
        cache.load_viewports()
        cache.update_vwtasks_from_tasks()
        cache.update_vwtasks_in_buffer()
        cache.evaluate_viewports()
        cache.buffer.push()
Exemple #6
0
    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)
Exemple #7
0
    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)