From: Tomas Babej Date: Sun, 11 Jan 2015 21:23:07 +0000 (+0100) Subject: Task: Do not escape empty values in quotes when formatting by default X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/bce4eac56c1173228b0d9d443978be21e4a26709?ds=inline;hp=--cc Task: Do not escape empty values in quotes when formatting by default --- bce4eac56c1173228b0d9d443978be21e4a26709 diff --git a/tasklib/task.py b/tasklib/task.py index 6392b9e..b6c3d09 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -372,8 +372,11 @@ class Task(TaskResource): def add_field(field): # Add the output of format_field method to args list (defaults to - # field:value) - format_default = lambda k: "{0}:'{1}'".format(k, self._data[k] or '') + # field:'value') + format_default = lambda k: "{0}:{1}".format(k, + "'{0}'".format(self._data[k]) + if self._data[k] is not None + else '') format_func = getattr(self, 'format_{0}'.format(field), lambda: format_default(field)) args.append(format_func())