From 748239279e1478f7135d113172d5701e787bdb84 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 4 Apr 2015 12:23:36 +0200 Subject: fix endless recursion --- pyload/network/JsEngine.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pyload/network/JsEngine.py') diff --git a/pyload/network/JsEngine.py b/pyload/network/JsEngine.py index 2e98fa37d..481a99a18 100644 --- a/pyload/network/JsEngine.py +++ b/pyload/network/JsEngine.py @@ -110,9 +110,9 @@ class AbstractEngine(object): __name = "" - def __init__(self): + def __init__(self, force=False): self.setup() - self.available = self.find() + self.available = True if force else self.find() def setup(self): @@ -126,7 +126,7 @@ class AbstractEngine(object): __import__(cls.__name) except Exception: try: - out, err = cls().eval("print(23+19)") + out, err = cls(True).eval("print(23+19)") except Exception: res = False else: -- cgit v1.2.3 From 8fcb8f36a2775b5ec0883de814e6dba890b90fe5 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 4 Apr 2015 13:13:06 +0200 Subject: fix --- pyload/network/JsEngine.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pyload/network/JsEngine.py') diff --git a/pyload/network/JsEngine.py b/pyload/network/JsEngine.py index 481a99a18..6ae90f299 100644 --- a/pyload/network/JsEngine.py +++ b/pyload/network/JsEngine.py @@ -126,7 +126,7 @@ class AbstractEngine(object): __import__(cls.__name) except Exception: try: - out, err = cls(True).eval("print(23+19)") + out, err = cls(True).eval("23+19") except Exception: res = False else: @@ -137,7 +137,7 @@ class AbstractEngine(object): return res - def _eval(args): + def _eval(self, args): if not self.available: return None, "JS Engine \"%s\" not found" % self.__name @@ -151,7 +151,7 @@ class AbstractEngine(object): return None, e - def eval(script): + def eval(self, script): raise NotImplementedError @@ -211,7 +211,7 @@ class RhinoEngine(AbstractEngine): def setup(self): jspath = [ - "/usr/share/java*/js.jar", + "/usr/share/java/js.jar", "js.jar", path.join(pypath, "js.jar") ] -- cgit v1.2.3