7 arvados.job_setup.one_task_per_input_file(if_sequence=0, and_end_task=True)
9 this_job = arvados.current_job()
10 this_task = arvados.current_task()
11 this_task_input = this_task['parameters']['input']
13 if 'algorithm' in this_job['script_parameters']:
14 alg = this_job['script_parameters']
17 digestor = hashlib.new(alg)
19 input_stream = arvados.DataReader(this_task_input)
21 buf = input_stream.read(2**20)
26 hexdigest = digestor.hexdigest()
27 file_name = re.sub(r'^[^/]+/', '', this_task_input)
31 this_task.set_output("%s %s\n" % (hexdigest, file_name))