Merge "Remove parenthesis from gerrit fullname"

This commit is contained in:
Jenkins
2016-09-13 16:16:11 +00:00
committed by Gerrit Code Review

View File

@@ -24,6 +24,7 @@ import subprocess
import time
import urllib
import yaml
import re
# Per election constants
@@ -86,6 +87,11 @@ def get_fullname(filepath):
url = '%s/accounts/%s' % (GERRIT_BASE, email)
fullname = gerrit_query(url)['name']
# Remove parenthesis content
fullname = re.sub(r"\([^)]*\)", "", fullname)
# Strip double space and trailing spaces
fullname = re.sub(r" ", " ", fullname).strip()
# Return capitalized name
return u" ".join(map(unicode.capitalize, fullname.split()))