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'),
'gpgweb': N_('GPG public key via HTTP'),
'nm': N_('NM, AM participation'),
'contrib': N_('Contribution information'),
},
'ssh': {
'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
[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
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
@ -100,6 +100,8 @@ gpgfinger.optional=true
gpgweb.pattern=http://db.debian.org/fetchkey.cgi?fingerprint=%(gpgfp)s
gpgweb.optional=true
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 functions

View File

@ -53,14 +53,39 @@ def _get_keyrings():
keyrings.sort()
return keyrings
def _parse_uid(uid):
"""
Parse a uid of the form 'Real Name <email@example.com>' into email
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 = {}
@ -107,19 +132,20 @@ def process_keyrings():
else:
continue
# Do stuff with 'uid'
uid, email = _parse_uid(uid)
if email:
if email.endswith('@debian.org'):
login = email[0:-len('@debian.org')]
_add_to_result('login:email:%s' % email, login)
_add_to_result('login:fpr:%s' % fpr, login)
_add_to_result('fpr:login:%s' % login, fpr)
_add_to_result('fpr:email:%s' % email, fpr)
_add_to_result('email:fpr:%s' % fpr, email)
if uid:
(uid, mail) = _parse_uid(uid)
if mail:
if mail.endswith('@debian.org'):
login = mail[0:-len('@debian.org')]
_add_to_result('login:email:%s' % mail, login)
_add_to_result('login:fpr:%s' % fpr, login)
_add_to_result('fpr:login:%s' % login, fpr)
_add_to_result('fpr:email:%s' % mail, fpr)
_add_to_result('email:fpr:%s' % fpr, mail)
if uid:
_add_to_result('name:fpr:%s' % fpr, uid)
if email:
_add_to_result('name:email:%s' % email, uid)
if mail:
_add_to_result('name:email:%s' % mail, uid)
retcode = proc.wait()
if retcode != 0:
logging.error("subprocess ended with return code %d", retcode)

View File

@ -50,9 +50,9 @@ copyright = u'2009-2013, Jan Dittberner'
# built documents.
#
# The short X.Y version.
version = '0.2.19'
version = '0.2.20'
# 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
# for a list of supported languages.

View File

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