diff options
Diffstat (limited to 'pyload')
-rw-r--r-- | pyload/config/Parser.py | 8 | ||||
-rw-r--r-- | pyload/webui/app/pyloadweb.py | 14 |
2 files changed, 14 insertions, 8 deletions
diff --git a/pyload/config/Parser.py b/pyload/config/Parser.py index 4c5ee6742..4c462946e 100644 --- a/pyload/config/Parser.py +++ b/pyload/config/Parser.py @@ -309,13 +309,7 @@ class ConfigParser(object): def addPluginConfig(self, name, config, outline=""): """adds config options with tuples (name, type, desc, default)""" if name not in self.plugin: - for search, repl in ( ('_account', ' (Account)'), ('_addon', ' (Addon)'), ('_container', ''), ('_crypter', ' (Crypter)'), ('_extractor', ''), ('_hook', ' (Hook)'), ('_hoster', ' (Hoster)')): - if name.endswith(search): - desc = name.replace(search, repl) - break - else: - desc = name - conf = {"desc": desc, + conf = {"desc": name, "outline": outline} self.plugin[name] = conf else: diff --git a/pyload/webui/app/pyloadweb.py b/pyload/webui/app/pyloadweb.py index d71d0d306..8bf8060d4 100644 --- a/pyload/webui/app/pyloadweb.py +++ b/pyload/webui/app/pyloadweb.py @@ -239,6 +239,8 @@ def get_download(path): return static_file(fs_encode(path), fs_encode(root)) +__TYPES = ("account", "addon", "container", "crypter", "extractor", "hook", "hoster", "internal", "ocr") +__TYPE_REPLACES = ( ('_account', ' (Account)'), ('_addon', ' (Addon)'), ('_container', ''), ('_crypter', ' (Crypter)'), ('_extractor', ''), ('_hook', ' (Hook)'), ('_hoster', ' (Hoster)')) @route('/settings') @login_required('SETTINGS') @@ -253,7 +255,17 @@ def config(): conf_menu.append((entry, conf[entry].description)) for entry in sorted(plugin.keys()): - plugin_menu.append((entry, plugin[entry].description)) + desc = plugin[entry].description + name, none, type = desc.partition("_") + if type in __TYPES: + if len([a for a,b in plugin.iteritems() if b.description.startswith(name+"_")]) > 1: + for search, repl in __TYPE_REPLACES: + if desc.endswith(search): + desc = desc.replace(search, repl) + break + else: + desc = name + plugin_menu.append((entry, desc)) accs = PYLOAD.getAccounts(False) |