aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Torokhov <torokhov-s-a@yandex.ru>2020-10-28 00:32:44 +0300
committerSergey Torokhov <torokhov-s-a@yandex.ru>2020-10-28 00:32:44 +0300
commit549434473ec0f1fe1d7b221b9569095b37662e89 (patch)
tree6902c7fd9581b6da0b886708b0e9366b3d9fe6c6
parentdev-python/hwi: version bump to 1.2.0 (diff)
downloadguru-549434473ec0f1fe1d7b221b9569095b37662e89.tar.gz
guru-549434473ec0f1fe1d7b221b9569095b37662e89.tar.bz2
guru-549434473ec0f1fe1d7b221b9569095b37662e89.zip
games-board/rmahjong: revert deletion passing literal to int() in patch
The following or similar error still takes place under certain conditions on score screen: File "... /rmahjong/client/states.py", line 558, in get_results score = (int(self.message[wind + "_score"])) ValueError: invalid literal for int() with base 10: '27100.0' so restore part of patch to fix passing literal to int(). Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
-rw-r--r--games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch b/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch
index 62ec68e..0fd0de1 100644
--- a/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch
+++ b/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch
@@ -1,3 +1,35 @@
+diff --git a/client/client.py b/client/client.py
+--- a/client/client.py
++++ b/client/client.py
+@@ -138,10 +138,10 @@ class Mahjong:
+
+ def init_player_boxes(self, names, player_winds, score):
+ self.player_boxes = [
+- PlayerBox((50, 700), names[0], player_winds[0], int(score[0]), direction_up, (0,-80)),
+- PlayerBox((954, 50), names[1], player_winds[1], int(score[1]), direction_left, (-210, 0)),
+- PlayerBox((700, 0), names[2], player_winds[2], int(score[2]), direction_up, (0,80)),
+- PlayerBox((0, 50), names[3], player_winds[3], int(score[3]), direction_right, (80,0)) ]
++ PlayerBox((50, 700), names[0], player_winds[0], int(float(score[0])), direction_up, (0,-80)),
++ PlayerBox((954, 50), names[1], player_winds[1], int(float(score[1])), direction_left, (-210, 0)),
++ PlayerBox((700, 0), names[2], player_winds[2], int(float(score[2])), direction_up, (0,80)),
++ PlayerBox((0, 50), names[3], player_winds[3], int(float(score[3])), direction_right, (80,0)) ]
+ for widget in self.player_boxes:
+ self.gui.add_widget(widget)
+
+diff --git a/client/states.py b/client/states.py
+--- a/client/states.py
++++ b/client/states.py
+@@ -555,8 +555,8 @@ class ScoreState(RoundPreparingState):
+ results = []
+ for wind in winds:
+ name = (self.mahjong.get_player_name(wind))
+- score = (int(self.message[wind + "_score"]))
+- payment = (int(self.message[wind + "_payment"]))
++ score = (int(float(self.message[wind + "_score"])))
++ payment = (int(float(self.message[wind + "_payment"])))
+ results.append((name, score, payment))
+ results.sort(key = lambda r: r[1], reverse = True)
+ return results
diff --git a/client/tilepainter.py b/client/tilepainter.py
--- a/client/tilepainter.py
+++ b/client/tilepainter.py