diff --git a/corretor.py b/corretor.py index 21b0008..755fdd7 100644 --- a/corretor.py +++ b/corretor.py @@ -94,15 +94,23 @@ class Corretor: video_url = ('http://%s/corretor/uploads/%s/%s.webm' % (api_host, user_id, sign_name)) blend_downloaded = self.get_file(blend_url, blend_path) video_downloaded = self.get_file(video_url, video_path) - if (blend_downloaded and video_downloaded): - files_to_upload = [ ("video", (video_path, open(video_path,"rb"))), ("video", (blend_path, open(blend_path, "rb"))) ] - values = { "nome": sign_name, "selo": 5, "wikilibras": True, "overwrite": True } - r = requests.post(("%s/addsinal" % (api_dbhost)), files=files_to_upload, data=values) - pyutil.log("Request: " + str(r)) - pyutil.log(str(r.headers)) - shutil.rmtree(tmp_dir) + if (not blend_downloaded): + pyutil.log("blend file: %s was not downloaded" % (blend_url)) + elif (not video_downloaded): + pyutil.log("video file: %s was not downloaded" % (video_url)) else: - pyutil.log("files: %s or %s was not downloaded" % (blend_url, video_url)) + files_to_upload = [ + ("video", (video_path, open(video_path,"rb"))), + ("video", (blend_path, open(blend_path, "rb"))) + ] + body = { + "nome": sign_name, + "idTask": task_id, + "selo": 5 + } + r = requests.post(("%s/updatesinal" % (api_dbhost)), files=files_to_upload, data=body) + pyutil.log(r.text) + shutil.rmtree(tmp_dir) result_msg = self.__close_task(project_id, task_id) else: result_msg = "The task with ID=" + str(task_id) + " didn't reach the agreement number yet." diff --git a/settings_local.py.tmpl b/settings_local.py.tmpl index f1eb6f8..db5b43b 100644 --- a/settings_local.py.tmpl +++ b/settings_local.py.tmpl @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- + # Corretor Server Configuration SERVER_HOST = "localhost" SERVER_PORT = 8001 @@ -14,7 +15,7 @@ APACHE_STATIC_FILES_ENDPOINT = "/corretor" # PyBossa Configuration PYBOSSA_APP_NAME = "Corretor de Sinais" -PYBOSSA_APP_SHORT_NAME = "corretor_sinais" +PYBOSSA_APP_SHORT_NAME = "corretor_sinais" PYBOSSA_APP_DESCRIPTION = "Esse projeto ajudará a comunidade a melhorar sinais com movimentos complexos." PYBOSSA_ENDPOINT = "http://localhost/pybossa" PYBOSSA_API_KEY = "my-api-key" \ No newline at end of file -- libgit2 0.21.2