diff options
Diffstat (limited to 'swiftstory/Cards.py')
-rw-r--r-- | swiftstory/Cards.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/swiftstory/Cards.py b/swiftstory/Cards.py index ce54223..a2160a9 100644 --- a/swiftstory/Cards.py +++ b/swiftstory/Cards.py @@ -1,13 +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('usr/share/swiftstory/lang/' + lang + '/cards/white') as fd: - return [line.strip() for line in fd] + with open('usr/share/swiftstory/lang/' + lang + '/cards/white.json') 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('usr/share/swiftstory/lang/' + lang + '/cards/black') as fd: - return [line.strip() for line in fd] + with open('usr/share/swiftstory/lang/' + lang + '/cards/black.json') as fh: + return json.load(fh) |