source: soft/build_system/build_system/repsys/tags/V1_6_13/RepSys/commands/authoremail.py @ 1

Last change on this file since 1 was 1, checked in by fasma, 12 years ago

Initial Import from Mandriva's soft revision 224062 and package revision 45733

File size: 680 bytes
Line 
1#!/usr/bin/python
2from RepSys import Error, config
3from RepSys.command import *
4import sys
5import getopt
6
7HELP = """\
8Usage: repsys authoremail [OPTIONS] AUTHOR
9
10Options:
11    -h      Show this message
12
13Examples:
14    repsys authoremail john
15"""
16
17def parse_options():
18    parser = OptionParser(help=HELP)
19    opts, args = parser.parse_args()
20    if len(args) != 1:
21        raise Error, "invalid arguments"
22    opts.author = args[0]
23    return opts
24
25def print_author_email(author):
26    email = config.get("users", author)
27    if not email:
28        raise Error, "author not found"
29    print email
30   
31def main():
32    do_command(parse_options, print_author_email)
33
34# vim:et:ts=4:sw=4
Note: See TracBrowser for help on using the repository browser.