From 0d41aec246eb110cc33c966fad7227177e7e5190 Mon Sep 17 00:00:00 2001 From: Armin Date: Sun, 5 Apr 2015 14:13:00 +0200 Subject: fix setup --- pyload/network/JsEngine.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'pyload/network') diff --git a/pyload/network/JsEngine.py b/pyload/network/JsEngine.py index 6ae90f299..ed7d49d27 100644 --- a/pyload/network/JsEngine.py +++ b/pyload/network/JsEngine.py @@ -123,7 +123,7 @@ class AbstractEngine(object): def find(cls): """ Check if the engine is available """ try: - __import__(cls.__name) + __import__(cls._name) except Exception: try: out, err = cls(True).eval("23+19") @@ -157,7 +157,7 @@ class AbstractEngine(object): class Pyv8Engine(AbstractEngine): - __name = "pyv8" + _name = "PyV8" def eval(self, script): @@ -176,11 +176,12 @@ class Pyv8Engine(AbstractEngine): class CommonEngine(AbstractEngine): - __name = "js" + _name = "js" def setup(self): - subprocess.Popen(["js", "-v"], bufsize=-1).communicate() + # subprocess.Popen(["js", "-v"], bufsize=-1).communicate() + pass def eval(self, script): @@ -191,7 +192,7 @@ class CommonEngine(AbstractEngine): class NodeEngine(AbstractEngine): - __name = "nodejs" + _name = "nodejs" def setup(self): @@ -206,7 +207,7 @@ class NodeEngine(AbstractEngine): class RhinoEngine(AbstractEngine): - __name = "rhino" + _name = "rhino" def setup(self): @@ -235,7 +236,7 @@ class RhinoEngine(AbstractEngine): class JscEngine(AbstractEngine): - __name = "javascriptcore" + _name = "javascriptcore" def setup(self): -- cgit v1.2.3 From f53d57b902b71708f05a3125872ec5d34ebe65b9 Mon Sep 17 00:00:00 2001 From: Armin Date: Thu, 9 Apr 2015 20:11:11 +0200 Subject: fix: OboomCom and SmoozedCom with beaker >= v1.7.x fix: run plugins this fix makes the plugin attribute "__name" obsolet --- pyload/network/JsEngine.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pyload/network') diff --git a/pyload/network/JsEngine.py b/pyload/network/JsEngine.py index ed7d49d27..c64e8c490 100644 --- a/pyload/network/JsEngine.py +++ b/pyload/network/JsEngine.py @@ -46,7 +46,7 @@ class JsEngine(object): elif isinstance(engine, basestring): engine_name = engine.lower() for E in ENGINES: - if E.__name == engine_name: #: doesn't check if E(NGINE) is available, just convert string to class + if E._name == engine_name: #: doesn't check if E(NGINE) is available, just convert string to class JSE = E break else: @@ -88,14 +88,14 @@ class JsEngine(object): if self.core.config.get("general", "debug"): if err: - self.core.log.debug(JSE.__name + ":", err) + self.core.log.debug(JSE._name + ":", err) engines = self.find() engines.remove(JSE) for E in engines: out, err = E.eval(script) res = err or out - self.core.log.debug(E.__name + ":", res) + self.core.log.debug(E._name + ":", res) results.append(res) if len(results) > 1 and len(uniqify(results)) > 1: @@ -107,7 +107,7 @@ class JsEngine(object): class AbstractEngine(object): """ JSE base class """ - __name = "" + _name = "" def __init__(self, force=False): @@ -139,7 +139,7 @@ class AbstractEngine(object): def _eval(self, args): if not self.available: - return None, "JS Engine \"%s\" not found" % self.__name + return None, "JS Engine \"%s\" not found" % self._name try: p = subprocess.Popen(args, @@ -162,7 +162,7 @@ class Pyv8Engine(AbstractEngine): def eval(self, script): if not self.available: - return None, "JS Engine \"%s\" not found" % self.__name + return None, "JS Engine \"%s\" not found" % self._name try: rt = PyV8.JSContext() -- cgit v1.2.3