diff options
Diffstat (limited to 'pyload')
-rw-r--r-- | pyload/plugins/Base.py | 8 | ||||
-rw-r--r-- | pyload/plugins/Crypter.py | 2 | ||||
-rw-r--r-- | pyload/plugins/Hoster.py | 8 |
3 files changed, 12 insertions, 6 deletions
diff --git a/pyload/plugins/Base.py b/pyload/plugins/Base.py index b6668ea90..4d77fe4b2 100644 --- a/pyload/plugins/Base.py +++ b/pyload/plugins/Base.py @@ -77,7 +77,7 @@ class Base(object): __author_mail__ = tuple() - def __init__(self, core, user=None): + def __init__(self, core, owner=None): self.__name__ = self.__class__.__name__ #: Core instance @@ -90,17 +90,17 @@ class Base(object): self.evm = core.eventManager #: :class:`InteractionManager` self.im = core.interactionManager - if user is not None: + if owner is not None: #: :class:`Api`, user api when user is set self.api = self.core.api.withUserContext(user) if not self.api: raise Exception("Plugin running with invalid user") #: :class:`User`, user related to this plugin - self.user = self.api.user + self.owner = self.api.user else: self.api = self.core.api - self.user = None + self.owner = None #: last interaction task self.task = None diff --git a/pyload/plugins/Crypter.py b/pyload/plugins/Crypter.py index fcea1263a..a81fffafa 100644 --- a/pyload/plugins/Crypter.py +++ b/pyload/plugins/Crypter.py @@ -141,7 +141,7 @@ class Crypter(Base): self.req = None # load account if set if self.USE_ACCOUNT: - self.account = self.core.accountManager.selectAccount(self.USE_ACCOUNT, self.user) + self.account = self.core.accountManager.selectAccount(self.USE_ACCOUNT, self.owner) if self.account: self.req = self.account.getAccountRequest() diff --git a/pyload/plugins/Hoster.py b/pyload/plugins/Hoster.py index 68eb32baa..b59d11a9c 100644 --- a/pyload/plugins/Hoster.py +++ b/pyload/plugins/Hoster.py @@ -64,7 +64,7 @@ class Hoster(Base): self.ocr = None #captcha reader instance #: account handler instance, see :py:class:`Account` - self.account = self.core.accountManager.selectAccount(self.__name__, self.user) + self.account = self.core.accountManager.selectAccount(self.__name__, self.owner) #: premium status self.premium = False @@ -95,6 +95,12 @@ class Hoster(Base): self.init() + @property + def user(self): + self.logDebug("Deprecated usage of self.user -> use self.account.loginname") + if self.account: + return self.account.loginname + def getMultiDL(self): return self.limitDL <= 0 |