summaryrefslogtreecommitdiff
path: root/swiftstory/cards.py
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2021-12-23 15:27:43 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2021-12-23 23:15:21 +0100
commit82cd09e010783b81ec58145c7682f4b8da49ac85 (patch)
tree83b3e61aaa4befcd340a01b2fb147a2306bdb29e /swiftstory/cards.py
parent1be5c49ae402b768f9206724abdd503c18933ae1 (diff)
Use lowercase module names
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'swiftstory/cards.py')
-rw-r--r--swiftstory/cards.py16
1 files changed, 16 insertions, 0 deletions
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)