diff options
-rwxr-xr-x | git-identity-map.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/git-identity-map.py b/git-identity-map.py index c83a744..fd87158 100755 --- a/git-identity-map.py +++ b/git-identity-map.py @@ -8,6 +8,11 @@ import xml.etree.ElementTree as ET # Python 2.5 import sys +def produce_line(svn_nick, realname, gentoo_nick): + line = '%s = %s <%s@gentoo.org>' % (svn_nick, realname, gentoo_nick) + print(line.encode('utf-8')) + + def main(args): if len(args) != 2: print('USAGE: %s GENTOO/xml/htdocs/proj/en/devrel/roll-call/userinfo.xml' % args[0]) @@ -20,12 +25,11 @@ def main(args): return 1 for user in userlist.findall('user'): - nick = user.attrib['username'] + svn_nick = user.attrib['username'] location = user.find('location') realname = user.find('realname').attrib['fullname'].strip() - line = '%s = %s <%s@gentoo.org>' % (nick, realname, nick) - print(line.encode('utf-8')) + produce_line(svn_nick, realname, svn_nick) return 0 |