X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/088fc620ec1921c3e9ee2dcf8385393b53306824..7ebc4edb8e4a986886bf624690f00d28517ee5b8:/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())