From 82cd09e010783b81ec58145c7682f4b8da49ac85 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 23 Dec 2021 15:27:43 +0100 Subject: Use lowercase module names Signed-off-by: Olivier Gayot --- swiftstory/cards.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 swiftstory/cards.py (limited to 'swiftstory/cards.py') diff --git a/swiftstory/cards.py b/swiftstory/cards.py new file mode 100644 index 0000000..d570f87 --- /dev/null +++ b/swiftstory/cards.py @@ -0,0 +1,16 @@ +import json + + +class Cards: + @staticmethod + def get_white_cards(lang): + ''' Read the file containing the white cards and return a list of cards ''' + with open(f'usr/share/swiftstory/lang/{lang}/cards/white.json', encoding='utf-8') as fh: + return json.load(fh) + + @staticmethod + def get_black_cards(lang): + ''' Read the file containing the black cards and return a list of cards ''' + + with open(f'usr/share/swiftstory/lang/{lang}/cards/black.json', encoding='utf-8') as fh: + return json.load(fh) -- cgit v1.2.3