Allow complete paths for script

This allows running any weboob script, not only those in scripts/
This commit is contained in:
Laurent Bachelier 2013-05-09 20:45:26 +02:00 committed by Romain Bignon
commit 1df3cb78ef

View file

@ -34,7 +34,12 @@ if p.returncode != 0:
print s[0]
sys.exit(p.returncode)
if os.path.exists(script):
spath = script
else:
spath = os.path.join(project, 'scripts', script)
os.execvpe(
sys.executable,
['-Wall', os.path.join(project, 'scripts', script)] + args,
['-Wall', spath] + args,
env)