X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/ddc0c0cc460e471eca8c067b0748976e042a7607..7f66ed3ea23e33750c43bf4abc6092a6e2c5a584:/tasklib/task.py?ds=sidebyside 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())