X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/73cb96ecbbcaf43f05dc825a1017c2680b79f5a9..926c957fc04435bf2253a5748e5acec53a18ee86:/tasklib/serializing.py?ds=sidebyside diff --git a/tasklib/serializing.py b/tasklib/serializing.py index ed2881d..c177984 100644 --- a/tasklib/serializing.py +++ b/tasklib/serializing.py @@ -1,3 +1,13 @@ +import datetime +import importlib +import json +import pytz +import six +import tzlocal + +DATE_FORMAT = '%Y%m%dT%H%M%SZ' +local_zone = tzlocal.get_localzone() + class SerializingObject(object): """ Common ancestor for TaskResource & TaskWarriorFilter, since they both @@ -155,6 +165,8 @@ class SerializingObject(object): return serialized_annotations if serialized_annotations else '' def deserialize_annotations(self, data): + task_module = importlib.import_module('tasklib.task') + TaskAnnotation = getattr(task_module, 'TaskAnnotation') return [TaskAnnotation(self, d) for d in data] if data else [] def serialize_tags(self, tags):