plugins schema, merge_requests, tickets*: factorisation
Dode common in plugins using schema have been factorised in pubsub schema plugin, and filters users in tickets handling have been renamed in a more generic way and put there too. "reporter*" fields in tickets have been renamed to "author*" as it is a more generic term which can be used elsewhere. The use of new utils.partial function make easy the creation of simple plugins using schema.
This commit is contained in:
parent
a979fce2fc
commit
3e76e826d0
1 changed files with 222 additions and 169 deletions
|
|
@ -72,13 +72,13 @@ class BugzillaParser(object):
|
|||
ticket['updated'] = utils.date_parse(bug.findtext('delta_ts'))
|
||||
ticket['title'] = bug.findtext('short_desc')
|
||||
reporter_elt = bug.find('reporter')
|
||||
ticket['reporter'] = reporter_elt.get('name')
|
||||
if ticket['reporter'] is None:
|
||||
ticket['author'] = reporter_elt.get('name')
|
||||
if ticket['author'] is None:
|
||||
if '@' in reporter_elt.text:
|
||||
ticket['reporter'] = reporter_elt.text[:reporter_elt.text.find('@')].title()
|
||||
ticket['author'] = reporter_elt.text[:reporter_elt.text.find('@')].title()
|
||||
else:
|
||||
ticket['reporter'] = u'no name'
|
||||
ticket['reporter_email'] = reporter_elt.text
|
||||
ticket['author'] = u'no name'
|
||||
ticket['author_email'] = reporter_elt.text
|
||||
assigned_to_elt = bug.find('assigned_to')
|
||||
ticket['assigned_to_name'] = assigned_to_elt.get('name')
|
||||
ticket['assigned_to_email'] = assigned_to_elt.text
|
||||
|
|
|
|||
Loading…
Reference in a new issue