From 1bff516a2659723478fe9aa8a4915c3ff034c54e Mon Sep 17 00:00:00 2001 From: gm10 <13855078+gm10@users.noreply.github.com> Date: Sun, 27 Jan 2019 22:47:41 +0100 Subject: [PATCH] more cleanup, thx Codacity --- usr/lib/linuxmint/mintMenu/mintMenu.py | 3 ++- usr/lib/linuxmint/mintMenu/plugins/applications.py | 9 ++------- usr/lib/linuxmint/mintMenu/plugins/easybuttons.py | 8 ++++---- usr/lib/linuxmint/mintMenu/plugins/recent.py | 7 ++++--- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 088829c..a200a50 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -297,7 +297,8 @@ class MainWindow(object): self.tooltipsEnable(False) # A little bit hacky but works. - def getDefaultColors(self): + @staticmethod + def getDefaultColors(): widget = Gtk.EventBox() widget.show() diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 33362c1..b463e07 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -4,7 +4,6 @@ import cgi import filecmp import gettext import os -import string import subprocess import threading import urllib @@ -19,7 +18,6 @@ from plugins.easybuttons import (ApplicationLauncher, CategoryButton, FavApplicationLauncher, MenuApplicationLauncher) from plugins.easygsettings import EasyGSettings -from plugins.execute import Execute # i18n gettext.install("mintmenu", "/usr/share/linuxmint/locale") @@ -303,11 +301,8 @@ class pluginclass(object): # os.system("xdg-open apt://" + pkg_name + " &") self.mintMenuWin.hide() - def __del__(self): - #print("Applications plugin deleted") - return - - def wake(self): + @staticmethod + def wake(): return def destroy(self): diff --git a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py index da78e8a..73836b6 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py +++ b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py @@ -27,10 +27,10 @@ class IconManager(GObject.GObject): self.count = 0 # Some apps don't put a default icon in the default theme folder, so we will search all themes - def createTheme(d): - theme = Gtk.IconTheme() - theme.set_custom_theme(d) - return theme + # def createTheme(d): + # theme = Gtk.IconTheme() + # theme.set_custom_theme(d) + # return theme # This takes to much time and there are only a very few applications that use icons from different themes #self.themes = map( createTheme, [d for d in os.listdir("/usr/share/icons") if os.path.isdir(os.path.join("/usr/share/icons", d))]) diff --git a/usr/lib/linuxmint/mintMenu/plugins/recent.py b/usr/lib/linuxmint/mintMenu/plugins/recent.py index b585ee3..245e85f 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/recent.py +++ b/usr/lib/linuxmint/mintMenu/plugins/recent.py @@ -70,7 +70,8 @@ class pluginclass: #Connect event handlers self.builder.get_object("ClrBtn").connect("clicked", self.clrmenu) - def wake(self): + @staticmethod + def wake(): return def destroy(self): @@ -214,6 +215,6 @@ class pluginclass: self.Win.plugins["applications"].wTree.get_widget("entry1").grab_focus() Execute(w, self.Exec) - def do_plugin(self): + @staticmethod + def do_plugin(): return - # self.DoRecent()