# HG changeset patch # User Jeff Hammel # Date 1399827894 25200 # Node ID 7b5ffdcd25c0c9c5f4133454d996e61770c7f79d # Parent 84b400e78b640d4575f1c85676392f3c67e2866c work on parsing .ini diff -r 84b400e78b64 -r 7b5ffdcd25c0 autobot/config.py --- a/autobot/config.py Sun May 11 09:59:34 2014 -0700 +++ b/autobot/config.py Sun May 11 10:04:54 2014 -0700 @@ -4,10 +4,12 @@ tools for interpolating buildbot configuration """ +import argparse import sys from projects import factories from ConfigParser import RawConfigParser + class BuildbotIniConfig(object): """ class for getting a (for now, autobot-specific) @@ -85,10 +87,10 @@ def main(args=sys.argv[1:]): """parse the configuration, mostly for testing purposes""" - if len(args) != 1: - print 'Please provide an .ini file to try to parse' - sys.exit(1) - config = BuildbotIniConfig(args[0]) + + parser = argparse.ArgumentParser(description="parse autobot .ini configuration") + parser.add_argument('ini', help=".ini file to try to parse") + config = BuildbotIniConfig(parser.ini) if __name__ == '__main__': main() diff -r 84b400e78b64 -r 7b5ffdcd25c0 setup.py --- a/setup.py Sun May 11 09:59:34 2014 -0700 +++ b/setup.py Sun May 11 10:04:54 2014 -0700 @@ -34,5 +34,6 @@ create-autobot-master = autobot.template:create_master create-autobot-slave = autobot.template:create_slave create-autobot-project = autobot.template:create_project + parse-autobot-config = autobot.config:main """, )