From 8e6827c8981c6d7f4fef9deaa905d40bf00726fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Tue, 14 Feb 2017 15:32:01 +0100 Subject: [PATCH] GUI: Fix some pylint errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the following pylint errors: ************* Module tuned.gtk.gui_plugin_loader E:145,18: TunedException is not callable (not-callable) E: 45,11: Undefined variable name 'GTKPluginLoader' in __all__ (undefined-all-variable) ************* Module tuned.gtk.managerException E: 44, 4: method already defined line 41 (function-redefined) ************* Module tuned.gtk.gui_profile_loader E:126, 4: method already defined line 95 (function-redefined) Signed-off-by: Ondřej Lysoněk --- tuned/gtk/gui_plugin_loader.py | 4 ++-- tuned/gtk/gui_profile_loader.py | 4 ---- tuned/gtk/managerException.py | 12 +++++------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/tuned/gtk/gui_plugin_loader.py b/tuned/gtk/gui_plugin_loader.py index 2b3e93b..67fa195 100644 --- a/tuned/gtk/gui_plugin_loader.py +++ b/tuned/gtk/gui_plugin_loader.py @@ -33,7 +33,7 @@ import tuned.consts as consts import tuned.logs import tuned.plugins.repository as repository import configobj as ConfigObj -import tuned.exceptions as TunedException +from tuned.exceptions import TunedException from tuned import plugins from tuned.utils.plugin_loader import PluginLoader @@ -42,7 +42,7 @@ from tuned import storage, units, monitors, plugins, profiles, exports, \ import tuned.plugins as Plugins -__all__ = ['GTKPluginLoader'] +__all__ = ['GuiPluginLoader'] global_config_spec = ['dynamic_tuning = boolean(default=%s)' % consts.CFG_DEF_DYNAMIC_TUNING, diff --git a/tuned/gtk/gui_profile_loader.py b/tuned/gtk/gui_profile_loader.py index 47b2da6..10bd7cd 100644 --- a/tuned/gtk/gui_profile_loader.py +++ b/tuned/gtk/gui_profile_loader.py @@ -123,10 +123,6 @@ class GuiProfileLoader(object): config.write() self._refresh_profiles() - def _refresh_profiles(self): - self.profiles = {} - self._load_all_profiles() - def update_profile( self, old_profile_name, diff --git a/tuned/gtk/managerException.py b/tuned/gtk/managerException.py index 9589b52..958a346 100644 --- a/tuned/gtk/managerException.py +++ b/tuned/gtk/managerException.py @@ -38,10 +38,8 @@ class ManagerException(Exception): return repr(self.code) - def profile_already_exists(self, text): - return repr(text) - - def profile_already_exists(self): - return repr(self.code) - - + def profile_already_exists(self, text=None): + if text is None: + return repr(self.code) + else: + return repr(text)