diff options
author | 2012-05-06 17:30:39 +0200 | |
---|---|---|
committer | 2012-05-06 17:30:39 +0200 | |
commit | 272ee461a4e7edd3208107242c015360acbd4b3e (patch) | |
tree | 9eb34eb9becf74d7398d59cfad7f5ab618919e77 | |
parent | Add script to generate Git identity maps (for git-svn or svn2git) (diff) | |
download | userinfo-scripts-272ee461a4e7edd3208107242c015360acbd4b3e.tar.gz userinfo-scripts-272ee461a4e7edd3208107242c015360acbd4b3e.tar.bz2 userinfo-scripts-272ee461a4e7edd3208107242c015360acbd4b3e.zip |
Extract function produce_line()
-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 |