Changeset View
Changeset View
Standalone View
Standalone View
netrender/slave.py
| Context not available. | |||||
| # thumbnail first | # thumbnail first | ||||
| if netsettings.use_slave_thumb: | if netsettings.use_slave_thumb: | ||||
| thumbname = thumbnail.generate(filename) | thumbname = thumbnail.generate(filename) | ||||
| if thumbname: | if thumbname: | ||||
| f = open(thumbname, 'rb') | sendFile(conn, "/thumb", thumbname, headers=headers) | ||||
| with ConnectionContext(): | |||||
| conn.request("PUT", "/thumb", f, headers=headers) | |||||
| f.close() | |||||
| responseStatus(conn) | |||||
| f = open(filename, 'rb') | reponse_status = sendFile(conn, "/render", filename, headers=headers) | ||||
| with ConnectionContext(): | if reponse_status == http.client.NO_CONTENT: | ||||
| conn.request("PUT", "/render", f, headers=headers) | |||||
| f.close() | |||||
| if responseStatus(conn) == http.client.NO_CONTENT: | |||||
| continue | continue | ||||
| elif job.subtype == netrender.model.JOB_SUB_BAKING: | elif job.subtype == netrender.model.JOB_SUB_BAKING: | ||||
| Context not available. | |||||
| headers["result-filename"] = result_filename | headers["result-filename"] = result_filename | ||||
| headers["job-finished"] = str(result_filepath == frame_results[-1]) | headers["job-finished"] = str(result_filepath == frame_results[-1]) | ||||
| f = open(result_filepath, 'rb') | response_status = sendFile(conn, "/result", result_filepath, headers=headers) | ||||
| with ConnectionContext(): | if response_status == http.client.NO_CONTENT: | ||||
| conn.request("PUT", "/result", f, headers=headers) | |||||
| f.close() | |||||
| if responseStatus(conn) == http.client.NO_CONTENT: | |||||
| continue | continue | ||||
| elif job.type == netrender.model.JOB_PROCESS: | elif job.type == netrender.model.JOB_PROCESS: | ||||
| Context not available. | |||||