From c9259e2bd0a2dbae2292b1bad483eddf3e3ca94b Mon Sep 17 00:00:00 2001 From: Florian Franzen Date: Mon, 9 Apr 2012 23:33:31 +0200 Subject: Fixes a bug where unset or empty __pattern__ in MultiHoster plugins produce an error or an all matching regex if the MultiHoster introduces a new hosters to pyLoad. --- module/plugins/internal/MultiHoster.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/internal') diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index d50df3943..5e9a03fee 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -73,7 +73,10 @@ class MultiHoster(Hook): self.logDebug("New Hosters: %s" % ", ".join(sorted(new_supported))) # create new regexp - regexp = r".*(%s).*" % "|".join([klass.__pattern__] + [x.replace(".", "\\.") for x in new_supported]) + if not klass.__pattern__ or klass.pattern == "": + regexp = r".*(%s).*" % "|".join([x.replace(".", "\\.") for x in new_supported]) + else: + regexp = r".*(%s).*" % "|".join([klass.__pattern__] + [x.replace(".", "\\.") for x in new_supported]) dict = self.core.pluginManager.hosterPlugins[self.__name__] dict["pattern"] = regexp -- cgit v1.2.3