more cleanup, thx Codacity

This commit is contained in:
gm10 2019-01-27 22:47:41 +01:00
parent 48828788fd
commit 1bff516a26
No known key found for this signature in database
GPG Key ID: A981D4EA8CF993A9
4 changed files with 12 additions and 15 deletions

View File

@ -297,7 +297,8 @@ class MainWindow(object):
self.tooltipsEnable(False) self.tooltipsEnable(False)
# A little bit hacky but works. # A little bit hacky but works.
def getDefaultColors(self): @staticmethod
def getDefaultColors():
widget = Gtk.EventBox() widget = Gtk.EventBox()
widget.show() widget.show()

View File

@ -4,7 +4,6 @@ import cgi
import filecmp import filecmp
import gettext import gettext
import os import os
import string
import subprocess import subprocess
import threading import threading
import urllib import urllib
@ -19,7 +18,6 @@ from plugins.easybuttons import (ApplicationLauncher, CategoryButton,
FavApplicationLauncher, FavApplicationLauncher,
MenuApplicationLauncher) MenuApplicationLauncher)
from plugins.easygsettings import EasyGSettings from plugins.easygsettings import EasyGSettings
from plugins.execute import Execute
# i18n # i18n
gettext.install("mintmenu", "/usr/share/linuxmint/locale") gettext.install("mintmenu", "/usr/share/linuxmint/locale")
@ -303,11 +301,8 @@ class pluginclass(object):
# os.system("xdg-open apt://" + pkg_name + " &") # os.system("xdg-open apt://" + pkg_name + " &")
self.mintMenuWin.hide() self.mintMenuWin.hide()
def __del__(self): @staticmethod
#print("Applications plugin deleted") def wake():
return
def wake(self):
return return
def destroy(self): def destroy(self):

View File

@ -27,10 +27,10 @@ class IconManager(GObject.GObject):
self.count = 0 self.count = 0
# Some apps don't put a default icon in the default theme folder, so we will search all themes # Some apps don't put a default icon in the default theme folder, so we will search all themes
def createTheme(d): # def createTheme(d):
theme = Gtk.IconTheme() # theme = Gtk.IconTheme()
theme.set_custom_theme(d) # theme.set_custom_theme(d)
return theme # return theme
# This takes to much time and there are only a very few applications that use icons from different themes # 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))]) #self.themes = map( createTheme, [d for d in os.listdir("/usr/share/icons") if os.path.isdir(os.path.join("/usr/share/icons", d))])

View File

@ -70,7 +70,8 @@ class pluginclass:
#Connect event handlers #Connect event handlers
self.builder.get_object("ClrBtn").connect("clicked", self.clrmenu) self.builder.get_object("ClrBtn").connect("clicked", self.clrmenu)
def wake(self): @staticmethod
def wake():
return return
def destroy(self): def destroy(self):
@ -214,6 +215,6 @@ class pluginclass:
self.Win.plugins["applications"].wTree.get_widget("entry1").grab_focus() self.Win.plugins["applications"].wTree.get_widget("entry1").grab_focus()
Execute(w, self.Exec) Execute(w, self.Exec)
def do_plugin(self): @staticmethod
def do_plugin():
return return
# self.DoRecent()