How to use the tasklib.task.TaskWarrior function in tasklib

To help you get started, we’ve selected a few tasklib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github niknow / TaskArena / test_tarena.py View on Github external
def test_add(self):
        with self.runner.isolated_filesystem():
            dloc = '/cygdrive/c'+os.getcwd().replace('\\', '/')[2:] \
                   + '/local'
            tw = TaskWarrior(dloc)
            t = Task(tw)
            description = 'do dishes'
            t['description'] = description
            t.save()
            self.runner.invoke(cli, cmd_dummy_arena)
            self.runner.invoke(cli, cmd + ['add', 'foo', description])
            for uda in uda_config_list:
                tw.config.update({uda[0]: uda[1]})
            assert len(tw.tasks.filter('Arena:foo')) == 1
github niknow / TaskArena / test_tarena.py View on Github external
def test_remove(self):
        with self.runner.isolated_filesystem():
            dloc = '/cygdrive/c'+os.getcwd().replace('\\', '/')[2:] \
                   + '/local'
            tw = TaskWarrior(dloc)
            t = Task(tw)
            description = 'do dishes'
            t['description'] = description
            t.save()
            self.runner.invoke(cli, cmd_dummy_arena)
            self.runner.invoke(cli, cmd + ['add', 'foo', description])
            self.runner.invoke(cli, cmd + ['remove', 'foo', description])
            for uda in uda_config_list:
                tw.config.update({uda[0]: uda[1]})
            assert len(tw.tasks.filter('Arena:foo')) == 0
github niknow / TaskArena / test_tarena.py View on Github external
def test_sync(self):
        with self.runner.isolated_filesystem():
            cwd = '/cygdrive/c'+os.getcwd().replace('\\', '/')[2:]
            dloc = cwd + '/local'
            dremote = cwd + '/remote'
            tw_local = TaskWarrior(dloc)
            tw_remote = TaskWarrior(dremote)
            t = Task(tw_local)
            description = 'do dishes'
            t['description'] = description
            t.save()
            self.runner.invoke(cli, cmd_dummy_arena)
            self.runner.invoke(cli, cmd + ['add', 'foo', description])
            result = self.runner.invoke(cli, cmd + ['sync', 'foo'], input='a\n')
            assert len(tw_remote.tasks.filter()) == 1
github niknow / TaskArena / test_tarena.py View on Github external
def test_sync(self):
        with self.runner.isolated_filesystem():
            cwd = '/cygdrive/c'+os.getcwd().replace('\\', '/')[2:]
            dloc = cwd + '/local'
            dremote = cwd + '/remote'
            tw_local = TaskWarrior(dloc)
            tw_remote = TaskWarrior(dremote)
            t = Task(tw_local)
            description = 'do dishes'
            t['description'] = description
            t.save()
            self.runner.invoke(cli, cmd_dummy_arena)
            self.runner.invoke(cli, cmd + ['add', 'foo', description])
            result = self.runner.invoke(cli, cmd + ['sync', 'foo'], input='a\n')
            assert len(tw_remote.tasks.filter()) == 1
github niknow / TaskArena / tarenalib / arena.py View on Github external
def set_local_data(self, ldata):
        if ldata:
            self._local_data = ldata
            self.tw_local = EnhancedTaskWarrior(
                tlib.TaskWarrior(data_location=ldata),
                self)
github niknow / TaskArena / tarenalib / arena.py View on Github external
def set_remote_data(self, rdata):
        if rdata:
            self._remote_data = rdata
            self.tw_remote = EnhancedTaskWarrior(
                tlib.TaskWarrior(data_location=rdata),
                self)