diff options
| author | 2015-04-10 19:40:33 +0200 | |
|---|---|---|
| committer | 2015-04-10 19:40:33 +0200 | |
| commit | 0b040f33c65acb50a1e1cc0970365237e7e4ee69 (patch) | |
| tree | aebb4cf7abae23861cb45bf543ef269c1857b50e /pyload/webui | |
| parent | showing plugins nicer in settings -> "xxx (Addon)" instead "xxx_addon" (diff) | |
| download | pyload-0b040f33c65acb50a1e1cc0970365237e7e4ee69.tar.xz | |
moved the config-nicer from config-parser to webui-app
recreateing of plugin.conf no more needed
Diffstat (limited to 'pyload/webui')
| -rw-r--r-- | pyload/webui/app/pyloadweb.py | 14 | 
1 files changed, 13 insertions, 1 deletions
| 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) | 
