예제 #1
0
def checkArgs():

    # The arguments to be passed to this script.
    parser = utils.ArgumentParser()
    parser.add_argument("--jobname", help="Job name", required=True)
    parser.add_argument("--jobid", help="Job id", required=True, type=int)
    parser.add_argument("--ccid",
                        help="Command Center id",
                        required=True,
                        type=int)
    parser.add_argument("--phasename", help="Phase name", required=True)
    parser.add_argument("--jobdef", help="Job definition name", required=True)
    parser.add_argument("--lob", help="Line of business", required=True)
    parser.add_argument("--bor", help="Book of record", required=True)
    parser.add_argument("--jobdir", help="Job directory", required=True)
    parser.add_argument("--docidfile", help="Docid file name", required=True)
    parser.add_argument("--pdfurl",
                        help="Pdf retrieve base url",
                        required=True)
    parser.add_argument("--pdfpath", help="Pdf output path", required=True)

    try:
        args = vars(parser.parse_args())

    # Invalid argument.
    except argparse.ArgumentError, exc:
        sys.stderr.write("Invalid argument: " \
            + exc.argument.option_strings[0] + " " + exc.message + "\n")
        sys.exit(EXIT["System Error"])
예제 #2
0
def _run_or_rebot_from_cli(method, cliargs, usage, **argparser_config):
    LOGGER.register_file_logger()
    ap = utils.ArgumentParser(usage, get_full_version())
    try:
        options, datasources = \
            ap.parse_args(cliargs, argfile='argumentfile', unescape='escape',
                          help='help', version='version', check_args=True,
                          **argparser_config)
    except Information, msg:
        _exit(INFO_PRINTED, utils.unic(msg))
예제 #3
0
def checkArgs():

    # The arguments to be passed to this script.
    parser = utils.ArgumentParser()
    parser.add_argument("--jobid", help="Job id", required=True, type=int)
    parser.add_argument("--ccid", help="Command Center id", required=True, \
        type=int)
    parser.add_argument("--phasename", help="Phase name", required=True)

    try:
        args = vars(parser.parse_args())

    # Invalid argument.
    except argparse.ArgumentError, exc:
        sys.stderr.write("Invalid argument: " \
            + exc.argument.option_strings[0] + " " + exc.message + "\n")
        sys.exit(EXIT["System Error"])