From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SBbc6-0006wN-Id for garchives@archives.gentoo.org; Sun, 25 Mar 2012 00:47:19 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB6A2E02DF; Sun, 25 Mar 2012 00:47:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B62B2E02DF for ; Sun, 25 Mar 2012 00:47:10 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ED63A1B4037 for ; Sun, 25 Mar 2012 00:47:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id B8E57E5403 for ; Sun, 25 Mar 2012 00:47:08 +0000 (UTC) From: "Sebastian Pipping" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Pipping" Message-ID: <1332636380.70c164c4cde357a6788c6f368685c16a46600a97.sping@gentoo> Subject: [gentoo-commits] proj/userinfo-scripts:master commit in: / X-VCS-Repository: proj/userinfo-scripts X-VCS-Files: git-identity-map.py X-VCS-Directories: / X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: 70c164c4cde357a6788c6f368685c16a46600a97 X-VCS-Branch: master Date: Sun, 25 Mar 2012 00:47:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 92dbe398-eae6-4868-bd52-d032c2319886 X-Archives-Hash: 74877ac80a3bc4b7ec8d944e7425e04e commit: 70c164c4cde357a6788c6f368685c16a46600a97 Author: Sebastian Pipping pipping org> AuthorDate: Sun Mar 25 00:46:20 2012 +0000 Commit: Sebastian Pipping gentoo org> CommitDate: Sun Mar 25 00:46:20 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/userinfo-scri= pts.git;a=3Dcommit;h=3D70c164c4 Add script to generate Git identity maps (for git-svn or svn2git) --- git-identity-map.py | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/git-identity-map.py b/git-identity-map.py new file mode 100755 index 0000000..c83a744 --- /dev/null +++ b/git-identity-map.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Written by Sebastian Pipping +# Licensed under GPL v2 or later + +from __future__ import print_function +import xml.etree.ElementTree as ET # Python 2.5 +import sys + + +def main(args): + if len(args) !=3D 2: + print('USAGE: %s GENTOO/xml/htdocs/proj/en/devrel/roll-call/userinfo.= xml' % args[0]) + return 1 + + try: + userlist =3D ET.parse(args[1]) + except IOError as e: + print(str(e), file=3Dsys.stderr) + return 1 + + for user in userlist.findall('user'): + nick =3D user.attrib['username'] + location =3D user.find('location') + realname =3D user.find('realname').attrib['fullname'].strip() + + line =3D '%s =3D %s <%s@gentoo.org>' % (nick, realname, nick) + print(line.encode('utf-8')) + + return 0 + + +if __name__ =3D=3D '__main__': + ret =3D main(sys.argv) + sys.exit(ret)