Skip to content

Commit

Permalink
Present args correctly to the taskwarrior parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Sep 19, 2014
1 parent 6817eb0 commit 4e11ad0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions taskw/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def encode_task_experimental(task):
task[k] = encode_task_value(task[k])

# Then, format it as a string
return "%s\n" % " ".join([
return [
"%s:\"%s\"" % (k, v)
for k, v in sorted(task.items(), key=itemgetter(0))
])
]


def encode_task(task):
Expand Down
6 changes: 3 additions & 3 deletions taskw/warrior.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def task_add(self, description, tags=None, **kw):

stdout, stderr = self._execute(
'add',
taskw.utils.encode_task_experimental(task),
*taskw.utils.encode_task_experimental(task)
)

# However, in 2.4 and later, you cannot specify whatever uuid you want
Expand Down Expand Up @@ -771,8 +771,8 @@ def task_update(self, task):
modification = taskw.utils.encode_task_experimental(task_to_modify)
# Only try to modify the task if there are changes to post here
# (changes *might* just be in annotations).
if modification.strip():
self._execute(task_uuid, 'modify', modification)
if modification:
self._execute(task_uuid, 'modify', *modification)

# If there are no existing annotations, add the new ones
if legacy or annotations_to_delete or annotations_to_create:
Expand Down

0 comments on commit 4e11ad0

Please sign in to comment.