Пример #1
0
    def __init__(self, buffer_number):
        # Determine defaults
        default_rc = util.get_var('taskwiki_taskrc_location') or '~/.taskrc'
        default_data = util.get_var('taskwiki_data_location') or None
        extra_warrior_defs = util.get_var('taskwiki_extra_warriors', {})
        #markup_syntax = vim.eval("vimwiki#vars#get_wikilocal('syntax')") or 'default'
        markup_syntax = 'markdown'

        # Validate markup choice and set it
        if markup_syntax in ["default", "markdown"]:
            self.markup_syntax = markup_syntax
        else:
            msg = "Unknown markup given: {}".format(markup_syntax)
            raise errors.TaskWikiException(msg)

        # Initialize all the subcomponents
        self.buffer = BufferProxy(buffer_number)
        self.completion = store.CompletionStore(self)
        self.task = store.TaskStore(self)
        self.presets = store.PresetStore(self)
        self.vwtask = store.VwtaskStore(self)
        self.viewport = store.ViewportStore(self)
        self.line = store.LineStore(self)
        self.warriors = store.WarriorStore(default_rc, default_data, extra_warrior_defs)
        self.buffer_has_authority = True
Пример #2
0
    def __init__(self, buffer_number):
        # Determine defaults
        default_rc = util.get_var('taskwiki_taskrc_location') or '~/.taskrc'
        default_data = util.get_var('taskwiki_data_location') or None
        extra_warrior_defs = util.get_var('taskwiki_extra_warriors', {})
        markup_syntax = util.get_var('taskwiki_markup_syntax') or 'default'

        # Handle bytes (vim returnes bytes for Python3)
        if six.PY3:
            default_rc = util.decode_bytes(default_rc)
            default_data = util.decode_bytes(default_data)
            extra_warrior_defs = util.decode_bytes(extra_warrior_defs)
            markup_syntax = util.decode_bytes(markup_syntax)

        # Validate markup choice and set it
        if markup_syntax in ["default", "markdown"]:
            self.markup_syntax = markup_syntax
        else:
            msg = "Unknown markup given: {}".format(markup_syntax)
            raise errors.TaskWikiException(msg)

        # Initialize all the subcomponents
        self.buffer = BufferProxy(buffer_number)
        self.task = store.TaskStore(self)
        self.presets = store.PresetStore(self)
        self.vwtask = store.VwtaskStore(self)
        self.viewport = store.ViewportStore(self)
        self.line = store.LineStore(self)
        self.warriors = store.WarriorStore(default_rc, default_data,
                                           extra_warrior_defs)
        self.buffer_has_authority = True
Пример #3
0
    def __init__(self):
        # Determine defaults
        default_rc = vim.vars.get('taskwiki_taskrc_location') or '~/.taskrc'
        default_data = vim.vars.get('taskwiki_data_location') or '~/.task'
        extra_warrior_defs = vim.vars.get('taskwiki_extra_warriors', {})

        self.buffer = BufferProxy(vim.current.buffer.number)
        self.task = store.TaskStore(self)
        self.vwtask = store.VwtaskStore(self)
        self.viewport = store.ViewportStore(self)
        self.line = store.LineStore(self)
        self.warriors = store.WarriorStore(default_rc, default_data,
                                           extra_warrior_defs)
        self.buffer_has_authority = True
Пример #4
0
    def __init__(self, buffer_number):
        # Determine defaults
        default_rc = util.get_var('taskwiki_taskrc_location') or '~/.taskrc'
        default_data = util.get_var('taskwiki_data_location') or None
        extra_warrior_defs = util.get_var('taskwiki_extra_warriors', {})

        # Handle bytes (vim returnes bytes for Python3)
        if six.PY3:
            default_rc = util.decode_bytes(default_rc)
            default_data = util.decode_bytes(default_data)
            extra_warrior_defs = util.decode_bytes(extra_warrior_defs)

        self.buffer = BufferProxy(buffer_number)
        self.task = store.TaskStore(self)
        self.vwtask = store.VwtaskStore(self)
        self.viewport = store.ViewportStore(self)
        self.line = store.LineStore(self)
        self.warriors = store.WarriorStore(default_rc, default_data, extra_warrior_defs)
        self.buffer_has_authority = True