Subject: [kajongg/Applications/16.12] src: Keypress on a
tile: Replace assertion about focus by logDebug,
this still sometimes happens



Git commit 6aea8041b130f60d70024aa5156b5977444f8cf1 by Wolfgang Rohdewald.
Committed on 12/12/2016 at 20:55.
Pushed by wrohdewald into branch 'Applications/16.12'.

Keypress on a tile: Replace assertion about focus by logDebug, this still
sometimes happens

and I do not know why

M +4 -3 src/uitile.py

https://commits.kde.org/kajongg/6aea8041b130f60d70024aa5156b5977444f8cf1

diff --git a/src/uitile.py b/src/uitile.py
index fe2ae77c..3a18f9c8 100644
--- a/src/uitile.py
+++ b/src/uitile.py
@@ -22,7 +22,7 @@ from qt import QString, Qt, QRectF, QPointF, QSizeF, QSize,
pyqtProperty
from qt import QGraphicsObject, QGraphicsItem, QPixmap, QPainter, QColor

from util import stack
-from log import logException, logDebug
+from log import logException, logDebug, id4
from guiutil import Painter
from common import LIGHTSOURCES, ZValues, Internal, Debug, isAlive
from common import StrMixin
@@ -69,8 +69,9 @@ class UITile(QGraphicsObject, StrMixin):

def keyPressEvent(self, event):
"""redirect to the board"""
- assert self == self.board.focusTile, 'id(self):%s, self:%s,
focusTile:%s/%s' % \
- (id(self), self, id(self.board.focusTile), self.board.focusTile)
+ if self is not self.board.focusTile:
+ logDebug('id4(self):%s, self:%s, focusTile:%s/%s' % \
+ (id4(self), self, id4(self.board.focusTile),
self.board.focusTile))
return self.board.keyPressEvent(event)

def __lightDistance(self):


Programming list archiving by: Enterprise Git Hosting