From 5ff89612ec8b62a9a6aec4dc7bf18f3eccc18c62 Mon Sep 17 00:00:00 2001 From: André Araújo Date: Mon, 4 Jul 2016 14:47:48 -0300 Subject: [PATCH] Corrige python InsecurePlatformWarning --- .gitignore | 5 +++-- Makefile | 9 ++------- main.py | 3 ++- task_manager.py | 3 ++- wikilibras-taskmgr | 2 -- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 7bfa451..c6be291 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,8 @@ *~ !.gitignore !.gitempty +*.bak +*.json *.log *.pyc -*.json -env/ \ No newline at end of file +env/ diff --git a/Makefile b/Makefile index 21be5b3..1ac76b8 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,9 @@ TASKMGR_INIT = ${TASKMGR_DIR}/${TASKMGR_INIT_SCRIPT} TASKMGR_ETC_INIT = /etc/init.d/${TASKMGR_INIT_SCRIPT} TASKMGR_LOG = ${TASKMGR_DIR}/events.log TASKMGR_REQUIREMENTS = ${TASKMGR_DIR}/requirements.txt -TASKMGR_ENV = ${TASKMGR_DIR}/env -TASKMGR_ENV_BIN = ${TASKMGR_ENV}/bin -TASKMGR_ENV_ACTIVATE = ${TASKMGR_ENV_BIN}/activate -TASKMGR_ENV_PYTHON = ${TASKMGR_ENV_BIN}/python -TASKMGR_ENV_PIP = ${TASKMGR_ENV_BIN}/pip TASKMGR_SETTINGS = ${TASKMGR_DIR}/settings_local.json TASKMGR_SETTINGS_T = ${TASKMGR_SETTINGS}.template TASKMGR_DATABASE = ${TASKMGR_DIR}/database.json -TASKMGR_DATABASE_B = ${TASKMGR_PROJECT}.bak PATH_CORRETOR = $(subst $(shell basename "$(CURDIR)"),corretor_sinais,$(CURDIR)) PATH_VALIDADOR = $(subst $(shell basename "$(CURDIR)"),validador_sinais,$(CURDIR)) @@ -28,6 +22,7 @@ build: virtualenv ./env; \ . ./env/bin/activate; \ pip install -U pip; \ + pip install -U ndg-httpsclient; \ pip install -r requirements.txt; \ ) @@ -63,7 +58,7 @@ uninstall: clean startup-disable reset: clean @ if [ -e "${TASKMGR_DATABASE}" ]; \ then \ - cat ${TASKMGR_DATABASE}; \ + cat "${TASKMGR_DATABASE}"; \ echo ""; \ sudo rm -f "${TASKMGR_DATABASE}"; \ fi diff --git a/main.py b/main.py index 5bbf2c3..7aabec9 100644 --- a/main.py +++ b/main.py @@ -10,6 +10,7 @@ def main(): seconds = 10 json_data = None task = None + pyutil.log("wikilibras task manager started") while (task == None): try: 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(): time.sleep(10) if (json_data != None and task != None): - pyutil.log("wikilibras task manager started") + pyutil.log("wikilibras task manager checking for tasks") while (True): task.run(task.data["corretor"]) task.run(task.data["validador"]) diff --git a/task_manager.py b/task_manager.py index 0d3c523..5e6ca3a 100644 --- a/task_manager.py +++ b/task_manager.py @@ -202,7 +202,8 @@ class task_config(): if (self.get_file(video_ref_url, video_ref_out)): pyutil.log("%s: creating task: %s version: %s stamp: %s" % (proj_name, j[u"nome"], j[u"version"], j[u"nomeSelo"])) task = dict(sign_name = j[u"nome"], submission_date = pyutil.get_date_now()) - # pbclient.create_task(proj_id, task) + response_task = pbclient.create_task(proj_id, task) + pyutil.log(str(response_task)) else: # nao foi possivel fazer o download do video de referencia (tarefa nao adicionada) pyutil.log("%s: file not found: %s" % (proj_name, video_ref_url)) diff --git a/wikilibras-taskmgr b/wikilibras-taskmgr index b653dad..6c851ff 100644 --- a/wikilibras-taskmgr +++ b/wikilibras-taskmgr @@ -9,8 +9,6 @@ # Description: Enable service provided by Wikilibras API at boot ### END INIT INFO -# set -e - export PATH=$PATH:/usr/local/bin case "$1" in -- libgit2 0.21.2