diff --git a/gnome-sudoku/src/lib/main.py b/gnome-sudoku/src/lib/main.py
index 8af1d78..b532cef 100644
--- a/gnome-sudoku/src/lib/main.py
+++ b/gnome-sudoku/src/lib/main.py
@@ -26,7 +26,7 @@ for filename, stock_id in [('footprints.png', 'tracks'), ]:
     except gobject.GError, e:
         print 'Failed to load pixbuf: %s' % e
         continue
-    STOCK_PIXBUFS[stock_id]=pb
+    STOCK_PIXBUFS[stock_id] = pb
     iconset = gtk.IconSet(pb)
     ICON_FACTORY.add(stock_id, iconset)
     ICON_FACTORY.add_default()
@@ -73,7 +73,7 @@ def inactivate_new_game_etc (fun):
     return inactivate_new_game_etc_
 
 class UI (gconf_wrapper.GConfWrapper):
-    ui='''<ui>
+    ui = '''<ui>
     <menubar name="MenuBar">
       <menu name="Game" action="Game">
         <menuitem action="New"/>
@@ -146,7 +146,7 @@ class UI (gconf_wrapper.GConfWrapper):
                      }
 
     @simple_debug
-    def __init__ (self, run_selector=True):
+    def __init__ (self, run_selector = True):
         """run_selector means that we start our regular game.
 
         For testing purposes, it will be convenient to hand a
@@ -160,7 +160,7 @@ class UI (gconf_wrapper.GConfWrapper):
         self.timer = ActiveTimer(self.w)
         self.won = False
         # add the accelerator group to our toplevel window
-        self.worker_connections=[]
+        self.worker_connections = []
         # setup sudoku maker...
         self.sudoku_maker = sudoku_maker.SudokuMaker()
         self.sudoku_tracker = saver.SudokuTracker()
@@ -312,14 +312,14 @@ class UI (gconf_wrapper.GConfWrapper):
         self.history = Undo.UndoHistoryList(undo_widg, redo_widg)
         for entry in self.gsd.__entries__.values():
             Undo.UndoableGenericWidget(entry, self.history,
-                                       set_method='set_value_from_undo',
-                                       pre_change_signal='value-about-to-change'
+                                       set_method = 'set_value_from_undo',
+                                       pre_change_signal = 'value-about-to-change'
                                        )
             Undo.UndoableGenericWidget(entry, self.history,
-                                       set_method='set_notes',
-                                       get_method='get_note_text',
-                                       signal='notes-changed',
-                                       pre_change_signal='value-about-to-change',
+                                       set_method = 'set_notes',
+                                       get_method = 'get_note_text',
+                                       signal = 'notes-changed',
+                                       pre_change_signal = 'value-about-to-change',
                                        )
 
     def setup_color (self):
@@ -342,23 +342,23 @@ class UI (gconf_wrapper.GConfWrapper):
         # Add menu bar and toolbar...
         mb = self.uimanager.get_widget('/MenuBar')
         mb.show()
-        self.vb.pack_start(mb, fill=False, expand=False)
+        self.vb.pack_start(mb, fill = False, expand = False)
         self.tb = self.uimanager.get_widget('/Toolbar')
-        self.vb.pack_start(self.tb, fill=False, expand=False)
+        self.vb.pack_start(self.tb, fill = False, expand = False)
         self.main_area = gtk.HBox()
         self.swallower = SwappableArea(self.main_area)
         self.swallower.show()
-        self.vb.pack_start(self.swallower, True, padding=12)
-        self.main_area.pack_start(self.gsd, padding=6)
+        self.vb.pack_start(self.swallower, True, padding = 12)
+        self.main_area.pack_start(self.gsd, padding = 6)
         self.main_actions.set_visible(True)
         self.game_box = gtk.VBox()
         self.main_area.show()
         self.vb.show()
         self.game_box.show()
-        self.main_area.pack_start(self.game_box, False, padding=12)
+        self.main_area.pack_start(self.game_box, False, padding = 12)
         self.statusbar = gtk.Statusbar()
         self.statusbar.show()
-        self.vb.pack_end(self.statusbar, fill=False, expand=False)
+        self.vb.pack_end(self.statusbar, fill = False, expand = False)
         self.w.add(self.vb)
 
     def setup_toggles (self):
@@ -380,9 +380,9 @@ class UI (gconf_wrapper.GConfWrapper):
 
     @simple_debug
     def start_worker_thread (self, *args):
-        n_new_puzzles = self.sudoku_maker.n_puzzles(new=True)
+        n_new_puzzles = self.sudoku_maker.n_puzzles(new = True)
         if n_new_puzzles < self.gconf['minimum_number_of_new_puzzles']:
-            self.worker = threading.Thread(target=lambda *args: self.sudoku_maker.work(limit=5))
+            self.worker = threading.Thread(target = lambda *args: self.sudoku_maker.work(limit = 5))
             self.worker_connections = [
                 self.timer.connect('timing-started', self.sudoku_maker.resume),
                 self.timer.connect('timing-stopped', self.sudoku_maker.pause)
@@ -408,29 +408,29 @@ class UI (gconf_wrapper.GConfWrapper):
             return
         self.won = True
         # increase difficulty for next time.
-        self.gconf['difficulty']=self.gconf['difficulty']+0.1
+        self.gconf['difficulty'] = self.gconf['difficulty'] + 0.1
         self.timer.finish_timing()
         self.sudoku_tracker.finish_game(self)
-        sublabel = _("You completed the puzzle in %(totalTime)s (%(activeTime)s active)")%{'totalTime': self.timer.total_time_string(),
+        sublabel = _("You completed the puzzle in %(totalTime)s (%(activeTime)s active)") % {'totalTime': self.timer.total_time_string(),
         'activeTime': self.timer.active_time_string()
                 }
         sublabel += "\n"
-        sublabel += ngettext("You got %(n)s hint", "You got %(n)s hints", self.gsd.hints)%{'n':self.gsd.hints}
+        sublabel += ngettext("You got %(n)s hint", "You got %(n)s hints", self.gsd.hints) % {'n':self.gsd.hints}
         sublabel += "\n"
         if self.gsd.impossible_hints:
             sublabel += ngettext("You had %(n)s impossibility pointed out.",
                                  "You had %(n)s impossibilities pointed out.",
-                                 self.gsd.impossible_hints)%{'n':self.gsd.impossible_hints}
+                                 self.gsd.impossible_hints) % {'n':self.gsd.impossible_hints}
             sublabel += "\n"
         if self.gsd.auto_fills:
             sublabel += ngettext("You used the auto-fill %(n)s time",
                                  "You used the auto-fill %(n)s times",
-                                 self.gsd.auto_fills)%{'n':self.gsd.auto_fills}
+                                 self.gsd.auto_fills) % {'n':self.gsd.auto_fills}
         import dancer
         self.dancer = dancer.GridDancer(self.gsd)
         self.dancer.start_dancing()
-        dialog_extras.show_message(_("You win!"), label=_("You win!"),
-                                   sublabel=sublabel
+        dialog_extras.show_message(_("You win!"), label = _("You win!"),
+                                   sublabel = sublabel
                                    )
 
     @simple_debug
@@ -439,7 +439,7 @@ class UI (gconf_wrapper.GConfWrapper):
             try:
                 self.gconf[k]
             except:
-                self.gconf[k]=v
+                self.gconf[k] = v
         self.player = self.gconf['player']
 
     @simple_debug
@@ -448,9 +448,9 @@ class UI (gconf_wrapper.GConfWrapper):
         if (self.gsd.grid and self.gsd.grid.is_changed() and not self.won):
             try:
                 if dialog_extras.getBoolean(
-                    label=_("Save this game before starting new one?"),
-                    custom_yes=_("_Save game for later"),
-                    custom_no=_("_Abandon game"),
+                    label = _("Save this game before starting new one?"),
+                    custom_yes = _("_Save game for later"),
+                    custom_no = _("_Abandon game"),
                     ):
                     self.save_game()
                 else:
@@ -468,7 +468,7 @@ class UI (gconf_wrapper.GConfWrapper):
             and self.gsd.grid.is_changed()
             and (not self.won)):
             try:
-                if dialog_extras.getBoolean(label=_("Save game before closing?")):
+                if dialog_extras.getBoolean(label = _("Save game before closing?")):
                     self.save_game(self)
             except dialog_extras.UserCancelledError:
                 return
@@ -511,10 +511,10 @@ class UI (gconf_wrapper.GConfWrapper):
         while gtk.events_pending():
             gtk.main_iteration()
         if self.won:
-            self.gconf['current_game']=''
+            self.gconf['current_game'] = ''
         if not self.won:
             if not self.gsd.grid:
-                self.gconf['current_game']=''
+                self.gconf['current_game'] = ''
         self.stop_worker_thread()
         # allow KeyboardInterrupts, which calls quit_cb outside the main loop
         try:
@@ -538,7 +538,7 @@ class UI (gconf_wrapper.GConfWrapper):
 
     @simple_debug
     def clear_cb (self, *args):
-        clearer=Undo.UndoableObject(
+        clearer = Undo.UndoableObject(
             self.do_clear, #action
             self.undo_clear, #inverse
             self.history #history
@@ -590,7 +590,7 @@ class UI (gconf_wrapper.GConfWrapper):
     @simple_debug
     def auto_fill_cb (self, *args):
         if not hasattr(self, 'autofilled'):
-            self.autofilled=[]
+            self.autofilled = []
         if not hasattr(self, 'autofiller'):
             self.autofiller = Undo.UndoableObject(
                 self.do_auto_fill,
@@ -606,7 +606,7 @@ class UI (gconf_wrapper.GConfWrapper):
 
     def undo_auto_fill (self, *args):
         for entry in self.autofilled.pop():
-            self.gsd.remove(entry[0], entry[1], do_removal=True)
+            self.gsd.remove(entry[0], entry[1], do_removal = True)
         if self.gconf['always_show_hints']:
             self.gsd.update_all_hints()
 
@@ -651,8 +651,8 @@ class UI (gconf_wrapper.GConfWrapper):
         puzzle = self.gsd.grid.virgin.to_string()
         puzzle_diff = self.sudoku_maker.get_difficulty(puzzle)
 
-        tot_string = _("Playing %(difficulty)s puzzle.")%{'difficulty':puzzle_diff.value_string()}
-        tot_string += " " + "(%1.2f)"%puzzle_diff.value
+        tot_string = _("Playing %(difficulty)s puzzle.") % {'difficulty':puzzle_diff.value_string()}
+        tot_string += " " + "(%1.2f)" % puzzle_diff.value
 
         self.set_statusbar_value(tot_string)
         return True
@@ -666,16 +666,16 @@ class UI (gconf_wrapper.GConfWrapper):
     @simple_debug
     def show_info_cb (self, *args):
         if not self.gsd.grid:
-            dialog_extras.show_message(parent=self.w,
-                                       title=_("Puzzle Information"),
-                                       label=_("There is no current puzzle.")
+            dialog_extras.show_message(parent = self.w,
+                                       title = _("Puzzle Information"),
+                                       label = _("There is no current puzzle.")
                                        )
             return
         puzzle = self.gsd.grid.virgin.to_string()
         diff = self.sudoku_maker.get_difficulty(puzzle)
         information = _("Calculated difficulty: ")
         information += diff.value_string()
-        information += " (%1.2f)"%diff.value
+        information += " (%1.2f)" % diff.value
         information += "\n"
         information += _("Number of moves instantly fillable by elimination: ")
         information += str(int(diff.instant_elimination_fillable))
@@ -685,10 +685,10 @@ class UI (gconf_wrapper.GConfWrapper):
         information += "\n"
         information += _("Amount of trial-and-error required to solve: ")
         information += str(len(diff.guesses))
-        dialog_extras.show_message(parent=self.w,
-                                   title=_("Puzzle Statistics"),
-                                   label=_("Puzzle Statistics"),
-                                   sublabel=information)
+        dialog_extras.show_message(parent = self.w,
+                                   title = _("Puzzle Statistics"),
+                                   label = _("Puzzle Statistics"),
+                                   sublabel = information)
 
     @simple_debug
     def toggle_generator_cb (self, toggle):
@@ -712,7 +712,7 @@ class UI (gconf_wrapper.GConfWrapper):
         about.set_name(APPNAME)
         about.set_version(VERSION)
         about.set_copyright(COPYRIGHT)
-        about.set_license(LICENSE[0] + '\n\n' + LICENSE[1] + '\n\n' +LICENSE[2])
+        about.set_license(LICENSE[0] + '\n\n' + LICENSE[1] + '\n\n'  + LICENSE[2])
         about.set_wrap_license(True)
         about.set_comments(DESCRIPTION)
         about.set_authors(AUTHORS)
@@ -737,7 +737,7 @@ class UI (gconf_wrapper.GConfWrapper):
 
     @simple_debug
     def print_multiple_games (self, *args):
-        gp=printing.GamePrinter(self.sudoku_maker, self.gconf)
+        gp = printing.GamePrinter(self.sudoku_maker, self.gconf)
         gp.run_dialog()
 
     @simple_debug
@@ -755,7 +755,7 @@ class TrackerBox (gtk.VBox):
         self.main_ui = main_ui
         self.vb = self.builder.get_object('vbox1')
         self.vb.unparent()
-        self.pack_start(self.vb, expand=True, fill=True)
+        self.pack_start(self.vb, expand = True, fill = True)
         self.setup_actions()
         self.setup_tree()
         self.show_all()
@@ -764,7 +764,7 @@ class TrackerBox (gtk.VBox):
     def reset (self):
 
         for tree in self.tracker_model:
-            if tree[0]>-1:
+            if tree[0] > -1:
                 self.tracker_model.remove(tree.iter)
 
     @simple_debug
@@ -772,8 +772,8 @@ class TrackerBox (gtk.VBox):
         self.tracker_tree = self.builder.get_object('treeview1')
         self.tracker_model = gtk.ListStore(int, gtk.gdk.Pixbuf, str)
         self.tracker_tree.set_model(self.tracker_model)
-        col1 = gtk.TreeViewColumn("", gtk.CellRendererPixbuf(), pixbuf=1)
-        col2 = gtk.TreeViewColumn("", gtk.CellRendererText(), text=2)
+        col1 = gtk.TreeViewColumn("", gtk.CellRendererPixbuf(), pixbuf = 1)
+        col2 = gtk.TreeViewColumn("", gtk.CellRendererText(), text = 2)
         self.tracker_tree.append_column(col2)
         self.tracker_tree.append_column(col1)
         # Our initial row...
@@ -800,7 +800,7 @@ class TrackerBox (gtk.VBox):
         for action, widget_name in [('Clear', 'ClearTrackerButton'),
                                    ('Keep', 'KeepTrackerButton'),
                                    ]:
-            a=self.tracker_actions.get_action(action)
+            a = self.tracker_actions.get_action(action)
             a.connect_proxy(self.builder.get_object(widget_name))
         self.builder.get_object('AddTrackerButton').connect('clicked',
                                                           self.add_tracker)
@@ -818,7 +818,7 @@ class TrackerBox (gtk.VBox):
         self.tracker_tree.get_selection().select_iter(
             self.tracker_model.append([tracker_id,
                                   pixbuf,
-                                  _("Tracker %s")%(tracker_id+1)]
+                                  _("Tracker %s") % (tracker_id + 1)]
                                   )
             )
 
@@ -840,7 +840,7 @@ class TrackerBox (gtk.VBox):
     @simple_debug
     def select_tracker (self, tracker_id):
         for row in self.tracker_model:
-            if row[0]==tracker_id:
+            if row[0] == tracker_id:
                 self.tracker_tree.get_selection().select_iter(row.iter)
 
     @simple_debug
@@ -849,34 +849,34 @@ class TrackerBox (gtk.VBox):
         if itr:
             selected_tracker_id = mod.get_value(itr, 0)
         else:
-            selected_tracker_id=-1
+            selected_tracker_id = -1
         # This should be cheap since we don't expect many trackers...
         # We cycle through each row and toggle it off if it's not
         # selected; on if it is selected
         for row in self.tracker_model:
             tid = row[0]
             if tid != -1: # -1 == no tracker
-                self.main_ui.gsd.toggle_tracker(tid, tid==selected_tracker_id)
+                self.main_ui.gsd.toggle_tracker(tid, tid == selected_tracker_id)
         self.tracker_actions.set_sensitive(selected_tracker_id != -1)
 
     @simple_debug
     def clear_cb (self, action):
-        mod, itr=self.tracker_tree.get_selection().get_selected()
+        mod, itr = self.tracker_tree.get_selection().get_selected()
         # This should only be called if there is an itr, but we'll
         # double-check just in case.
         if itr:
-            selected_tracker_id=mod.get_value(itr, 0)
+            selected_tracker_id = mod.get_value(itr, 0)
             self.tracker_delete_tracks(selected_tracker_id)
 
     @simple_debug
     def keep_cb (self, action):
-        mod, itr=self.tracker_tree.get_selection().get_selected()
-        selected_tracker_id=mod.get_value(itr, 0)
+        mod, itr = self.tracker_tree.get_selection().get_selected()
+        selected_tracker_id = mod.get_value(itr, 0)
         self.tracker_keep_tracks(selected_tracker_id)
 
     @simple_debug
     def tracker_delete_tracks (self, tracker_id):
-        clearer=Undo.UndoableObject(
+        clearer = Undo.UndoableObject(
             lambda *args: self.main_ui.cleared.append(self.main_ui.gsd.delete_by_tracker(tracker_id)),
             lambda *args: [self.main_ui.gsd.add_value(*entry) for entry in self.main_ui.cleared.pop()],
             self.main_ui.history)
@@ -884,7 +884,7 @@ class TrackerBox (gtk.VBox):
 
     @simple_debug
     def tracker_keep_tracks (self, tracker_id):
-        clearer=Undo.UndoableObject(
+        clearer = Undo.UndoableObject(
             lambda *args: self.main_ui.cleared.append(self.main_ui.gsd.delete_except_for_tracker(tracker_id)),
             lambda *args: [self.main_ui.gsd.add_value(*entry) for entry in self.main_ui.cleared.pop()],
             self.main_ui.history)
