def main():
    if 'run' not in sys.argv and 'sample' not in sys.argv:
        print("no mode specified - use either 'run' or 'sample'")
        return 1

    parent = argparse.ArgumentParser(add_help=False)
    parent.add_argument('--test', action='store_true')
    p = argparse.ArgumentParser()
    subparsers = p.add_subparsers()

    run_parser = subparsers.add_parser('run', parents=[parent])
    run_parser.add_argument('run_id')
    run_parser.add_argument('--conversion_stats', nargs='?', default=None)
    run_parser.add_argument('--adapter_trim_file', nargs='?', default=None)
    run_parser.add_argument('--run_dir', help='e.g. jobs/<run_id>')
    run_parser.set_defaults(func=run_crawler)

    sample_parser = subparsers.add_parser('sample', parents=[parent])
    sample_parser.add_argument('project_id')
    sample_parser.add_argument('sample_id')
    sample_parser.add_argument('--output_fileset')
    sample_parser.add_argument('--input_dir')
    sample_parser.set_defaults(func=sample_crawler)

    args = p.parse_args()

    load_config()
    log_cfg.default_level = logging.DEBUG
    log_cfg.add_handler(logging.StreamHandler(stream=sys.stdout), logging.DEBUG)

    return args.func(args)
def main():
    a = argparser()
    a.add_argument('--run_name', type=str)
    args = a.parse_args()
    log_cfg.add_handler(FileHandler(args.log_file))
    action = CreateReagentForRun(args.step_uri, args.username, args.password, args.run_name)
    return action.run()
Exemplo n.º 3
0
    def __init__(self, step_uri, username, password, log_file=None):
        split_url = urlparse.urlsplit(step_uri)
        self.baseuri = '%s://%s' % (split_url.scheme, split_url.netloc)
        self.username = username
        self.password = password
        self.step_id = split_url.path.split('/')[-1]

        if log_file:
            logging_default.add_handler(FileHandler(log_file))
Exemplo n.º 4
0
def setup_dataset_logging(d):
    log_repo = cfg.query('logging', 'repo')
    if log_repo:
        repo_log = os.path.join(log_repo, d.name + '.log')
        log_cfg.add_handler(logging.FileHandler(repo_log, mode='a'), level=logging.INFO)

    log_cfg.add_handler(
        logging.FileHandler(os.path.join(cfg['jobs_dir'], d.name, 'analysis_driver.log'), mode='w'),
        level=logging.INFO
    )
    log_cfg.add_handler(
        logging.FileHandler(os.path.join(cfg['jobs_dir'], d.name, 'analysis_driver_debug.log'), mode='w'),
        level=logging.DEBUG
    )
def main():
    args = argparser().parse_args()
    log_cfg.add_handler(FileHandler(args.log_file))
    action = FindPlateToRoute(args.step_uri, args.username, args.password, args.log_file)
    return action.run()