Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-07-31 05:29:23 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-07-31 05:29:23 (GMT)
commit66e9a7713c3d3a1918817925709f114faec5a61e (patch)
tree4659e90cde17ce8e68a00cae78bba7d5b981efc1
parentbaad898616a60a5fbafbd37de3dfcb5c1c3c72b8 (diff)
pep8 cleanupv3
-rw-r--r--GNUChessActivity.py13
-rw-r--r--chess.py12
2 files changed, 12 insertions, 13 deletions
diff --git a/GNUChessActivity.py b/GNUChessActivity.py
index 4134a81..1e8648f 100644
--- a/GNUChessActivity.py
+++ b/GNUChessActivity.py
@@ -159,7 +159,7 @@ class GNUChessActivity(activity.Activity):
self.view_toolbar.show()
toolbox.toolbar.insert(view_toolbar_button, -1)
view_toolbar_button.show()
-
+
adjust_toolbar_button = ToolbarButton(label=_('Adjust'),
page=self.adjust_toolbar,
icon_name=\
@@ -412,7 +412,6 @@ class GNUChessActivity(activity.Activity):
cb_arg='black_king',
tooltip=_('Black King'))
-
def do_default_skin_cb(self, button=None):
self._gnuchess.reskin_from_file('black_king',
'%s/icons/black-king.svg' % (activity.get_bundle_path()))
@@ -474,9 +473,9 @@ class GNUChessActivity(activity.Activity):
def do_custom_skin_cb(self, button=None):
for piece in ['white_pawn', 'black_pawn',
- 'white_rook', 'black_rook',
+ 'white_rook', 'black_rook',
'white_knight', 'black_knight',
- 'white_bishop', 'black_bishop',
+ 'white_bishop', 'black_bishop',
'white_queen', 'black_queen',
'white_king', 'black_king']:
if piece in self.metadata:
@@ -490,11 +489,11 @@ class GNUChessActivity(activity.Activity):
if self._gnuchess.we_are_sharing and self.buddy is not None:
if 'white' in piece and self.playing_white:
pixbuf = self._gnuchess.reskin_from_file(
- piece, file_path, return_pixbuf= True)
+ piece, file_path, return_pixbuf=True)
self.send_piece(piece, pixbuf)
elif 'black' in piece and not self.playing_white:
pixbuf = self._gnuchess.reskin_from_file(
- piece, file_path, return_pixbuf= True)
+ piece, file_path, return_pixbuf=True)
self.send_piece(piece, pixbuf)
else:
self._gnuchess.reskin_from_file(piece, file_path)
@@ -534,7 +533,7 @@ class GNUChessActivity(activity.Activity):
move_list = self._parse_move_list(clipboard.wait_for_text())
if move_list is not None:
self._gnuchess.restore_game(move_list)
-
+
def _parse_move_list(self, text):
''' Take a standard game description and return a move list '''
# Assuming of form ... 1. e4 e6 2. ...
diff --git a/chess.py b/chess.py
index a05f298..b15a669 100644
--- a/chess.py
+++ b/chess.py
@@ -272,7 +272,7 @@ class Gnuchess():
def restore_game(self, move_list):
self.move_list = []
-
+
for move in move_list:
self.move_list.append(str(move))
@@ -314,9 +314,9 @@ class Gnuchess():
if '31.' in self.game:
j = self.game.index('31.')
self.bg[1].set_label(self.game[i: j - 1])
- self.bg[2].set_label(self.game[j: ])
+ self.bg[2].set_label(self.game[j:])
else:
- self.bg[1].set_label(self.game[i: ])
+ self.bg[1].set_label(self.game[i:])
else:
self.bg[0].set_label(self.game)
self._activity.showing_game_history = True
@@ -348,7 +348,7 @@ class Gnuchess():
spr = self._sprites.find_sprite((x, y))
if spr == None or spr.type == None:
return
-
+
if self._thinking: # Robot is thinking or conjuring up a hint
self._wait_your_turn()
return
@@ -775,7 +775,7 @@ class Gnuchess():
def _search_for_rook(
self, piece, source_file, source_rank, capture_file, capture_rank):
# Change rank
- if len(self.move_list) % 2 == 1: # if piece in 'rq':
+ if len(self.move_list) % 2 == 1:
for r in range(7 - RANKS.index(capture_rank)):
i = self._file_and_rank_to_index('%s%s' % (
capture_file, RANKS[RANKS.index(capture_rank) + r + 1]))
@@ -1437,7 +1437,7 @@ class Gnuchess():
y = yo
return ('%s%d' % (FILES[int((pos[0] - xo) / self.scale)],
8 - int((pos[1] - yo) / self.scale)))
-
+
def _expose_cb(self, win, event):
self.do_expose_event(event)