From a32ab94ad39f14febf6d0526e368478d829a17c5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 27 Dec 2015 20:11:56 +0100 Subject: [internal] Spare code optimizations and fixes --- module/plugins/internal/Plugin.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'module/plugins/internal/Plugin.py') diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 779865147..43284f6a8 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -51,11 +51,18 @@ class Plugin(object): def _init(self, core): - self.pyload = core - self.db = DB(self) - self.config = Config(self) - self.info = {} #: Provide information in dict here - self.req = None #: Browser instance, see `network.Browser` + #: Internal modules + self.pyload = core + self.db = DB(self) + self.config = Config(self) + + #: Provide information in dict here + self.info = {} + + #: Browser instance, see `network.Browser` + self.req = self.pyload.requestFactory.getRequest(self.classname) + + #: Last loaded html self.last_html = "" self.last_header = {} @@ -175,7 +182,7 @@ class Plugin(object): url = fixurl(url, unquote=True) #: Recheck in 0.4.10 if req is None: - req = self.req or self.pyload.requestFactory.getRequest(self.classname) + req = self.req #@TODO: Move to network in 0.4.10 if isinstance(cookies, list): -- cgit v1.2.3