Browse Source

Fix some reported issues by linter

Godzil 5 years ago
parent
commit
df86bb132c

+ 2 - 0
sys.py/GdUI/container.py

@@ -10,6 +10,7 @@ class Container(Widget):
         super().__init__(x=x, y=y, width=width, height=height, bg_color=bg_color)
 
         self._Canvas = pygame.Surface((self._Width, self._Height), pygame.SRCALPHA, 32)
+        # noinspection PyArgumentList
         self._Canvas.convert_alpha()
 
         self._Childs = []
@@ -22,6 +23,7 @@ class Container(Widget):
         super().set_size(width, height)
         # Recreate the surface
         self._Canvas = pygame.Surface((self._Width, self._Height), pygame.SRCALPHA, 32)
+        # noinspection PyArgumentList
         self._Canvas.convert_alpha()
 
     def Draw(self):

+ 3 - 3
sys.py/GdUI/label.py

@@ -24,8 +24,8 @@ class Label(Widget):
         tmp = self._FontObj.render(self._Text, True, self._Color)
         self.set_size(tmp.get_width(), tmp.get_height())
 
-    def set_font(self, fontname):
-        self._FontObj = font_manager.get_font(fontname)
+    def set_font(self, font_name):
+        self._FontObj = font_manager.get_font(font_name)
         self._Resize()
 
     def get_text(self):
@@ -37,7 +37,7 @@ class Label(Widget):
 
     def Draw(self):
         super().Draw()
-        # Avoding same font tangling set_bold to others
+        # Avoiding same font tangling set_bold to others
         self._FontObj.set_bold(False)
         my_text = self._FontObj.render(self._Text, True, self._Color)
 

+ 1 - 1
sys.py/config_manager.py

@@ -49,6 +49,6 @@ def get(key):
         return None
 
 
-if __initialized == False:
+if not __initialized:
     load_config("config.json")
     __initialized = True

+ 1 - 1
sys.py/plugins/__init__.py

@@ -5,7 +5,7 @@ import config_manager as config
 Plugin = plugin.Plugin
 
 
-def LoadPlugins(config):
+def LoadPlugins():
     """Load plugins from config data"""
     p = config.get("plugins")
     print(p)

+ 2 - 3
sys.py/start_ui.py

@@ -11,7 +11,7 @@ if not pygame.display.get_init():
 if not pygame.font.get_init():
     pygame.font.init()
 
-# from wicd import misc
+# noinspection PyPep8
 import config_manager as config
 import plugins
 import skin_manager as SkinManager
@@ -39,7 +39,6 @@ def process_event(event, ui_root: UI.Widget):
 
 
 def main_loop():
-    global sound_patch
     screen_width = config.get("screen_width")
     screen_height = config.get("screen_height")
 
@@ -59,7 +58,7 @@ def init():
     os.environ['SDL_VIDEO_CENTERED'] = '1'
     os.chdir(os.path.dirname(os.path.realpath(__file__)))
 
-    if pygame.image.get_extended() == False:
+    if not pygame.image.get_extended():
         print("This pygame does not support PNG")
         sys.exit()
 

+ 2 - 3
sys.py/test_ui.py

@@ -12,6 +12,7 @@ if not pygame.font.get_init():
     pygame.font.init()
 
 # from wicd import misc
+# noinspection PyPep8
 import config_manager as config
 import plugins
 import skin_manager as SkinManager
@@ -38,8 +39,6 @@ def process_event(event, ui_root: UI.Widget):
 
 
 def main_loop():
-    global sound_patch
-
     screen = UI.Screen(fps=30, bg_color=SkinManager.get_color("background"))
 
     cont = UI.Container(10, 10, 50, 50, bg_color=(192, 192, 192))
@@ -126,7 +125,7 @@ def init():
     os.environ['SDL_VIDEO_CENTERED'] = '1'
     os.chdir(os.path.dirname(os.path.realpath(__file__)))
 
-    if pygame.image.get_extended() == False:
+    if not pygame.image.get_extended():
         print("This pygame does not support PNG")
         sys.exit()