From 7ecc4aed5425ebde0ac997e90249f4f937040771 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 29 Sep 2011 00:20:39 +0200 Subject: new plugin Base class providing useful methods --- module/plugins/Account.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'module/plugins/Account.py') diff --git a/module/plugins/Account.py b/module/plugins/Account.py index 202a7ad67..c147404e0 100644 --- a/module/plugins/Account.py +++ b/module/plugins/Account.py @@ -22,13 +22,14 @@ from time import time from traceback import print_exc from threading import RLock +from Plugin import Base from module.utils import compare_time, parseFileSize, lock class WrongPassword(Exception): pass -class Account(): +class Account(Base): """ Base class for every Account plugin. Just overwrite `login` and cookies will be stored and account becomes accessible in\ @@ -48,8 +49,9 @@ class Account(): def __init__(self, manager, accounts): + Base.__init__(self, manager.core) + self.manager = manager - self.core = manager.core self.accounts = {} self.infos = {} # cache for account information self.lock = RLock() @@ -288,16 +290,3 @@ class Account(): return False return True - - #log functions - def logInfo(self, msg): - self.core.log.info("%s: %s" % (self.__name__, msg)) - - def logWarning(self, msg): - self.core.log.warning("%s: %s" % (self.__name__, msg)) - - def logError(self, msg): - self.core.log.error("%s: %s" % (self.__name__, msg)) - - def logDebug(self, msg): - self.core.log.debug("%s: %s" % (self.__name__, msg)) -- cgit v1.2.3