comparison sat/plugins/plugin_exp_events.py @ 2612:3e4e78de9cca

tools (date_utils): moved date_parse to common.date_utils, because it can be used in frontends
author Goffi <goffi@goffi.org>
date Thu, 21 Jun 2018 01:21:44 +0200
parents 26edcf3a30eb
children 1cc88adb5142
comparison
equal deleted inserted replaced
2611:c180ca699e72 2612:3e4e78de9cca
22 from sat.core.constants import Const as C 22 from sat.core.constants import Const as C
23 from sat.core.log import getLogger 23 from sat.core.log import getLogger
24 log = getLogger(__name__) 24 log = getLogger(__name__)
25 from sat.tools import utils 25 from sat.tools import utils
26 from sat.tools.common import uri as uri_parse 26 from sat.tools.common import uri as uri_parse
27 from sat.tools.common import date_utils
27 from twisted.internet import defer 28 from twisted.internet import defer
28 from twisted.words.protocols.jabber import jid, error 29 from twisted.words.protocols.jabber import jid, error
29 from twisted.words.xish import domish 30 from twisted.words.xish import domish
30 from wokkel import pubsub 31 from wokkel import pubsub
31 32
109 event_elt = next(items[0].elements(NS_EVENT, u'event')) 110 event_elt = next(items[0].elements(NS_EVENT, u'event'))
110 except IndexError: 111 except IndexError:
111 raise exceptions.NotFound(_(u"No event with this id has been found")) 112 raise exceptions.NotFound(_(u"No event with this id has been found"))
112 113
113 try: 114 try:
114 timestamp = utils.date_parse(next(event_elt.elements(NS_EVENT, "date"))) 115 timestamp = date_utils.date_parse(next(event_elt.elements(NS_EVENT, "date")))
115 except StopIteration: 116 except StopIteration:
116 timestamp = -1 117 timestamp = -1
117 118
118 data = {} 119 data = {}
119 120