equal
deleted
inserted
replaced
21 from cubicweb import _ |
21 from cubicweb import _ |
22 |
22 |
23 import copy |
23 import copy |
24 from datetime import timedelta |
24 from datetime import timedelta |
25 |
25 |
|
26 import six |
26 from logilab.mtconverter import xml_escape |
27 from logilab.mtconverter import xml_escape |
27 from logilab.common.date import todatetime |
28 from logilab.common.date import todatetime |
28 |
29 |
29 from cubicweb.utils import json_dumps, make_uid |
30 from cubicweb.utils import json_dumps, make_uid |
30 from cubicweb.predicates import adaptable |
31 from cubicweb.predicates import adaptable |
98 if ical_task.start: |
99 if ical_task.start: |
99 elt.add('dtstart').value = ical_task.start |
100 elt.add('dtstart').value = ical_task.start |
100 if ical_task.stop: |
101 if ical_task.stop: |
101 elt.add(stop_kw).value = ical_task.stop |
102 elt.add(stop_kw).value = ical_task.stop |
102 |
103 |
103 buff = ical.serialize() |
104 buff = six.ensure_str(ical.serialize(), encoding=self._cw.encoding) |
104 if not isinstance(buff, unicode): |
|
105 buff = unicode(buff, self._cw.encoding) |
|
106 self.w(buff) |
105 self.w(buff) |
107 |
106 |
108 except ImportError: |
107 except ImportError: |
109 pass |
108 pass |
110 |
109 |