Beispiel #1
0
        "date to reset the pipeline to. Format 'YYYY-mm-dd' e.g. 2016-02-17. Interpreted in UTC, so 2016-02-17 will reset the pipeline to 2016-02-16T16:00:00-08:00 in the pacific time zone"
    )
    parser.add_argument(
        "-n",
        "--dry_run",
        action="store_true",
        default=False,
        help="do everything except actually perform the operations")

    args = parser.parse_args()
    print args

    # Handle the first row in the table
    if args.date is None:
        if args.all:
            epr.reset_all_users_to_start(args.dry_run)
        else:
            user_list = _get_user_list(args)
            logging.info("received list with %s users" % user_list)
            logging.info("first few entries are %s" % user_list[0:5])
            for user_id in user_list:
                logging.info("resetting user %s to start" % user_id)
                epr.reset_user_to_start(user_id, args.dry_run)
    else:
        # Handle the second row in the table
        day_dt = arrow.get(args.date, "YYYY-MM-DD")
        logging.debug("day_dt is %s" % day_dt)
        day_ts = day_dt.timestamp
        logging.debug("day_ts is %s" % day_ts)
        user_list = _get_user_list(args)
        logging.info("received list with %s users" % user_list)
    group.add_argument("-u", "--user_list", nargs='+',
        help="user ids to reset the pipeline for")
    group.add_argument("-e", "--email_list", nargs='+',
        help="email addresses to reset the pipeline for")
    parser.add_argument("-d", "--date",
        help="date to reset the pipeline to. Format 'YYYY-mm-dd' e.g. 2016-02-17. Interpreted in UTC, so 2016-02-17 will reset the pipeline to 2016-02-16T16:00:00-08:00 in the pacific time zone")
    parser.add_argument("-n", "--dry_run", action="store_true", default=False,
                        help="do everything except actually perform the operations")

    args = parser.parse_args()
    print(args)

    # Handle the first row in the table
    if args.date is None:
        if args.all:
            epr.reset_all_users_to_start(args.dry_run)
        else:
            user_list = _get_user_list(args)
            logging.info("received list with %s users" % user_list)
            logging.info("first few entries are %s" % user_list[0:5])
            for user_id in user_list:
                logging.info("resetting user %s to start" % user_id)
                epr.reset_user_to_start(user_id, args.dry_run)
    else:
    # Handle the second row in the table
        day_dt = arrow.get(args.date, "YYYY-MM-DD")
        logging.debug("day_dt is %s" % day_dt)
        day_ts = day_dt.timestamp
        logging.debug("day_ts is %s" % day_ts)
        user_list = _get_user_list(args)
        logging.info("received list with %s users" % user_list)