def get_hash(config): config = reducedict(config, KEYS) h = Hasher() h.hashdict(config) h.hashfiletime(BIN) h.hashfiletime(config['filename']) return config, h.hexdigest()
def plan(config, executor): if 'nprofile' in config: return config['nprofile'] = True parsing.length(config) rconfig = reducedict(config, KEYS) h = Hasher() h.hashdict(rconfig) h.hashfiletime(BIN) hash = h.hexdigest() target = parsing.derive_filename(config, hash, 'nprofile') config[OUTPUTKEY] = target config[JSONOUTPUTKEY] = target + '.json' jobs = enqueue(_nprofile, executor, rconfig, target) enqueue(_nprofile_to_json, executor, {OUTPUTKEY: target}, config[JSONOUTPUTKEY], after=jobs) return jobs