From: Rob Golding Date: Thu, 15 Jan 2015 13:40:47 +0000 (+0000) Subject: Merge branch 'develop' into deserialized-data-dict X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/d4ee441b2352dd50f00363c1ccb123e25cbac248?ds=inline;hp=--cc Merge branch 'develop' into deserialized-data-dict Conflicts: tasklib/task.py --- d4ee441b2352dd50f00363c1ccb123e25cbac248 diff --cc tasklib/task.py index a739d25,b6c3d09..8513b14 --- a/tasklib/task.py +++ b/tasklib/task.py @@@ -369,11 -372,13 +369,14 @@@ 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, - "'{0}'".format(self._data[k]) - if self._data[k] is not None - else '') + # field:value) + serialized_value = self._serialize(field, self._data[field]) or '' - format_default = lambda: "{0}:'{1}'".format(field, serialized_value) ++ format_default = lambda: "{0}:{1}".format( ++ field, ++ "'{0}'".format(serialized_value) if serialized_value else '' ++ ) format_func = getattr(self, 'format_{0}'.format(field), - lambda: format_default(field)) + format_default) args.append(format_func()) # If we're modifying saved task, simply pass on all modified fields