Merge branch 'release/0.2.20'

This commit is contained in:
Jan Dittberner 2013-11-20 17:47:55 +01:00
commit 2417abee4e
5 changed files with 47 additions and 18 deletions

View file

@ -109,6 +109,7 @@ developer name on all bug logs)'),
'gpgfinger': N_('GPG public key via finger'), 'gpgfinger': N_('GPG public key via finger'),
'gpgweb': N_('GPG public key via HTTP'), 'gpgweb': N_('GPG public key via HTTP'),
'nm': N_('NM, AM participation'), 'nm': N_('NM, AM participation'),
'contrib': N_('Contribution information'),
}, },
'ssh': { 'ssh': {
'label': N_('Information reachable via ssh (for Debian Members)'), 'label': N_('Information reachable via ssh (for Debian Members)'),

View file

@ -86,7 +86,7 @@ forum.pattern=http://forums.debian.net/memberlist.php?mode=viewprofile&u=%(forum
forum.optional=true forum.optional=true
[miscellaneous] [miscellaneous]
urls=debtags,links,planetname,planetuser,website,search,gpgfinger,gpgweb urls=debtags,links,planetname,planetuser,website,search,gpgfinger,gpgweb,contrib
debtags.pattern=http://debtags.debian.net/reports/maint/%(email)s debtags.pattern=http://debtags.debian.net/reports/maint/%(email)s
planetname.pattern=http://planet-search.debian.org/cgi-bin/search.cgi?terms=%%22%(name)s%%22 planetname.pattern=http://planet-search.debian.org/cgi-bin/search.cgi?terms=%%22%(name)s%%22
planetuser.pattern=http://planet-search.debian.org/cgi-bin/search.cgi?terms=%%22%(username)s%%22 planetuser.pattern=http://planet-search.debian.org/cgi-bin/search.cgi?terms=%%22%(username)s%%22
@ -100,6 +100,8 @@ gpgfinger.optional=true
gpgweb.pattern=http://db.debian.org/fetchkey.cgi?fingerprint=%(gpgfp)s gpgweb.pattern=http://db.debian.org/fetchkey.cgi?fingerprint=%(gpgfp)s
gpgweb.optional=true gpgweb.optional=true
nm.pattern=https://nm.debian.org/public/person/%(username)s nm.pattern=https://nm.debian.org/public/person/%(username)s
contrib.pattern=https://contributors.debian.org/contributors/contributor/%(aliothusername)s
contrib.optional=true
[ssh] [ssh]
# SSH functions # SSH functions

View file

@ -53,14 +53,39 @@ def _get_keyrings():
keyrings.sort() keyrings.sort()
return keyrings return keyrings
def _parse_uid(uid): def _parse_uid(uid):
""" """
Parse a uid of the form 'Real Name <email@example.com>' into email Parse a uid of the form 'Real Name <email@example.com>' into email
and realname parts. and realname parts.
""" """
(uid, mail) = email.utils.parseaddr(uid)
return (uid, mail) # First try with the Python library, but it doesn't always catch everything
(name, mail) = email.utils.parseaddr(uid)
if (not name) and (not mail):
logging.warning("malformed uid %s", uid)
if (not name) or (not mail):
logging.debug("strange uid %s: '%s' - <%s>", uid, name, mail)
# Try and do better than the python library
if not '@' in mail:
uid = uid.strip()
# First, strip comment
s = uid.find('(')
e = uid.find(')')
if s >= 0 and e >= 0:
uid = uid[:s] + uid[e + 1:]
s = uid.find('<')
e = uid.find('>')
mail = None
if s >= 0 and e >= 0:
mail = uid[s + 1:e]
uid = uid[:s] + uid[e + 1:]
uid = uid.strip()
if not mail and uid.find('@') >= 0:
mail, uid = uid, mail
name = uid
logging.debug("corrected: '%s' - <%s>", name, mail)
return (name, mail)
resultdict = {} resultdict = {}
@ -107,19 +132,20 @@ def process_keyrings():
else: else:
continue continue
# Do stuff with 'uid' # Do stuff with 'uid'
uid, email = _parse_uid(uid) if uid:
if email: (uid, mail) = _parse_uid(uid)
if email.endswith('@debian.org'): if mail:
login = email[0:-len('@debian.org')] if mail.endswith('@debian.org'):
_add_to_result('login:email:%s' % email, login) login = mail[0:-len('@debian.org')]
_add_to_result('login:fpr:%s' % fpr, login) _add_to_result('login:email:%s' % mail, login)
_add_to_result('fpr:login:%s' % login, fpr) _add_to_result('login:fpr:%s' % fpr, login)
_add_to_result('fpr:email:%s' % email, fpr) _add_to_result('fpr:login:%s' % login, fpr)
_add_to_result('email:fpr:%s' % fpr, email) _add_to_result('fpr:email:%s' % mail, fpr)
_add_to_result('email:fpr:%s' % fpr, mail)
if uid: if uid:
_add_to_result('name:fpr:%s' % fpr, uid) _add_to_result('name:fpr:%s' % fpr, uid)
if email: if mail:
_add_to_result('name:email:%s' % email, uid) _add_to_result('name:email:%s' % mail, uid)
retcode = proc.wait() retcode = proc.wait()
if retcode != 0: if retcode != 0:
logging.error("subprocess ended with return code %d", retcode) logging.error("subprocess ended with return code %d", retcode)

View file

@ -50,9 +50,9 @@ copyright = u'2009-2013, Jan Dittberner'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.2.19' version = '0.2.20'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.2.19' release = '0.2.20'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View file

@ -29,7 +29,7 @@ except ImportError:
setup( setup(
name='ddportfolioservice', name='ddportfolioservice',
version='0.2.19', version='0.2.20',
description='service to create DDPortfolio URLs', description='service to create DDPortfolio URLs',
long_description="""This is a service implementation that long_description="""This is a service implementation that
returns a set of personalized URLs as outlined in returns a set of personalized URLs as outlined in