Example #1
0
def do_manual(row_id, *args):
    row_id = int(row_id)
    extra = [arg.split('=', 1) for arg in args]
    logging.basicConfig(level=logging.DEBUG)
    sheet = open_sheet(CONFIG['sheet_id'], CONFIG['worksheet_title'],
                       CONFIG['creds'])
    row = get_rows(sheet)[row_id - 2]
    assert row['id'] == row_id
    for k, v in extra:
        if k not in row:
            raise Exception("bad override: {!r}".format(k))
        row[k] = v
    process(sheet, row, no_update_state=True)
Example #2
0
def do_manual(config, row_id, *args):
	with open(config) as f:
		config = json.load(f)
	row_id = int(row_id)
	extra = [arg.split('=', 1) for arg in args]
	logging.basicConfig(level=logging.DEBUG)
	sheet = open_sheet(config['sheet_id'], config['worksheet_title'], config['creds'])
	row = get_rows(sheet)[row_id-2]
	assert row['id'] == row_id
	for k, v in extra:
		if k not in row:
			raise Exception("bad override: {!r}".format(k))
		row[k] = v
	process(sheet, row, no_update_state=True)
Example #3
0
def get_rows_to_do(sheet, restart_in_progress=False, restart_errors=False, restart_all=False, ignore_not_ready=False):
	"""Return all rows that are ready to be cut. If restart_in_progress, also include rows listed
	as already being cut (this is useful for recovery if they were interrupted).
	If restart_errors, re-attempt any jobs that errored.
	If restart_all, restart everything."""
	logging.info("Checking for new jobs")
	for row in get_rows(sheet):
		if row['Ready for VST'] != 'Ready' and not ignore_not_ready:
			continue
		state = row['Processed by VST']
		if restart_all:
			yield row
		elif state == 'Not Yet' or not state:
			yield row
		elif restart_in_progress and state == 'In Progress':
			yield row
		elif restart_errors and state == 'Errored':
			yield row
Example #4
0
def get_rows_to_do(sheet,
                   restart_in_progress=False,
                   restart_errors=False,
                   restart_all=False):
    """Return all rows that are ready to be cut. If restart_in_progress, also include rows listed
	as already being cut (this is useful for recovery if they were interrupted).
	If restart_errors, re-attempt any jobs that errored.
	If restart_all, restart everything."""
    logging.info("Checking for new jobs")
    for row in get_rows(sheet):
        if row['Ready for VST'] != 'Ready':
            continue
        state = row['Processed by VST']
        if restart_all:
            yield row
        elif state == 'Not Yet' or not state:
            yield row
        elif restart_in_progress and state == 'In Progress':
            yield row
        elif restart_errors and state == 'Errored':
            yield row