mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-18 21:33:07 +02:00
completion: Fix compatibility with taskwarrior 2.4.4
This commit is contained in:
parent
6cedc13b58
commit
12d363df5e
2 changed files with 14 additions and 5 deletions
|
@ -1,6 +1,8 @@
|
|||
from functools import reduce, wraps
|
||||
import re
|
||||
|
||||
from tasklib import TaskWarrior
|
||||
|
||||
from taskwiki import constants
|
||||
|
||||
|
||||
|
@ -53,6 +55,9 @@ class Completion():
|
|||
|
||||
@cached_property
|
||||
def _tags(self):
|
||||
if self.tw.version < TaskWarrior.VERSION_2_4_5:
|
||||
return sorted(self.tw.execute_command(['_tags']))
|
||||
else:
|
||||
return sorted(set(
|
||||
tag
|
||||
for tags in self.tw.execute_command(['_unique', 'tag'])
|
||||
|
@ -60,6 +65,9 @@ class Completion():
|
|||
|
||||
@cached_property
|
||||
def _projects(self):
|
||||
if self.tw.version < TaskWarrior.VERSION_2_4_5:
|
||||
return sorted(self.tw.execute_command(['_projects']))
|
||||
else:
|
||||
return sorted(self.tw.execute_command(['_unique', 'project']))
|
||||
|
||||
def _complete_any(self, w):
|
||||
|
|
|
@ -5,6 +5,7 @@ from tests.base import IntegrationTest
|
|||
|
||||
class FakeTW():
|
||||
def __init__(self, projects=[], tags=[]):
|
||||
self.version = '2.5.1'
|
||||
self.projects = projects
|
||||
self.tags = tags
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue