Commit 5ff89612ec8b62a9a6aec4dc7bf18f3eccc18c62

Authored by André Araújo
1 parent 646550db
Exists in master

Corrige python InsecurePlatformWarning

.gitignore
... ... @@ -2,7 +2,8 @@
2 2 *~
3 3 !.gitignore
4 4 !.gitempty
  5 +*.bak
  6 +*.json
5 7 *.log
6 8 *.pyc
7   -*.json
8   -env/
9 9 \ No newline at end of file
  10 +env/
... ...
Makefile
... ... @@ -4,15 +4,9 @@ TASKMGR_INIT = ${TASKMGR_DIR}/${TASKMGR_INIT_SCRIPT}
4 4 TASKMGR_ETC_INIT = /etc/init.d/${TASKMGR_INIT_SCRIPT}
5 5 TASKMGR_LOG = ${TASKMGR_DIR}/events.log
6 6 TASKMGR_REQUIREMENTS = ${TASKMGR_DIR}/requirements.txt
7   -TASKMGR_ENV = ${TASKMGR_DIR}/env
8   -TASKMGR_ENV_BIN = ${TASKMGR_ENV}/bin
9   -TASKMGR_ENV_ACTIVATE = ${TASKMGR_ENV_BIN}/activate
10   -TASKMGR_ENV_PYTHON = ${TASKMGR_ENV_BIN}/python
11   -TASKMGR_ENV_PIP = ${TASKMGR_ENV_BIN}/pip
12 7 TASKMGR_SETTINGS = ${TASKMGR_DIR}/settings_local.json
13 8 TASKMGR_SETTINGS_T = ${TASKMGR_SETTINGS}.template
14 9 TASKMGR_DATABASE = ${TASKMGR_DIR}/database.json
15   -TASKMGR_DATABASE_B = ${TASKMGR_PROJECT}.bak
16 10  
17 11 PATH_CORRETOR = $(subst $(shell basename "$(CURDIR)"),corretor_sinais,$(CURDIR))
18 12 PATH_VALIDADOR = $(subst $(shell basename "$(CURDIR)"),validador_sinais,$(CURDIR))
... ... @@ -28,6 +22,7 @@ build:
28 22 virtualenv ./env; \
29 23 . ./env/bin/activate; \
30 24 pip install -U pip; \
  25 + pip install -U ndg-httpsclient; \
31 26 pip install -r requirements.txt; \
32 27 )
33 28  
... ... @@ -63,7 +58,7 @@ uninstall: clean startup-disable
63 58 reset: clean
64 59 @ if [ -e "${TASKMGR_DATABASE}" ]; \
65 60 then \
66   - cat ${TASKMGR_DATABASE}; \
  61 + cat "${TASKMGR_DATABASE}"; \
67 62 echo ""; \
68 63 sudo rm -f "${TASKMGR_DATABASE}"; \
69 64 fi
... ...
main.py
... ... @@ -10,6 +10,7 @@ def main():
10 10 seconds = 10
11 11 json_data = None
12 12 task = None
  13 + pyutil.log("wikilibras task manager started")
13 14 while (task == None):
14 15 try:
15 16 json_data = task_manager.load_json(os.path.join(os.path.dirname(os.path.abspath('__file__')), "settings_local.json"))
... ... @@ -20,7 +21,7 @@ def main():
20 21 time.sleep(10)
21 22  
22 23 if (json_data != None and task != None):
23   - pyutil.log("wikilibras task manager started")
  24 + pyutil.log("wikilibras task manager checking for tasks")
24 25 while (True):
25 26 task.run(task.data["corretor"])
26 27 task.run(task.data["validador"])
... ...
task_manager.py
... ... @@ -202,7 +202,8 @@ class task_config():
202 202 if (self.get_file(video_ref_url, video_ref_out)):
203 203 pyutil.log("%s: creating task: %s version: %s stamp: %s" % (proj_name, j[u"nome"], j[u"version"], j[u"nomeSelo"]))
204 204 task = dict(sign_name = j[u"nome"], submission_date = pyutil.get_date_now())
205   - # pbclient.create_task(proj_id, task)
  205 + response_task = pbclient.create_task(proj_id, task)
  206 + pyutil.log(str(response_task))
206 207 else:
207 208 # nao foi possivel fazer o download do video de referencia (tarefa nao adicionada)
208 209 pyutil.log("%s: file not found: %s" % (proj_name, video_ref_url))
... ...
wikilibras-taskmgr
... ... @@ -9,8 +9,6 @@
9 9 # Description: Enable service provided by Wikilibras API at boot
10 10 ### END INIT INFO
11 11  
12   -# set -e
13   -
14 12 export PATH=$PATH:/usr/local/bin
15 13  
16 14 case "$1" in
... ...