forked from jan/debianmemberportfolio
Merge branch 'dm_support'
* dm_support: use unquoted email address for MIA lookup mark all patterns that require optional information as optional use email address for MIA pattern to catch non-DDs add support for automatic DM data lookup
This commit is contained in:
commit
95bc1f433d
5 changed files with 48 additions and 12 deletions
|
@ -2,7 +2,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# DDPortfolio service DD data builder
|
||||
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
|
||||
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
||||
#
|
||||
# This file is part of DDPortfolio service.
|
||||
#
|
||||
|
@ -20,8 +20,14 @@
|
|||
# License along with this program. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
"""This file contains code to build a representation of a person based
|
||||
on keyring data associated to a given email address."""
|
||||
from ddportfolioservice.model import keyfinder
|
||||
|
||||
TYPE_NO = 0
|
||||
TYPE_DM = 1
|
||||
TYPE_DD = 2
|
||||
|
||||
|
||||
def build_data(email_address):
|
||||
"""Build a DD data structure from a given email address."""
|
||||
|
@ -32,7 +38,9 @@ def build_data(email_address):
|
|||
('username', keyfinder.getLoginByEmail)]])
|
||||
fields['email'] = email_address
|
||||
if fields['username'] and fields['gpgfp'] and fields['name']:
|
||||
fields['isdd'] = 1
|
||||
fields['type'] = TYPE_DD
|
||||
elif fields['name'] and fields['gpgfp']:
|
||||
fields['type'] = TYPE_DM
|
||||
else:
|
||||
fields['isdd'] = 0
|
||||
fields['type'] = TYPE_NO
|
||||
return fields
|
||||
|
|
|
@ -54,6 +54,7 @@ patchtracker.pattern=http://patch-tracker.debian.org/email/%(email)s
|
|||
[upload]
|
||||
urls=keylog
|
||||
keylog.pattern=http://merkel.debian.org/~enrico/keylog/%(gpgfp)s.html
|
||||
keylog.optional=true
|
||||
|
||||
[lists]
|
||||
urls=dolists,adolists,gmane
|
||||
|
@ -69,13 +70,17 @@ gmane.pattern=http://search.gmane.org/?email=%(name)s&group=gmane.linux.debi
|
|||
[files]
|
||||
urls=people,alioth
|
||||
people.pattern=http://people.debian.org/~%(username)s/
|
||||
people.optional=true
|
||||
alioth.pattern=http://alioth.debian.org/~%(aliothusername)s/
|
||||
alioth.optional=true
|
||||
|
||||
[membership]
|
||||
urls=nm,db,alioth,wiki,forum
|
||||
nm.pattern=https://nm.debian.org/nmstatus.php?email=%(nonddemail)s
|
||||
db.pattern=http://db.debian.org/search.cgi?uid=%(username)s&dosearch=Search
|
||||
db.optional=true
|
||||
alioth.pattern=http://alioth.debian.org/users/%(aliothusername)s/
|
||||
alioth.optional=true
|
||||
wiki.pattern=http://wiki.debian.org/%(wikihomepage)s
|
||||
forum.pattern=http://forums.debian.net/memberlist.php?mode=viewprofile&u=%(forumsid)d
|
||||
forum.optional=true
|
||||
|
@ -93,12 +98,14 @@ urls=owndndoms,miainfo,groupinfo
|
|||
# owned *.debian.net domains
|
||||
owndndoms.pattern=ssh merkel.debian.org ldapsearch -u -x -H ldap://db.debian.org -b dc=debian,dc=org uid=%(username)s dnsZoneEntry
|
||||
owndndoms.type=ssh
|
||||
owndndoms.optional=true
|
||||
# MIA information
|
||||
miainfo.pattern=ssh merkel.debian.org /srv/qa.debian.org/mia/mia-query %(username)s
|
||||
miainfo.pattern=ssh merkel.debian.org /srv/qa.debian.org/mia/mia-query %(emailnoq)s
|
||||
miainfo.type=ssh
|
||||
# Group information
|
||||
groupinfo.pattern=ssh merkel.debian.org id %(username)s
|
||||
groupinfo.type=ssh
|
||||
groupinfo.optional=true
|
||||
|
||||
[ubuntu]
|
||||
urls=ubuntudiff
|
||||
|
|
|
@ -76,6 +76,7 @@ def build_urls(fields):
|
|||
if fpr:
|
||||
qfields['gpgfp'] = fpr[0]
|
||||
qfields['firstchar'] = fields['email'][0].encode('utf8')
|
||||
qfields['emailnoq'] = fields['email'].encode('utf8')
|
||||
for section in [section.strip() for section in \
|
||||
my_config.get('DEFAULT',
|
||||
'urlbuilder.sections').split(',')]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue