summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2012-05-06 17:30:39 +0200
committerSebastian Pipping <sebastian@pipping.org>2012-05-06 17:30:39 +0200
commit272ee461a4e7edd3208107242c015360acbd4b3e (patch)
tree9eb34eb9becf74d7398d59cfad7f5ab618919e77
parentAdd script to generate Git identity maps (for git-svn or svn2git) (diff)
downloaduserinfo-scripts-272ee461a4e7edd3208107242c015360acbd4b3e.tar.gz
userinfo-scripts-272ee461a4e7edd3208107242c015360acbd4b3e.tar.bz2
userinfo-scripts-272ee461a4e7edd3208107242c015360acbd4b3e.zip
Extract function produce_line()
-rwxr-xr-xgit-identity-map.py10
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