diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 15:05:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 15:05:49 +0000 |
commit | d395bd510fa4f4376dc5237ab2f8d190a920d35d (patch) | |
tree | 3e3b16b44064938be801aede14381562bae14f6a /deluge/ui/web/pluginmanager.py | |
parent | Adding upstream version 2.0.3. (diff) | |
download | deluge-d395bd510fa4f4376dc5237ab2f8d190a920d35d.tar.xz deluge-d395bd510fa4f4376dc5237ab2f8d190a920d35d.zip |
Adding upstream version 2.1.1.upstream/2.1.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/ui/web/pluginmanager.py')
-rw-r--r-- | deluge/ui/web/pluginmanager.py | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/deluge/ui/web/pluginmanager.py b/deluge/ui/web/pluginmanager.py index 24f20ce..2da5b61 100644 --- a/deluge/ui/web/pluginmanager.py +++ b/deluge/ui/web/pluginmanager.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2009 Damien Churchill <damoxc@gmail.com> # @@ -7,8 +6,6 @@ # See LICENSE for more details. # -from __future__ import unicode_literals - import logging import os @@ -74,22 +71,20 @@ class PluginManager(PluginManagerBase, component.Component): scripts = component.get('Scripts') for script in info['scripts']: - scripts.remove_script( - '%s/%s' % (name.lower(), os.path.basename(script).lower()) - ) + scripts.remove_script(f'{name.lower()}/{os.path.basename(script).lower()}') for script in info['debug_scripts']: scripts.remove_script( - '%s/%s' % (name.lower(), os.path.basename(script).lower()), 'debug' + f'{name.lower()}/{os.path.basename(script).lower()}', 'debug' ) scripts.remove_script( - '%s/%s' % (name.lower(), os.path.basename(script).lower()), 'dev' + f'{name.lower()}/{os.path.basename(script).lower()}', 'dev' ) - super(PluginManager, self).disable_plugin(name) + super().disable_plugin(name) def enable_plugin(self, name): - super(PluginManager, self).enable_plugin(name) + super().enable_plugin(name) # Get the plugin instance try: @@ -105,17 +100,15 @@ class PluginManager(PluginManagerBase, component.Component): scripts = component.get('Scripts') for script in info['scripts']: log.debug('adding script %s for %s', name, os.path.basename(script)) - scripts.add_script( - '%s/%s' % (name.lower(), os.path.basename(script)), script - ) + scripts.add_script(f'{name.lower()}/{os.path.basename(script)}', script) for script in info['debug_scripts']: log.debug('adding debug script %s for %s', name, os.path.basename(script)) scripts.add_script( - '%s/%s' % (name.lower(), os.path.basename(script)), script, 'debug' + f'{name.lower()}/{os.path.basename(script)}', script, 'debug' ) scripts.add_script( - '%s/%s' % (name.lower(), os.path.basename(script)), script, 'dev' + f'{name.lower()}/{os.path.basename(script)}', script, 'dev' ) def start(self): @@ -151,11 +144,10 @@ class PluginManager(PluginManagerBase, component.Component): info = gather_info(plugin) info['name'] = name info['scripts'] = [ - 'js/%s/%s' % (name.lower(), os.path.basename(s)) for s in info['scripts'] + f'js/{name.lower()}/{os.path.basename(s)}' for s in info['scripts'] ] info['debug_scripts'] = [ - 'js/%s/%s' % (name.lower(), os.path.basename(s)) - for s in info['debug_scripts'] + f'js/{name.lower()}/{os.path.basename(s)}' for s in info['debug_scripts'] ] del info['script_directories'] return info |