Browse Source

For label make GetText and SetText function name PEP-8 compliant

Godzil 6 years ago
parent
commit
1a9fd9b346
3 changed files with 8 additions and 8 deletions
  1. 2 2
      sys.py/GdUI/label.py
  2. 1 1
      sys.py/interface/top_bar.py
  3. 5 5
      sys.py/test_ui.py

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

@@ -28,10 +28,10 @@ class Label(Widget):
         self._FontObj = font_manager.get_font(fontname)
         self._Resize()
 
-    def GetText(self):
+    def get_text(self):
         return self._Text
 
-    def SetText(self, text):
+    def set_text(self, text):
         self._Text = text
         self._Resize()
 

+ 1 - 1
sys.py/interface/top_bar.py

@@ -21,7 +21,7 @@ class TopBar(UI.FlowContainer):
         self.add_child(self._bottomline)
 
     def set_title(self, title):
-        self._TitleLbl.SetText(title)
+        self._TitleLbl.set_text(title)
 
     def reload(self):
         # Do nothing for now, later reload info from skinmanager

+ 5 - 5
sys.py/test_ui.py

@@ -46,7 +46,7 @@ def main_loop():
     cont = UI.Container(10, 10, 50, 50, bg_color=(192, 192, 192))
 
     lbl = UI.Label(0, 0, auto_resize=True)
-    lbl.SetText("Hello the World")
+    lbl.set_text("Hello the World")
     lbl.set_bgcolor(None)
     lbl.set_color(SkinManager.get_color("URL"))
     lbl.set_font("noto_40")
@@ -67,22 +67,22 @@ def main_loop():
                                   bg_color=(83, 83, 83))
 
     lblA = UI.Label(0, 0, auto_resize=True)
-    lblA.SetText("A")
+    lblA.set_text("A")
     lblA.set_color(SkinManager.get_color("URL"))
     lblA.set_font("noto_13")
 
     lblB = UI.Label(0, 0, auto_resize=True)
-    lblB.SetText("D")
+    lblB.set_text("D")
     lblB.set_color(SkinManager.get_color("URL"))
     lblB.set_font("noto_13")
 
     lblC = UI.Label(0, 0, auto_resize=True)
-    lblC.SetText("C")
+    lblC.set_text("C")
     lblC.set_color((0, 255, 0))
     lblC.set_font("noto_13")
 
     lblD = UI.Label(0, 0, auto_resize=True)
-    lblD.SetText("C")
+    lblD.set_text("C")
     lblD.set_color((255, 0, 0))
     lblD.set_font("noto_13")