comparison sat/plugins/plugin_xep_0234.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 282d1314d574
children 56f94936df1e
comparison
equal deleted inserted replaced
2611:c180ca699e72 2612:3e4e78de9cca
24 from sat.core import exceptions 24 from sat.core import exceptions
25 from wokkel import disco, iwokkel 25 from wokkel import disco, iwokkel
26 from zope.interface import implements 26 from zope.interface import implements
27 from sat.tools import utils 27 from sat.tools import utils
28 from sat.tools import stream 28 from sat.tools import stream
29 from sat.tools.common import date_utils
29 import os.path 30 import os.path
30 from twisted.words.xish import domish 31 from twisted.words.xish import domish
31 from twisted.words.protocols.jabber import jid 32 from twisted.words.protocols.jabber import jid
32 from twisted.python import failure 33 from twisted.python import failure
33 from twisted.words.protocols.jabber.xmlstream import XMPPHandler 34 from twisted.words.protocols.jabber.xmlstream import XMPPHandler
208 file_data[u'size'] = int(unicode(next(file_elt.elements(NS_JINGLE_FT, u'size')))) 209 file_data[u'size'] = int(unicode(next(file_elt.elements(NS_JINGLE_FT, u'size'))))
209 except StopIteration: 210 except StopIteration:
210 pass 211 pass
211 212
212 try: 213 try:
213 file_data[u'modified'] = utils.date_parse(next(file_elt.elements(NS_JINGLE_FT, u'date'))) 214 file_data[u'modified'] = date_utils.date_parse(next(file_elt.elements(NS_JINGLE_FT, u'date')))
214 except StopIteration: 215 except StopIteration:
215 pass 216 pass
216 217
217 try: 218 try:
218 range_elt = file_elt.elements(NS_JINGLE_FT, u'range').next() 219 range_elt = file_elt.elements(NS_JINGLE_FT, u'range').next()