[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kajongg/sid] src: a few minor things: remove obsolete TODOS, commented code, unused imports
From:       Wolfgang Rohdewald <wolfgang () rohdewald ! de>
Date:       2013-10-31 21:21:07
Message-ID: E1Vbzfv-0002lj-HL () scm ! kde ! org
[Download RAW message or body]

Git commit 58ffef298afbbfd314cfcbe0ae79f8293069df01 by Wolfgang Rohdewald.
Committed on 29/10/2013 at 22:29.
Pushed by wrohdewald into branch 'sid'.

a few minor things: remove obsolete TODOS, commented code, unused imports

M  +1    -1    src/board.py
M  +1    -1    src/humanclient.py
M  +1    -3    src/player.py
M  +0    -1    src/playfield.py
M  +5    -8    src/server.py
M  +1    -6    src/uitile.py

http://commits.kde.org/kajongg/58ffef298afbbfd314cfcbe0ae79f8293069df01

diff --git a/src/board.py b/src/board.py
index bf0349b..c235b24 100644
--- a/src/board.py
+++ b/src/board.py
@@ -1013,7 +1013,7 @@ class MJScene(QGraphicsScene):
     def placeFocusRect(self):
         """show a blue rect around tile"""
         board = self._focusBoard
-        if board and board.isVisible() and board.focusTile:
+        if isAlive(board) and board.isVisible() and board.focusTile:
             rect = board.tileFaceRect()
             rect.setWidth(rect.width()*board.focusRectWidth())
             self.focusRect.setRect(rect)
diff --git a/src/humanclient.py b/src/humanclient.py
index 149e05c..f4c67f4 100644
--- a/src/humanclient.py
+++ b/src/humanclient.py
@@ -804,7 +804,7 @@ class HumanClient(Client):
     def logout(self, dummyResult=None):
         """clean visual traces and logout from server"""
         def loggedout(result, connection):
-            """TODO: do we need this?"""
+            """end the connection from client side"""
             connection.connector.disconnect()
             return result
         if self.connection:
diff --git a/src/player.py b/src/player.py
index 78037e2..535f514 100644
--- a/src/player.py
+++ b/src/player.py
@@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 import sys, weakref
 from collections import defaultdict
 
-from util import logException, logWarning, m18n, m18nc, m18nE, logDebug
+from util import logException, logWarning, m18n, m18nc, m18nE
 from common import WINDS, Internal, IntDict, Debug
 from query import Transaction, Query
 from tile import Tile, elements
@@ -732,8 +732,6 @@ class PlayingPlayer(Player):
         self._exposedMelds.append(meld)
         self._hand = None
         game.computeDangerous(self)
-#        adding = [calledTile] if calledTile else None TODO: warum habe ich das entfernt?
-#        self.syncHandBoard(adding=adding)
         return meld
 
     def findDangerousTiles(self):
diff --git a/src/playfield.py b/src/playfield.py
index de76297..d6ed7a2 100644
--- a/src/playfield.py
+++ b/src/playfield.py
@@ -1046,7 +1046,6 @@ class PlayField(KXmlGuiWindow):
         else:
             Internal.autoPlay = checked
             if checked:
-                # TODO: use the last used ruleset. Right now it always takes the first of the list.
                 self.playGame()
 
     def __scoringClosed(self):
diff --git a/src/server.py b/src/server.py
index 5d69337..012a498 100644
--- a/src/server.py
+++ b/src/server.py
@@ -371,10 +371,10 @@ class ServerTable(Table):
         wallSize = len(self.game.wall.tiles)
         self.game.wall.tiles = []
         for _ in range(wallSize):
-            element = elementIter.next() # TODO: make this return a Tile
-            if element[0] not in 'fy':
-                element = element.capitalize()
-            self.game.wall.tiles.append(Tile(element))
+            tile = elementIter.next()
+            if not tile.isBonus():
+                tile = tile.capitalize()
+            self.game.wall.tiles.append(tile)
         assert isinstance(self.game, PlayingGame), self.game
         self.running = True
         self.__adaptOtherTables()
@@ -1036,10 +1036,7 @@ class MJServer(object):
             " and exists(select 1 from score where game=g.id)" \
             " and s.scoretime = (select max(scoretime) from score where game=g.id) limit 10",
             list([user.name, user.name, user.name, user.name]))
-        for gameid, starttime, seed, ruleset, suspendTime in query.records:
-            assert starttime, query.records
-#            if not starttime:
-                # TODO: why do we get a record with empty fields when the query should return nothing?
+        for gameid, _, seed, ruleset, suspendTime in query.records:
             if gameid not in (x.game.gameid for x in self.tables.values() if x.game):
                 table = ServerTable(self, None, ruleset, suspendTime, playOpen=False,
                     autoPlay=False, wantedGame=str(seed))
diff --git a/src/uitile.py b/src/uitile.py
index 0212c9b..684426b 100644
--- a/src/uitile.py
+++ b/src/uitile.py
@@ -436,12 +436,7 @@ class UIMeld(list):
     """represents a visible meld. Can be empty. Many Meld methods will
     raise exceptions if the meld is empty. But we do not care,
     those methods are not supposed to be called on empty melds.
-    UIMeld is a list of UITile.
-
-    TODO: testen:
-    The name of the tile element in the meld does not have to be
-    identical with the name of the corresponding real tile while tiles
-    are added or removed. See end of SelectorBoard.meldVariants()."""
+    UIMeld is a list of UITile"""
 
     __hash__ = None
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic