diff options
author | Nicolas Vigier <boklm@mageia.org> | 2011-01-06 14:51:53 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2011-01-06 14:51:53 +0000 |
commit | d62a7f9774d9df9ce29e56dbecbab2f520fc3be5 (patch) | |
tree | b3350af8c7bd48ba75eafd2e8641ad1e278d8e4a /RepSys/commands/authoremail.py | |
download | mgarepo-d62a7f9774d9df9ce29e56dbecbab2f520fc3be5.tar mgarepo-d62a7f9774d9df9ce29e56dbecbab2f520fc3be5.tar.gz mgarepo-d62a7f9774d9df9ce29e56dbecbab2f520fc3be5.tar.bz2 mgarepo-d62a7f9774d9df9ce29e56dbecbab2f520fc3be5.tar.xz mgarepo-d62a7f9774d9df9ce29e56dbecbab2f520fc3be5.zip |
To avoid confusion, Mageia repsys fork is being renamed to mgarepo1.9
Diffstat (limited to 'RepSys/commands/authoremail.py')
-rw-r--r-- | RepSys/commands/authoremail.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/RepSys/commands/authoremail.py b/RepSys/commands/authoremail.py new file mode 100644 index 0000000..f5b8b70 --- /dev/null +++ b/RepSys/commands/authoremail.py @@ -0,0 +1,37 @@ +#!/usr/bin/python +from RepSys import Error, config +from RepSys.command import * +import sys +import getopt + +HELP = """\ +Usage: repsys authoremail [OPTIONS] AUTHOR + +Shows the e-mail of an SVN author. It is just a simple interface to access +the [authors] section of repsys.conf. + +Options: + -h Show this message + +Examples: + repsys authoremail john +""" + +def parse_options(): + parser = OptionParser(help=HELP) + opts, args = parser.parse_args() + if len(args) != 1: + raise Error, "invalid arguments" + opts.author = args[0] + return opts + +def print_author_email(author): + email = config.get("users", author) + if not email: + raise Error, "author not found" + print email + +def main(): + do_command(parse_options, print_author_email) + +# vim:et:ts=4:sw=4 |