Ejemplo n.º 1
0
def run():
    # we throw this one away, real parsing happens later
    # this is just for getting a debug flag for verbose logging.
    # to be extra sneaky, we add a --debug to the REAL parsers so it shows up in help
    # but we don't touch it there :P
    bootstrap_parser = Argparser(add_help=False)
    bootstrap_parser.add_argument('--debug', action='store_true')
    args, argv = bootstrap_parser.parse_known_args()
    sys.argv = [sys.argv[0]] + argv

    if args.debug:
        logging.basicConfig(level=logging.DEBUG)
    else:
        logging.basicConfig()
    sys.exit(Aminator(debug=args.debug).aminate())
Ejemplo n.º 2
0
def run():
    # we throw this one away, real parsing happens later
    # this is just for getting a debug flag for verbose logging.
    # to be extra sneaky, we add a --debug to the REAL parsers so it shows up in help
    # but we don't touch it there :P
    bootstrap_parser = Argparser(add_help=False)
    bootstrap_parser.add_argument('--debug', action='store_true')
    bootstrap_parser.add_argument('-e', "--environment", dest="env")
    args, argv = bootstrap_parser.parse_known_args()
    sys.argv = [sys.argv[0]] + argv
    # add -e argument back argv for when we parse the args again
    if args.env:
        sys.argv.extend(["-e",args.env])

    if args.debug:
        logging.basicConfig(level=logging.DEBUG)
    else:
        logging.basicConfig()
    sys.exit(Aminator(debug=args.debug, envname=args.env).aminate())
Ejemplo n.º 3
0
def run():
    import os
    # we throw this one away, real parsing happens later
    # this is just for getting a debug flag for verbose logging.
    # to be extra sneaky, we add a --debug to the REAL parsers so it shows up in help
    # but we don't touch it there :P
    bootstrap_parser = Argparser(add_help=False)
    bootstrap_parser.add_argument('--debug', action='store_true')
    bootstrap_parser.add_argument('-e', "--environment", dest="env")
    args, argv = bootstrap_parser.parse_known_args()
    sys.argv = [sys.argv[0]] + argv
    # add -e argument back argv for when we parse the args again
    if args.env:
        sys.argv.extend(["-e", args.env])
        os.environ["AMINATOR_ENVIRONMENT"] = args.env

    if args.debug:
        logging.basicConfig(level=logging.DEBUG)
    else:
        logging.basicConfig()
    sys.exit(Aminator(debug=args.debug, envname=args.env).aminate())