From c5234a8b3d223f9860de161894ae8a4623e1ae05 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 17 Jun 2009 23:18:27 +0200 Subject: plugins can import captcha method, see #6 --- Plugins/Plugin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Plugins/Plugin.py') diff --git a/Plugins/Plugin.py b/Plugins/Plugin.py index a253ffb74..adcaa7678 100644 --- a/Plugins/Plugin.py +++ b/Plugins/Plugin.py @@ -26,6 +26,7 @@ class Plugin(): self.time_plus_wait = 0 #time() + wait in seconds self.want_reconnect = False self.multi_dl = True + self.ocr = None #captcha reader instance def set_parent_status(self): """ sets all available Statusinfos about a File in self.parent.status @@ -74,5 +75,10 @@ class Plugin(): self.config[option] = self.parser.get(self.props['name'], option, raw=True) self.config[option] = False if self.config[option].lower() == 'false' else self.config[option] + def init_ocr(self): + modul = __import__("captcha."+ self.props['name']) + captchaClass = getattr(modul, self.props['name']) + self.ocr = captchaClass() + def __call__(self): - return self.props['name'] \ No newline at end of file + return self.props['name'] -- cgit v1.2.3