[gnome-games/applygsoc2009: 29/76] Rename internal class accoring to pep8



commit c710761899a0e4dbd02cb5f754bdfc7ac082eb91
Author: Pablo Castellano <pablog src gnome org>
Date:   Thu Aug 26 12:52:13 2010 +0200

    Rename internal class accoring to pep8
    
    *_single_leading_underscore for internal use
    * the type_register should be useless?

 gnome-sudoku/src/lib/number_box.py |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/gnome-sudoku/src/lib/number_box.py b/gnome-sudoku/src/lib/number_box.py
index 4dfb484..629902c 100644
--- a/gnome-sudoku/src/lib/number_box.py
+++ b/gnome-sudoku/src/lib/number_box.py
@@ -21,7 +21,7 @@ NOTE_FONT_SIZE = pango.SCALE * 6
 BORDER_WIDTH = 9.0 # The size of space we leave for a box
 NORMAL_LINE_WIDTH = 1 # The size of the line we draw around a box
 
-class NumberSelector (gtk.EventBox):
+class _NumberSelector (gtk.EventBox):
 
     __gsignals__ = {
         'number-selected':(gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
@@ -71,7 +71,7 @@ class NumberSelector (gtk.EventBox):
     def set_value (self, n):
         self.value = n
 
-class NumberBox (gtk.Widget):
+class _NumberBox (gtk.Widget):
 
     text = ''
     top_note_text = ''
@@ -315,7 +315,7 @@ class NumberBox (gtk.Widget):
 
     def show_number_picker (self):
         w = gtk.Window(type = gtk.WINDOW_POPUP)
-        ns = NumberSelector(upper = self.upper, default = self.get_value())
+        ns = _NumberSelector(upper = self.upper, default = self.get_value())
         ns.connect('number-selected', self.number_changed_cb)
         w.grab_focus()
         w.add(ns)
@@ -736,7 +736,7 @@ class NumberBox (gtk.Widget):
     def get_note_text (self):
         return self.top_note_text, self.bottom_note_text
 
-class SudokuNumberBox (NumberBox):
+class SudokuNumberBox (_NumberBox):
 
     normal_color = None
     tracker_id = None
@@ -800,14 +800,12 @@ class SudokuNumberBox (NumberBox):
         self.queue_draw()
 
 
-gobject.type_register(NumberBox)
-
 if __name__ == '__main__':
     window = gtk.Window()
     window.connect('delete-event', gtk.main_quit)
 
     def test_number_selector ():
-        nselector = NumberSelector(default = 3)
+        nselector = _NumberSelector(default = 3)
         def tell_me (b):
             print 'value->', b.get_value()
         nselector.connect('number-selected', tell_me)
@@ -815,7 +813,7 @@ if __name__ == '__main__':
 
     def test_number_box ():
         window.set_size_request(100, 100)
-        nbox = NumberBox()
+        nbox = _NumberBox()
         window.add(nbox)
 
 #    test_number_selector()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]