summaryrefslogtreecommitdiffstats
path: root/pyload/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins')
-rw-r--r--pyload/plugins/MultiHoster.py1
-rw-r--r--pyload/plugins/addons/MultiHoster.py23
2 files changed, 8 insertions, 16 deletions
diff --git a/pyload/plugins/MultiHoster.py b/pyload/plugins/MultiHoster.py
index bc7a0de75..6b48e99fb 100644
--- a/pyload/plugins/MultiHoster.py
+++ b/pyload/plugins/MultiHoster.py
@@ -11,6 +11,7 @@ def normalize(domain):
""" Normalize domain/plugin name, so they are comparable """
return remove_chars(domain.strip().lower(), "-.")
+
#noinspection PyUnresolvedReferences
class MultiHoster(Account):
"""
diff --git a/pyload/plugins/addons/MultiHoster.py b/pyload/plugins/addons/MultiHoster.py
index 21529eb1a..2d4029dd6 100644
--- a/pyload/plugins/addons/MultiHoster.py
+++ b/pyload/plugins/addons/MultiHoster.py
@@ -6,18 +6,18 @@ from types import MethodType
from pyload.plugins.MultiHoster import MultiHoster as MultiHosterAccount, normalize
from pyload.plugins.Addon import Addon, AddEventListener
-from pyload.PluginManager import PluginTuple
+from pyload.PluginManager import PluginMatcher
-
-class MultiHoster(Addon):
+class MultiHoster(Addon, PluginMatcher):
__version__ = "0.1"
__internal__ = True
__description__ = "Gives ability to use MultiHoster services."
__config__ = []
- __author_mail__ = ("pyLoad Team",)
+ __author__ = ("pyLoad Team",)
__author_mail__ = ("support@pyload.org",)
#TODO: multiple accounts - multihoster / config options
+ # TODO: rewrite for new plugin manager
def init(self):
@@ -90,17 +90,8 @@ class MultiHoster(Addon):
def activate(self):
self.refreshAccounts()
- # new method for plugin manager
- def getPlugin(self2, name):
- if name in self.plugins:
- return self.plugins[name]
- return self2.getPluginClass(name)
-
- pm = self.core.pluginManager
- pm.getPlugin = MethodType(getPlugin, pm, object)
-
+ self.core.pluginManager.addMatcher(self)
def deactivate(self):
- #restore state
- pm = self.core.pluginManager
- pm.getPlugin = pm.getPluginClass
+
+ self.core.pluginManager.removeMatcher(self)