public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:master commit in: games-board/rmahjong/files/
@ 2020-10-28 15:27 Andrew Ammerlaan
  0 siblings, 0 replies; only message in thread
From: Andrew Ammerlaan @ 2020-10-28 15:27 UTC (permalink / raw
  To: gentoo-commits

commit:     549434473ec0f1fe1d7b221b9569095b37662e89
Author:     Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
AuthorDate: Tue Oct 27 21:32:44 2020 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Tue Oct 27 21:32:44 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=54943447

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 <AT> yandex.ru>

 .../files/rmahjong-0.4_fix_python3_compat.patch    | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

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 62ec68e7..0fd0de1e 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-28 15:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-28 15:27 [gentoo-commits] repo/proj/guru:master commit in: games-board/rmahjong/files/ Andrew Ammerlaan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox