X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/a40915e62131c8828305ec59ed630c63e6abecd7..4cfaeb89fcb189bc9563a59eb72ec3f7e6231bc0:/tasklib/task.py diff --git a/tasklib/task.py b/tasklib/task.py index f482f53..d386f82 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -99,6 +99,15 @@ class SerializingObject(object): def deserialize_wait(self, value): return self.timestamp_deserializer(value) + def serialize_annotations(self, value): + value = value if value is not None else [] + serialized_annotations = [annotation.export_data() for annotation in value] + + if serialized_annotations: + return '[' + ','.join(serialized_annotations) + ']' + else: + return '' + def deserialize_annotations(self, data): return [TaskAnnotation(self, d) for d in data] if data else []