1 |
commit: 549434473ec0f1fe1d7b221b9569095b37662e89 |
2 |
Author: Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru> |
3 |
AuthorDate: Tue Oct 27 21:32:44 2020 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> |
5 |
CommitDate: Tue Oct 27 21:32:44 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=54943447 |
7 |
|
8 |
games-board/rmahjong: revert deletion passing literal to int() in patch |
9 |
|
10 |
The following or similar error still takes place |
11 |
under certain conditions on score screen: |
12 |
|
13 |
File "... /rmahjong/client/states.py", line 558, in get_results |
14 |
score = (int(self.message[wind + "_score"])) |
15 |
ValueError: invalid literal for int() with base 10: '27100.0' |
16 |
|
17 |
so restore part of patch to fix passing literal to int(). |
18 |
|
19 |
Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru> |
20 |
|
21 |
.../files/rmahjong-0.4_fix_python3_compat.patch | 32 ++++++++++++++++++++++ |
22 |
1 file changed, 32 insertions(+) |
23 |
|
24 |
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 |
25 |
index 62ec68e7..0fd0de1e 100644 |
26 |
--- a/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch |
27 |
+++ b/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch |
28 |
@@ -1,3 +1,35 @@ |
29 |
+diff --git a/client/client.py b/client/client.py |
30 |
+--- a/client/client.py |
31 |
++++ b/client/client.py |
32 |
+@@ -138,10 +138,10 @@ class Mahjong: |
33 |
+ |
34 |
+ def init_player_boxes(self, names, player_winds, score): |
35 |
+ self.player_boxes = [ |
36 |
+- PlayerBox((50, 700), names[0], player_winds[0], int(score[0]), direction_up, (0,-80)), |
37 |
+- PlayerBox((954, 50), names[1], player_winds[1], int(score[1]), direction_left, (-210, 0)), |
38 |
+- PlayerBox((700, 0), names[2], player_winds[2], int(score[2]), direction_up, (0,80)), |
39 |
+- PlayerBox((0, 50), names[3], player_winds[3], int(score[3]), direction_right, (80,0)) ] |
40 |
++ PlayerBox((50, 700), names[0], player_winds[0], int(float(score[0])), direction_up, (0,-80)), |
41 |
++ PlayerBox((954, 50), names[1], player_winds[1], int(float(score[1])), direction_left, (-210, 0)), |
42 |
++ PlayerBox((700, 0), names[2], player_winds[2], int(float(score[2])), direction_up, (0,80)), |
43 |
++ PlayerBox((0, 50), names[3], player_winds[3], int(float(score[3])), direction_right, (80,0)) ] |
44 |
+ for widget in self.player_boxes: |
45 |
+ self.gui.add_widget(widget) |
46 |
+ |
47 |
+diff --git a/client/states.py b/client/states.py |
48 |
+--- a/client/states.py |
49 |
++++ b/client/states.py |
50 |
+@@ -555,8 +555,8 @@ class ScoreState(RoundPreparingState): |
51 |
+ results = [] |
52 |
+ for wind in winds: |
53 |
+ name = (self.mahjong.get_player_name(wind)) |
54 |
+- score = (int(self.message[wind + "_score"])) |
55 |
+- payment = (int(self.message[wind + "_payment"])) |
56 |
++ score = (int(float(self.message[wind + "_score"]))) |
57 |
++ payment = (int(float(self.message[wind + "_payment"]))) |
58 |
+ results.append((name, score, payment)) |
59 |
+ results.sort(key = lambda r: r[1], reverse = True) |
60 |
+ return results |
61 |
diff --git a/client/tilepainter.py b/client/tilepainter.py |
62 |
--- a/client/tilepainter.py |
63 |
+++ b/client/tilepainter.py |