Commit 9051b6974ec509386e34f037503c09ffa65b4c81
Exists in
master
Merge branch 'master' of https://gitlab.lavid.ufpb.br/wikilibras/wikilibrasV2
Showing
2 changed files
with
13 additions
and
5 deletions
Show diff stats
settings_local.py.tmpl
| ... | ... | @@ -14,7 +14,7 @@ APACHE_STATIC_FILES_ENDPOINT = "/wikilibras" |
| 14 | 14 | |
| 15 | 15 | # PyBossa Configuration |
| 16 | 16 | PYBOSSA_APP_NAME = "WikiLibras" |
| 17 | -PYBOSSA_APP_SHORT_NAME = "wikilibras" | |
| 17 | +PYBOSSA_APP_SHORT_NAME = "wikilibras" | |
| 18 | 18 | PYBOSSA_APP_DESCRIPTION = "Esse projeto possibilitará que voluntários contribuam na expansão de um dicionário de LIBRAS, desenvolvido para promover o inclusão e acessibilidade nos meios digitais atravé do VLIBRAS." |
| 19 | 19 | PYBOSSA_ENDPOINT = "http://localhost/pybossa" |
| 20 | 20 | PYBOSSA_API_KEY = "my-api-key" |
| 21 | 21 | \ No newline at end of file | ... | ... |
wikilibras.py
| ... | ... | @@ -69,7 +69,7 @@ class Wikilibras: |
| 69 | 69 | def update_project(self): |
| 70 | 70 | app_short_name = self.config['PYBOSSA_APP_SHORT_NAME'] |
| 71 | 71 | project = self.__find_project(app_short_name) |
| 72 | - #self.__create_tasks(project) | |
| 72 | + # self.__create_tasks(project) | |
| 73 | 73 | self.__update_project_info(project) |
| 74 | 74 | result_msg = "The project " + app_short_name + " was updated." |
| 75 | 75 | pyutil.log(result_msg) |
| ... | ... | @@ -124,9 +124,17 @@ class Wikilibras: |
| 124 | 124 | blend_downloaded = self.get_file(('%s/public/%s/%s.blend' % (api_host, user_id, sign_name)), blend_path) |
| 125 | 125 | video_downloaded = self.get_file(('%s/public/%s/%s.webm' % (api_host, user_id, sign_name)), video_path) |
| 126 | 126 | if (blend_downloaded and video_downloaded): |
| 127 | - files = [ ("video", (video_path, open(video_path,"rb"))), ("video", (blend_path, open(blend_path, "rb"))) ] | |
| 128 | - values = { "nome": sign_name, "selo": 1, "wikilibras": True, "overwrite": True } | |
| 129 | - r = requests.post(("%s/addsinal" % (api_dbhost)), files=files, data=values) | |
| 127 | + files = [ | |
| 128 | + ("video", (video_path, open(video_path,"rb"))), | |
| 129 | + ("video", (blend_path, open(blend_path, "rb"))) | |
| 130 | + ] | |
| 131 | + body = { | |
| 132 | + "nome": sign_name, | |
| 133 | + "idTask": task_id, | |
| 134 | + "selo": 1 | |
| 135 | + } | |
| 136 | + r = requests.post(("%s/updatesinal" % (api_dbhost)), files=files, data=body) | |
| 137 | + pyutil.log(r.text) | |
| 130 | 138 | shutil.rmtree(tmp_dir) |
| 131 | 139 | result_msg = self.__close_task(project_id, task_id) |
| 132 | 140 | else: | ... | ... |