mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-18 19:43:24 -04:00
Merge updates from master
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
DIST sphinxcontrib-katex-0.6.0.tar.gz 12854 BLAKE2B a21894a347fbb2639d06e0e91b56ce0774894d72eaae039353a6c94d3c01a3a9d4bcda8c09b0ca871bec3c7246fbad536031d5063be95f178f5f1b373a95c0ab SHA512 abe580f45fa366870b2dff37af18fac569f5f23ce0a8c44de9765ad757e2804899f75606f40dc64994714ba12b324a2ed1b17322fbd1870447e225d2c65d86a0
|
||||
DIST sphinxcontrib-katex-0.6.1.tar.gz 12948 BLAKE2B 8de0eb26025b89006f5db0dcae0d878dd90f0298bc35d72dc2b97741bb85f858d4988e9f094be3769eed7af45f39891ae693cb997879543851077b5c39609a8c SHA512 c50d895b7e0262a8beb04dabfa13d104c896a0be135be551bd90c2bcf1662895ae50adab7cf11b259f6264a265421af9ba4ad1d896f1ef58c6c8fd109b570d2b
|
||||
DIST sphinxcontrib-katex-0.7.1.tar.gz 13171 BLAKE2B f6febea4b6543309f1af38efdedadbe388bf94b890b92a9fbe069b8a2dcccb5790dafcd4c7eb1afeef5fa5701886320d73e568c7edb248683c55580a7940c208 SHA512 f995f962d3fe18be8acbd57d1de8079471240d513b4dfb068b7701d2a14dd93c0547056118261046ddde2fafdfd4d07c75c75b1c2f5b7fe1adcbea17db8ab65a
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
PYTHON_COMPAT=( python3_{7,8} pypy3 )
|
||||
PYTHON_COMPAT=( python3_{6,7,8} pypy3 )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
PYTHON_COMPAT=( python3_{7,8} pypy3 )
|
||||
PYTHON_COMPAT=( python3_{6,7,8} pypy3 )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
@@ -14,7 +14,7 @@ LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
RDEPEND=">=dev-python/sphinx-1.7.5[${PYTHON_USEDEP}]"
|
||||
RDEPEND=">=dev-python/sphinx-2.4.4[${PYTHON_USEDEP}]"
|
||||
|
||||
DOCS=()
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
DIST kmahjongg_rmahjong.png 3816 BLAKE2B 8029e6c3f4eddff9d3593ad7d5615860cd3b9d9bc4b067145e2d191b8fec00f934f3752adec32db11eb7f3e31eba7d4586a2c2f005de4ded8555ec73a4f2f81f SHA512 49cb371b1260aa23bb7b341247047cf7abc59487fd75cc365c2c6f77588af7a83dfed73d7fc1845edcedb8a9b6810ac39dbecff065c3799e3fcc7195df84e67c
|
||||
DIST rmahjong-0.4_p20201013.tar.gz 1399540 BLAKE2B 9dd1c40fea7c2d93e33a7bea0e1b66912eb547c64b45bbeadd95e4234380786551005cec8bf5edc1a7e8b135e5a66b2af80b4f22d257e14aa7068ff9959cee64 SHA512 9eface62972abe37753c380af713e168d39e23f6031af08d735467669b2dd0cbe5dec40eb9e750fff675a054791a58cfad710266229c966d94c190990f63c466
|
||||
DIST rmahjong-0.4_p20201106.tar.gz 1399585 BLAKE2B c5b63e6b149945cece8d1a4bfc99b468876979161f2461b36acb8db7a5f6292a4d1e7f97079319f3b71fa32804d6135a83e102fd870f3cd86556e45c75b532fb SHA512 d311b025eb7d35e4523f139c8a0703c894b730b2da3a173930f5eeb36e7f7a9889b4caf8ccaa8b1683f10b47461c608ae49a0ba0657bb58bf8cb55f8ba66ed38
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
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
|
||||
@@ -89,7 +89,7 @@ class TilePainter:
|
||||
img = self.tile_images[name]
|
||||
w = img.get_width()
|
||||
h = img.get_height()
|
||||
- screen.blit(pygame.transform.smoothscale(img, (w/4, h/4)), position)
|
||||
+ screen.blit(pygame.transform.smoothscale(img, (w//4, h//4)), position)
|
||||
|
||||
def draw_tile_list(self, screen, position, tile_names, space = 0):
|
||||
for i, tile_name in enumerate(tile_names):
|
||||
diff --git a/server/botengine.py b/server/botengine.py
|
||||
index 03623f9..b128135 100644
|
||||
--- a/server/botengine.py
|
||||
+++ b/server/botengine.py
|
||||
@@ -71,7 +71,7 @@ class BotEngine():
|
||||
|
||||
def get_tiles(self, blocking = False):
|
||||
if self._is_next_line() or blocking:
|
||||
- return map(Tile, (self._read_line().strip().split()))
|
||||
+ return [*map(Tile, (self._read_line().strip().split()))]
|
||||
else:
|
||||
return None
|
||||
|
||||
diff --git a/server/eval.py b/server/eval.py
|
||||
index 042ee54..dc7e463 100644
|
||||
--- a/server/eval.py
|
||||
+++ b/server/eval.py
|
||||
@@ -19,6 +19,7 @@ from tile import Pon, Chi
|
||||
from tile import red_dragon, white_dragon, green_dragon, dragons
|
||||
from tile import bamboos, chars, pins, all_tiles, honors
|
||||
from copy import copy
|
||||
+import functools
|
||||
|
||||
def is_hand_open(sets):
|
||||
for set in sets:
|
||||
@@ -97,14 +97,14 @@
|
||||
|
||||
if wintype == "Ron":
|
||||
if player_wind.name == "WE":
|
||||
- return (name, round_to_base(score / 2 * 3, 100))
|
||||
+ return (name, round_to_base(score // 2 * 3, 100))
|
||||
else:
|
||||
return (name, score)
|
||||
else:
|
||||
if player_wind.name == "WE":
|
||||
- return (name, (round_to_base(score / 2, 100), 0))
|
||||
+ return (name, (round_to_base(score // 2, 100), 0))
|
||||
else:
|
||||
- return (name, (round_to_base(score / 4, 100), round_to_base(score / 2, 100)))
|
||||
+ return (name, (round_to_base(score // 4, 100), round_to_base(score // 2, 100)))
|
||||
|
||||
def quick_pons_and_kans(hand):
|
||||
d = {}
|
||||
@@ -274,7 +275,7 @@ def eval_sets(pair, sets, round_wind, player_wind, last_tile, wintype):
|
||||
# Other hands
|
||||
for name, fn in score_functions:
|
||||
score = fn(pair, sets)
|
||||
- if score > 0:
|
||||
+ if score:
|
||||
result.append((name, score))
|
||||
|
||||
# Pinfu
|
||||
@@ -304,7 +305,7 @@ def eval_sets(pair, sets, round_wind, player_wind, last_tile, wintype):
|
||||
|
||||
|
||||
def sum_over_sets(sets, fn):
|
||||
- return reduce(lambda a, s: fn(s) + a, sets, 0)
|
||||
+ return functools.reduce(lambda a, s: fn(s) + a, sets, 0)
|
||||
|
||||
def for_all_tiles_in_sets(sets, fn):
|
||||
return for_all_sets(sets, lambda s: s.all_tiles(fn))
|
||||
@@ -1,296 +0,0 @@
|
||||
diff a/server/botengine.py b/server/botengine.py
|
||||
--- a/server/botengine.py
|
||||
+++ b/server/botengine.py
|
||||
@@ -53,7 +53,10 @@
|
||||
|
||||
def shutdown(self):
|
||||
self.thread.thread_quit = True
|
||||
+ self.process.stdin.close()
|
||||
+ self.process.stdout.close()
|
||||
self.process.terminate()
|
||||
+ self.process.wait()
|
||||
#self._write("QUIT\n")
|
||||
#self.join()
|
||||
|
||||
diff --git a/server/test.py b/server/test.py
|
||||
--- a/server/test.py
|
||||
+++ b/server/test.py
|
||||
@@ -25,7 +25,7 @@ from botengine import BotEngine
|
||||
|
||||
|
||||
def tiles(strs):
|
||||
- return map(Tile, strs)
|
||||
+ return [*map(Tile, strs)]
|
||||
|
||||
|
||||
def chi(tile_name):
|
||||
@@ -156,52 +156,52 @@ class EvalHandTestCase(TestCase):
|
||||
hand, sets, r = h
|
||||
score = count_of_tiles_yaku(tiles(hand), sets, [], Tile("XX"), Tile("XX"), "Ron")
|
||||
yaku = find_tiles_yaku(tiles(hand), sets, [], Tile("XX"), Tile("XX"), "Ron")
|
||||
- self.assert_(score == r, "Hand %i returned score %i %s hand=%s" % (hand_id, score, yaku, hand))
|
||||
+ self.assertTrue(score == r, "Hand %i returned score %i %s hand=%s" % (hand_id, score, yaku, hand))
|
||||
|
||||
hand = [ "WE", "C2", "C3", "C4", "WN", "WN", "WN", "DR", "B9", "DR", "B8", "B7", "WE", "WE" ]
|
||||
sets = []
|
||||
- self.assertEquals(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WN"), "Ron"), 2)
|
||||
- self.assertEquals(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WN"), "Tsumo"), 3)
|
||||
- self.assertEquals(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WE"), "Ron"), 2)
|
||||
- self.assertEquals(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WS"), "Ron"), 1)
|
||||
+ self.assertEqual(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WN"), "Ron"), 2)
|
||||
+ self.assertEqual(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WN"), "Tsumo"), 3)
|
||||
+ self.assertEqual(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WE"), "Ron"), 2)
|
||||
+ self.assertEqual(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WS"), "Ron"), 1)
|
||||
hand = [ "WE", "DW", "DW", "DW", "C4", "C2", "C3", "DR", "B9", "DR", "B8", "B7", "WE", "WE" ]
|
||||
- self.assertEquals(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WS"), "Ron"), 2)
|
||||
+ self.assertEqual(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WS"), "Ron"), 2)
|
||||
hand,sets = ([ "C4", "C5", "C6", "C7", "B7", "B8", "B9", "P2", "P3", "P4", "C4"], [kan("WS")])
|
||||
- self.assertEquals(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WS"), "Ron"), 1)
|
||||
+ self.assertEqual(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WS"), "Ron"), 1)
|
||||
hand,sets = ([ "C4", "C5", "C6", "C7", "B7", "B8", "B9", "P2", "P3", "P4", "C4"], [ckan("WS")])
|
||||
- self.assertEquals(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WS"), "Ron"), 1)
|
||||
+ self.assertEqual(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WS"), "Ron"), 1)
|
||||
|
||||
hand = [ "WN", "B9", "B6", "WN", "B4", "B8", "B5", "B7"]
|
||||
sets = [chi("B1"), chi("P5")]
|
||||
- self.assertEquals(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WW"), "Ron"), 1)
|
||||
- self.assertEquals(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WW"), "Tsumo"), 1)
|
||||
+ self.assertEqual(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WW"), "Ron"), 1)
|
||||
+ self.assertEqual(count_of_tiles_yaku(tiles(hand), sets, [], Tile("WE"), Tile("WW"), "Tsumo"), 1)
|
||||
|
||||
def test_basic_payment(self):
|
||||
- self.assert_(compute_payment(2, 40, "Ron", Tile("WN")) == ("", 2600))
|
||||
- self.assert_(compute_payment(2, 40, "Ron", Tile("WE")) == ("", 3900))
|
||||
- self.assertEquals(compute_payment(2, 40, "Tsumo", Tile("WN")), ("", (700,1300)))
|
||||
- self.assertEquals(compute_payment(2, 40, "Tsumo", Tile("WE")), ("", (1300, 0)))
|
||||
+ self.assertTrue(compute_payment(2, 40, "Ron", Tile("WN")) == ("", 2600))
|
||||
+ self.assertTrue(compute_payment(2, 40, "Ron", Tile("WE")) == ("", 3900))
|
||||
+ self.assertEqual(compute_payment(2, 40, "Tsumo", Tile("WN")), ("", (700,1300)))
|
||||
+ self.assertEqual(compute_payment(2, 40, "Tsumo", Tile("WE")), ("", (1300, 0)))
|
||||
|
||||
- self.assert_(compute_payment(1, 40, "Ron", Tile("WN")) == ("", 1300))
|
||||
- self.assert_(compute_payment(1, 40, "Ron", Tile("WE")) == ("", 2000))
|
||||
- self.assertEquals(compute_payment(1, 40, "Tsumo", Tile("WN")), ("", (400, 700)))
|
||||
- self.assertEquals(compute_payment(1, 40, "Tsumo", Tile("WE")), ("", (700, 0)))
|
||||
+ self.assertTrue(compute_payment(1, 40, "Ron", Tile("WN")) == ("", 1300))
|
||||
+ self.assertTrue(compute_payment(1, 40, "Ron", Tile("WE")) == ("", 2000))
|
||||
+ self.assertEqual(compute_payment(1, 40, "Tsumo", Tile("WN")), ("", (400, 700)))
|
||||
+ self.assertEqual(compute_payment(1, 40, "Tsumo", Tile("WE")), ("", (700, 0)))
|
||||
|
||||
- self.assertEquals(compute_payment(4, 20, "Tsumo", Tile("WN")), ("", (1300, 2600)))
|
||||
- self.assertEquals(compute_payment(4, 20, "Tsumo", Tile("WE")), ("", (2600, 0)))
|
||||
+ self.assertEqual(compute_payment(4, 20, "Tsumo", Tile("WN")), ("", (1300, 2600)))
|
||||
+ self.assertEqual(compute_payment(4, 20, "Tsumo", Tile("WE")), ("", (2600, 0)))
|
||||
|
||||
- self.assertEquals(compute_payment(3, 20, "Tsumo", Tile("WN")), ("", (700, 1300)))
|
||||
- self.assertEquals(compute_payment(3, 20, "Tsumo", Tile("WE")), ("", (1300, 0)))
|
||||
+ self.assertEqual(compute_payment(3, 20, "Tsumo", Tile("WN")), ("", (700, 1300)))
|
||||
+ self.assertEqual(compute_payment(3, 20, "Tsumo", Tile("WE")), ("", (1300, 0)))
|
||||
|
||||
- self.assertEquals(compute_payment(5, 40, "Ron", Tile("WN")), ("Mangan", 8000))
|
||||
- self.assertEquals(compute_payment(5, 40, "Ron", Tile("WE")), ("Mangan", 12000))
|
||||
- self.assertEquals(compute_payment(5, 40, "Tsumo", Tile("WN")), ("Mangan", (2000, 4000)))
|
||||
- self.assertEquals(compute_payment(5, 40, "Tsumo", Tile("WE")), ("Mangan", (4000, 0)))
|
||||
+ self.assertEqual(compute_payment(5, 40, "Ron", Tile("WN")), ("Mangan", 8000))
|
||||
+ self.assertEqual(compute_payment(5, 40, "Ron", Tile("WE")), ("Mangan", 12000))
|
||||
+ self.assertEqual(compute_payment(5, 40, "Tsumo", Tile("WN")), ("Mangan", (2000, 4000)))
|
||||
+ self.assertEqual(compute_payment(5, 40, "Tsumo", Tile("WE")), ("Mangan", (4000, 0)))
|
||||
|
||||
- self.assertEquals(compute_payment(13, 40, "Ron", Tile("WN")), ("Yakuman", 32000))
|
||||
- self.assertEquals(compute_payment(13, 40, "Ron", Tile("WE")), ("Yakuman", 48000))
|
||||
- self.assertEquals(compute_payment(13, 40, "Tsumo", Tile("WN")), ("Yakuman", (8000, 16000)))
|
||||
- self.assertEquals(compute_payment(13, 40, "Tsumo", Tile("WE")), ("Yakuman", (16000, 0)))
|
||||
+ self.assertEqual(compute_payment(13, 40, "Ron", Tile("WN")), ("Yakuman", 32000))
|
||||
+ self.assertEqual(compute_payment(13, 40, "Ron", Tile("WE")), ("Yakuman", 48000))
|
||||
+ self.assertEqual(compute_payment(13, 40, "Tsumo", Tile("WN")), ("Yakuman", (8000, 16000)))
|
||||
+ self.assertEqual(compute_payment(13, 40, "Tsumo", Tile("WE")), ("Yakuman", (16000, 0)))
|
||||
|
||||
def test_tenpai(self):
|
||||
hands = (([ "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "P1", "P1", "P1", "WN"], [], True, ["WN"]),
|
||||
@@ -215,10 +215,10 @@ class EvalHandTestCase(TestCase):
|
||||
([ "P1", "P2", "P3", "DR", "DR", "DR", "B7", "B9", "WN", "WN"], [ pon("P1") ], True, ["B8"]))
|
||||
|
||||
for h, sets, tenpai, w in hands:
|
||||
- self.assertEquals(hand_in_tenpai(tiles(h), sets), tenpai)
|
||||
+ self.assertEqual(hand_in_tenpai(tiles(h), sets), tenpai)
|
||||
waiting = [ t.name for t in find_waiting_tiles(tiles(h), sets) ]
|
||||
waiting.sort()
|
||||
- self.assertEquals(waiting, w)
|
||||
+ self.assertEqual(waiting, w)
|
||||
|
||||
def test_riichi(self):
|
||||
hands = (([ "P5", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "P1", "P1", "P1", "WN"], [], True),
|
||||
@@ -229,7 +229,7 @@ class EvalHandTestCase(TestCase):
|
||||
([ "P4", "P4", "P4", "C6", "C4", "C5", "B7", "B6", "B8", "B8", "DR" ], [ ckan("WE") ], True),
|
||||
([ "P4", "P4", "C6", "P3", "C5", "B7", "B6", "P1", "DR", "B8", "DR" ], [ ckan("WE") ], False))
|
||||
for h, sets, riichi in hands:
|
||||
- self.assertEquals(riichi_test(tiles(h), sets), riichi, [h,sets])
|
||||
+ self.assertEqual(riichi_test(tiles(h), sets), riichi, [h,sets])
|
||||
|
||||
def test_singlewait(self):
|
||||
# Last tile in the list comes last
|
||||
@@ -242,21 +242,21 @@ class EvalHandTestCase(TestCase):
|
||||
([ "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "P1", "P1", "P3", "P1", "P2"], [], True),
|
||||
([ "B1", "B2", "B3", "C8", "C8", "C8", "DW", "DW", "DW", "P4", "P4", "P1", "P2", "P3"], [], True))
|
||||
for h, sets, singlewait in hands:
|
||||
- self.assertEquals(check_single_waiting(tiles(h), sets), singlewait)
|
||||
+ self.assertEqual(check_single_waiting(tiles(h), sets), singlewait)
|
||||
|
||||
|
||||
def test_score(self):
|
||||
hand = [ "WN", "B9", "B6", "WN", "B4", "B8", "B5", "B7"]
|
||||
sets = [chi("B1"), chi("P5")]
|
||||
payment, scores, minipoints = compute_score(tiles(hand), sets, "Ron", ([], [ Tile("B7") ]), [], Tile("WE"), Tile("WW"))
|
||||
- self.assertEquals(payment, ('', 2000))
|
||||
- self.assertEquals(minipoints, 30)
|
||||
+ self.assertEqual(payment, ('', 2000))
|
||||
+ self.assertEqual(minipoints, 30)
|
||||
|
||||
hand = [ "C2", "C2", "C4", "C4", "C7", "C7", "B6", "B8", "B8", "C1", "C1", "WS", "WS", "B6"]
|
||||
sets = []
|
||||
payment, scores, minipoints = compute_score(tiles(hand), sets, "Ron", ([ Tile("C7") ], [ Tile("B5") ]), [], Tile("WS"), Tile("WW"))
|
||||
- self.assertEquals(payment, ('', 6400))
|
||||
- self.assertEquals(minipoints, 25)
|
||||
+ self.assertEqual(payment, ('', 6400))
|
||||
+ self.assertEqual(minipoints, 25)
|
||||
|
||||
|
||||
class BotEngineTestCase(TestCase):
|
||||
@@ -272,9 +272,9 @@ class BotEngineTestCase(TestCase):
|
||||
e.set_wall(4 * all_tiles)
|
||||
e.question_discard()
|
||||
action = e.get_string()
|
||||
- self.assert_(action == "Discard")
|
||||
+ self.assertTrue(action == "Discard")
|
||||
tile = e.get_tile()
|
||||
- self.assert_(tile in h)
|
||||
+ self.assertTrue(tile in h)
|
||||
finally:
|
||||
e.shutdown()
|
||||
|
||||
@@ -289,9 +289,9 @@ class BotEngineTestCase(TestCase):
|
||||
e.set_wall(4 * all_tiles)
|
||||
e.question_discard()
|
||||
action = e.get_string()
|
||||
- self.assert_(action == "Discard")
|
||||
+ self.assertTrue(action == "Discard")
|
||||
tile = e.get_tile()
|
||||
- self.assert_(tile in h)
|
||||
+ self.assertTrue(tile in h)
|
||||
finally:
|
||||
e.shutdown()
|
||||
|
||||
@@ -308,7 +308,7 @@ class BotEngineTestCase(TestCase):
|
||||
e.set_sets(sets)
|
||||
e.question_yaku()
|
||||
score = e.get_int()
|
||||
- self.assert_(score == r, "Hand %i returned score %i" % (hand_id, score))
|
||||
+ self.assertTrue(score == r, "Hand %i returned score %i" % (hand_id, score))
|
||||
|
||||
finally:
|
||||
e.shutdown()
|
||||
@@ -324,23 +324,23 @@ class BotEngineTestCase(TestCase):
|
||||
e.set_round_wind(Tile("WE"))
|
||||
e.set_player_wind(Tile("WN"))
|
||||
e.question_yaku()
|
||||
- self.assertEquals(e.get_int(), 2)
|
||||
+ self.assertEqual(e.get_int(), 2)
|
||||
|
||||
e.set_round_wind(Tile("WE"))
|
||||
e.set_player_wind(Tile("WE"))
|
||||
e.question_yaku()
|
||||
- self.assertEquals(e.get_int(), 2)
|
||||
+ self.assertEqual(e.get_int(), 2)
|
||||
|
||||
e.set_round_wind(Tile("WE"))
|
||||
e.set_player_wind(Tile("WS"))
|
||||
e.question_yaku()
|
||||
- self.assertEquals(e.get_int(), 1)
|
||||
+ self.assertEqual(e.get_int(), 1)
|
||||
|
||||
e.set_sets([ pon("DW") ])
|
||||
e.set_round_wind(Tile("WE"))
|
||||
e.set_player_wind(Tile("WS"))
|
||||
e.question_yaku()
|
||||
- self.assertEquals(e.get_int(), 2)
|
||||
+ self.assertEqual(e.get_int(), 2)
|
||||
|
||||
finally:
|
||||
e.shutdown()
|
||||
@@ -357,7 +357,7 @@ class BotEngineTestCase(TestCase):
|
||||
e.set_wall(wall)
|
||||
e.question_discard_tiles()
|
||||
tile_list = e.get_tiles()
|
||||
- self.assertEquals(tile_list, [Tile("B1"), Tile("B1"), Tile("B1")])
|
||||
+ self.assertEqual(tile_list, [Tile("B1"), Tile("B1"), Tile("B1")])
|
||||
finally:
|
||||
e.shutdown()
|
||||
|
||||
@@ -373,7 +373,7 @@ class BotEngineTestCase(TestCase):
|
||||
e.set_wall(wall)
|
||||
e.question_discard_tiles()
|
||||
tile_list = e.get_tiles()
|
||||
- self.assertEquals(tile_list, [Tile("DR")])
|
||||
+ self.assertEqual(tile_list, [Tile("DR")])
|
||||
finally:
|
||||
e.shutdown()
|
||||
|
||||
@@ -394,12 +394,12 @@ class BotEngineTestCase(TestCase):
|
||||
e.set_wall(wall)
|
||||
e.question_discard_tiles()
|
||||
tile_list = e.get_tiles()
|
||||
- self.assertEquals(tile_list, [Tile("P4")])
|
||||
+ self.assertEqual(tile_list, [Tile("P4")])
|
||||
h = tiles([ "C8", "C8", "C2", "C2", "C3", "C3", "B2", "B2", "B4", "B4", "P1", "P4", "B5", "B5" ])
|
||||
e.set_hand(h)
|
||||
e.question_discard_tiles()
|
||||
tile_list = e.get_tiles()
|
||||
- self.assertEquals(tile_list, [Tile("P1")])
|
||||
+ self.assertEqual(tile_list, [Tile("P1")])
|
||||
|
||||
wall = 3 * all_tiles
|
||||
wall.remove(Tile("WW"))
|
||||
@@ -411,7 +411,7 @@ class BotEngineTestCase(TestCase):
|
||||
e.set_hand(h)
|
||||
e.question_discard_tiles()
|
||||
tile_list = e.get_tiles()
|
||||
- self.assertEquals(tile_list, [Tile("C9")])
|
||||
+ self.assertEqual(tile_list, [Tile("C9")])
|
||||
|
||||
finally:
|
||||
e.shutdown()
|
||||
@@ -429,18 +429,18 @@ class BotEngineTestCase(TestCase):
|
||||
e.question_discard()
|
||||
|
||||
action = e.get_string()
|
||||
- self.assert_(action == "Kan")
|
||||
+ self.assertTrue(action == "Kan")
|
||||
tile = e.get_tile()
|
||||
- self.assertEquals(tile, Tile("P9"))
|
||||
+ self.assertEqual(tile, Tile("P9"))
|
||||
|
||||
h = tiles([ "C1", "C2", "C3", "P9", "B1", "B1", "B1", "P1", "P3", "DR", "DR" ])
|
||||
e.set_hand(h)
|
||||
e.set_sets([pon("P9")])
|
||||
e.question_discard()
|
||||
action = e.get_string()
|
||||
- self.assert_(action == "Kan")
|
||||
+ self.assertTrue(action == "Kan")
|
||||
tile = e.get_tile()
|
||||
- self.assertEquals(tile, Tile("P9"))
|
||||
+ self.assertEqual(tile, Tile("P9"))
|
||||
|
||||
|
||||
h = tiles([ "C1", "C2", "C3", "P9", "P9", "P9", "P9", "P7", "P8", "P1", "P3", "DR", "DR", "C5" ])
|
||||
@@ -448,9 +448,9 @@ class BotEngineTestCase(TestCase):
|
||||
e.set_sets([])
|
||||
e.question_discard()
|
||||
action = e.get_string()
|
||||
- self.assert_(action == "Discard")
|
||||
+ self.assertTrue(action == "Discard")
|
||||
tile = e.get_tile()
|
||||
- self.assertEquals(tile, Tile("C5"))
|
||||
+ self.assertEqual(tile, Tile("C5"))
|
||||
|
||||
finally:
|
||||
e.shutdown()
|
||||
@@ -7,10 +7,10 @@ PYTHON_COMPAT=( python3_{6,7,8,9} )
|
||||
|
||||
inherit desktop python-single-r1 xdg
|
||||
|
||||
# Tarball from initial py3 port branch:
|
||||
# Tarball from py3 port branch:
|
||||
# https://github.com/spirali/rmahjong/tree/py3
|
||||
# At least "Furiten", "Red fives" rules aren't implemented.
|
||||
PKG_sha="119704b581e3358ecb2764bd8e208ea5b24e7695"
|
||||
PKG_sha="7a37ade640bc24eb2cc9f0ad6c7ce26773be2856"
|
||||
|
||||
DESCRIPTION="Riichi Mahjong, the Japanese variant of the Chinese game Mahjong for 4 players"
|
||||
HOMEPAGE="https://github.com/spirali/rmahjong"
|
||||
@@ -39,11 +39,6 @@ RDEPEND="
|
||||
')
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.4_fix_python3_compat.patch"
|
||||
"${FILESDIR}/${PN}-0.4_fix_tests.patch"
|
||||
)
|
||||
|
||||
src_prepare(){
|
||||
default
|
||||
|
||||
15
media-video/wlrobs/metadata.xml
Normal file
15
media-video/wlrobs/metadata.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<name>Matthias Coppens</name>
|
||||
<email>coppens.matthias.abc@gmail.com</email>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<bugs-to>https://todo.sr.ht/~scoopta/wlrobs</bugs-to>
|
||||
</upstream>
|
||||
<use>
|
||||
<flag name="dmabuf">Enable the dmabuf backend</flag>
|
||||
<flag name="scpy">Enable the screen copy backend</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
||||
30
media-video/wlrobs/wlrobs-9999.ebuild
Normal file
30
media-video/wlrobs/wlrobs-9999.ebuild
Normal file
@@ -0,0 +1,30 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit mercurial meson
|
||||
|
||||
DESCRIPTION="OBS plugin that allows you to screen capture on wlroots based compositors"
|
||||
HOMEPAGE="https://hg.sr.ht/~scoopta/wlrobs"
|
||||
EHG_REPO_URI="https://hg.sr.ht/~scoopta/wlrobs"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
|
||||
SLOT="0"
|
||||
KEYWORDS=""
|
||||
|
||||
IUSE="+dmabuf +scpy"
|
||||
|
||||
src_configure() {
|
||||
local emesonargs=(
|
||||
$(meson_use dmabuf use_dmabuf)
|
||||
$(meson_use scpy use_scpy )
|
||||
)
|
||||
meson_src_configure
|
||||
}
|
||||
|
||||
src_install() {
|
||||
exeinto "/usr/lib64/obs-plugins"
|
||||
doexe "$BUILD_DIR/libwlrobs.so"
|
||||
}
|
||||
Reference in New Issue
Block a user