Beispiel #1
0
    def _load_cache(self, buffer_number):
        # Initialize the cache
        cache = TaskCache(buffer_number)
        self.caches[buffer_number] = cache

        # Check the necessary dependencies
        util.enforce_dependencies(cache)

        return cache
Beispiel #2
0
# Insert the taskwiki on the python path
BASE_DIR = vim.eval("s:plugin_path")
sys.path.insert(0, BASE_DIR)

from taskwiki import errors
from taskwiki import cache
from taskwiki import sort
from taskwiki import util
from taskwiki import viewport

# Initialize the cache
cache = cache.TaskCache()

# Check the necessary dependencies first
util.enforce_dependencies(cache)

class WholeBuffer(object):
    @staticmethod
    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()