def reset_run(path): """Reset run info.""" logging.debug(u"reset_run for {}".format(path)) nbchksum = file_checksum(path) key = u'run:{}'.format(path) info = {'cur': 0, 'total': 0, 'nbchksum': nbchksum, 'start': None, 'elapsed': None, 'error': None} r.hmset(key, info)
def check_notebook_error_and_changed(path): """ Return notebook has error and changed after last run. """ nbchksum = file_checksum(path) key = u'run:{}'.format(path) if r.exists(key): error, prevchksum = r.hmget(key, 'error', 'nbchksum') return error != 'None', int(prevchksum) != nbchksum return False, False