Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'netrender/client.py')
-rw-r--r--netrender/client.py20
1 files changed, 4 insertions, 16 deletions
diff --git a/netrender/client.py b/netrender/client.py
index 8c5499b6..6c11e82a 100644
--- a/netrender/client.py
+++ b/netrender/client.py
@@ -243,14 +243,8 @@ def sendJobBaking(conn, scene, can_save = True):
# if not ACCEPTED (but not processed), send files
if response.status == http.client.ACCEPTED:
for rfile in job.files:
- f = open(rfile.filepath, "rb")
- with ConnectionContext():
- conn.request("PUT", fileURL(job_id, rfile.index), f)
- f.close()
- response = conn.getresponse()
- response.read()
-
- # server will reply with ACCEPTED until all files are found
+ sendFile(conn, fileURL(job_id, rfile.index), rfile.filepath)
+ # server will reply with ACCEPTED until all files are found
return job_id
@@ -333,14 +327,8 @@ def sendJobBlender(conn, scene, anim = False, can_save = True):
# if not ACCEPTED (but not processed), send files
if response.status == http.client.ACCEPTED:
for rfile in job.files:
- f = open(rfile.filepath, "rb")
- with ConnectionContext():
- conn.request("PUT", fileURL(job_id, rfile.index), f)
- f.close()
- response = conn.getresponse()
- response.read()
-
- # server will reply with ACCEPTED until all files are found
+ sendFile(conn, fileURL(job_id, rfile.index), rfile.filepath)
+ # server will reply with ACCEPTED until all files are found
return job_id