Changeset View
Changeset View
Standalone View
Standalone View
netrender/master_html.py
| Context not available. | |||||
| tot_fluid += 1 | tot_fluid += 1 | ||||
| elif not file == job.files[0]: | elif not file == job.files[0]: | ||||
| tot_other += 1 | tot_other += 1 | ||||
| return tot_cache,tot_fluid,tot_other; | return tot_cache,tot_fluid,tot_other | ||||
| def get(handler): | def get(handler): | ||||
| def output(text): | def output(text): | ||||
| handler.wfile.write(bytes(text, encoding='utf8')) | handler.wfile.write(bytes(text, encoding='utf8')) | ||||
| Context not available. | |||||
| serializedJob["p_rule"] = handler.server.balancer.applyPriorities(job) | serializedJob["p_rule"] = handler.server.balancer.applyPriorities(job) | ||||
| serializedJob["e_rule"] = handler.server.balancer.applyExceptions(job) | serializedJob["e_rule"] = handler.server.balancer.applyExceptions(job) | ||||
| serializedJob["wait"] = int(time.time() - job.last_dispatched) if job.status != netrender.model.JOB_FINISHED else "N/A" | serializedJob["wait"] = int(time.time() - job.last_dispatched) if job.status != netrender.model.JOB_FINISHED else "N/A" | ||||
| serializedJob["length"] = len(job); | serializedJob["length"] = len(job) | ||||
| serializedJob["done"] = results[netrender.model.FRAME_DONE] | serializedJob["done"] = results[netrender.model.FRAME_DONE] | ||||
| serializedJob["dispatched"] = results[netrender.model.FRAME_DISPATCHED] | serializedJob["dispatched"] = results[netrender.model.FRAME_DISPATCHED] | ||||
| serializedJob["error"] = results[netrender.model.FRAME_ERROR] | serializedJob["error"] = results[netrender.model.FRAME_ERROR] | ||||
| Context not available. | |||||
| else: | else: | ||||
| serializedJob={"name":"invalid job"} | serializedJob={"name":"invalid job"} | ||||
| return serializedJob; | return serializedJob | ||||
| # return serialized files based on cumulative file_type | # return serialized files based on cumulative file_type | ||||
| # job_id: id of the job | # job_id: id of the job | ||||
| # message: serialized content | # message: serialized content | ||||
| Context not available. | |||||
| filedata["name"] = os.path.split(file.filepath)[1] | filedata["name"] = os.path.split(file.filepath)[1] | ||||
| if file.filepath.endswith(".bphys") and (file_type & CACHE_FILES): | if file.filepath.endswith(".bphys") and (file_type & CACHE_FILES): | ||||
| message.append(filedata); | message.append(filedata) | ||||
| continue | continue | ||||
| if file.filepath.endswith((".bobj.gz", ".bvel.gz")) and (file_type & FLUID_FILES): | if file.filepath.endswith((".bobj.gz", ".bvel.gz")) and (file_type & FLUID_FILES): | ||||
| message.append(filedata); | message.append(filedata) | ||||
| continue | continue | ||||
| if (not file == job.files[0]) and (file_type & OTHER_FILES) and (not file.filepath.endswith((".bobj.gz", ".bvel.gz"))) and not file.filepath.endswith(".bphys"): | if (not file == job.files[0]) and (file_type & OTHER_FILES) and (not file.filepath.endswith((".bobj.gz", ".bvel.gz"))) and not file.filepath.endswith(".bphys"): | ||||
| message.append(filedata); | message.append(filedata) | ||||
| continue | continue | ||||
| Context not available. | |||||
| elif handler.path.startswith("/html/cachefiles_"): | elif handler.path.startswith("/html/cachefiles_"): | ||||
| job_id = handler.path[17:] | job_id = handler.path[17:] | ||||
| message = [] | message = [] | ||||
| getFiles(job_id, message, CACHE_FILES); | getFiles(job_id, message, CACHE_FILES) | ||||
| sendjson(message) | sendjson(message) | ||||
| #return fluid cache files | #return fluid cache files | ||||
| elif handler.path.startswith("/html/fluidfiles_"): | elif handler.path.startswith("/html/fluidfiles_"): | ||||
| job_id = handler.path[17:] | job_id = handler.path[17:] | ||||
| message = [] | message = [] | ||||
| getFiles(job_id, message, FLUID_FILES); | getFiles(job_id, message, FLUID_FILES) | ||||
| sendjson(message) | sendjson(message) | ||||
| #return list of other files ( images, sequences ...) | #return list of other files ( images, sequences ...) | ||||
| Context not available. | |||||
| job_id = handler.path[17:] | job_id = handler.path[17:] | ||||
| message = [] | message = [] | ||||
| getFiles(job_id, message, OTHER_FILES); | getFiles(job_id, message, OTHER_FILES) | ||||
| sendjson(message) | sendjson(message) | ||||
| # return blend file info | # return blend file info | ||||
| elif handler.path.startswith("/html/blendfile_"): | elif handler.path.startswith("/html/blendfile_"): | ||||
| Context not available. | |||||