diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-09-03 14:17:52 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-09-03 14:17:52 (GMT) |
commit | 83532aa6f2ac611d9f7e07c741ce4beb1dcba1b3 (patch) | |
tree | b278ed32dc5afaa31fbf614a1fb6ad159b4d0812 | |
parent | 5750131ed36306b65a896c4b3b883deced96a91a (diff) |
don't load bad boards
-rw-r--r-- | chess.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -243,7 +243,7 @@ class Gnuchess(): while find(output, target) > 0: output = output[find(output, target):] output = output[find(output, '\n'):] - if len(output) < 136: + if len(output) < 136 or output[0:3] == 'GNU': self._activity.status.set_label('???') else: self._load_board(output) @@ -468,6 +468,9 @@ class Gnuchess(): # Get game notation from last move to share and to check for # check, checkmate self.move(GAME) + if self.game == '': + _logger.debug('bad move: reseting') + return True last_move = self.game.split()[-1] if self.we_are_sharing: self._activity.send_event('m|%s' % (last_move)) |