tools (date_utils): moved date_parse to common.date_utils, because it can be used in frontends

This commit is contained in:
Goffi 2018-06-21 01:21:44 +02:00
commit 0242772939

View file

@ -26,7 +26,7 @@ from sat.core import exceptions
from twisted.internet import defer
import os.path
from lxml import etree
from sat.tools import utils
from sat.tools.common import date_utils
PLUGIN_INFO = {
@ -68,8 +68,8 @@ class BugzillaParser(object):
for bug in root.xpath('bug'):
ticket = {}
ticket['id'] = bug.findtext('bug_id')
ticket['created'] = utils.date_parse(bug.findtext('creation_ts'))
ticket['updated'] = utils.date_parse(bug.findtext('delta_ts'))
ticket['created'] = date_utils.date_parse(bug.findtext('creation_ts'))
ticket['updated'] = date_utils.date_parse(bug.findtext('delta_ts'))
ticket['title'] = bug.findtext('short_desc')
reporter_elt = bug.find('reporter')
ticket['author'] = reporter_elt.get('name')
@ -103,7 +103,7 @@ class BugzillaParser(object):
who = longdesc.find('who')
comment = {'id': longdesc.findtext('commentid'),
'author_email': who.text,
'published': utils.date_parse(longdesc.findtext('bug_when')),
'published': date_utils.date_parse(longdesc.findtext('bug_when')),
'author': who.get('name', who.text),
'content': longdesc.findtext('thetext')}
comments.append(comment)