Commit a2d6d432 authored by Benjamin Bouvier's avatar Benjamin Bouvier
Browse files

Rename the env variable into KRESUS_WEBOOB_DIR;

and clean up the python code a bit.
parent aff889f3
......@@ -23,7 +23,11 @@ function callWeboob(command, access) {
log.info(`Calling weboob: command ${command}...`);
let serverRoot = path.join(__filename, '..', '..', '..');
let env = { WEBOOB_PYTHON_PATH: process.env.WEBOOB_PYTHON_PATH };
let env = {};
if (process.env.KRESUS_WEBOOB_DIR)
env.WEBOOB_DIR = process.env.KRESUS_WEBOOB_DIR;
let script = spawn(`./weboob/main.py`, [], { cwd: serverRoot, env });
script.stdin.write(`${command}\n`);
......
#!/usr/bin/env python2
import os
WEBOOB_PYTHON_PATH = os.environ['WEBOOB_PYTHON_PATH']
if os.path.isdir(WEBOOB_PYTHON_PATH):
import sys
sys.path.append(WEBOOB_PYTHON_PATH)
import sys
if 'WEBOOB_DIR' in os.environ and os.path.isdir(os.environ['WEBOOB_DIR']):
sys.path.append(os.environ['WEBOOB_DIR'])
from weboob.core import Weboob
......@@ -14,7 +15,6 @@ from weboob.capabilities.base import empty
import json
import os
import sys
import traceback
from datetime import datetime
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment