populate wikihomepage in dddatabuilder.py

This commit is contained in:
Jan Dittberner 2010-06-12 00:13:04 +02:00
parent 4450a7ccfd
commit 4782b64f06

View file

@ -22,12 +22,15 @@
# #
"""This file contains code to build a representation of a person based """This file contains code to build a representation of a person based
on keyring data associated to a given email address.""" on keyring data associated to a given email address."""
import logging
from ddportfolioservice.model import keyfinder from ddportfolioservice.model import keyfinder
TYPE_NO = 0 TYPE_NO = 0
TYPE_DM = 1 TYPE_DM = 1
TYPE_DD = 2 TYPE_DD = 2
log = logging.getLogger(__name__)
def build_data(email_address): def build_data(email_address):
"""Build a DD data structure from a given email address.""" """Build a DD data structure from a given email address."""
@ -43,4 +46,9 @@ def build_data(email_address):
fields['type'] = TYPE_DM fields['type'] = TYPE_DM
else: else:
fields['type'] = TYPE_NO fields['type'] = TYPE_NO
if fields['name']:
log.debug('generate wikihomepage from name')
fields['wikihomepage'] = "".join(
[part.capitalize() for part in fields['name'].split()])
return fields return fields