From 0b040f33c65acb50a1e1cc0970365237e7e4ee69 Mon Sep 17 00:00:00 2001 From: Armin Date: Fri, 10 Apr 2015 19:40:33 +0200 Subject: moved the config-nicer from config-parser to webui-app recreateing of plugin.conf no more needed --- pyload/webui/app/pyloadweb.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'pyload/webui/app') 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) -- cgit v1.2.3