blob: 62f1e377750c45babff28aae9feab4e6feec7aed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import json
import os
import pkg_resources
class Cards:
@staticmethod
def get_white_cards(lang):
''' Read the file containing the white cards and return a list of cards '''
fh = pkg_resources.resource_stream(__name__, os.path.join("data/lang", lang, "cards/white.json"))
return json.load(fh)
@staticmethod
def get_black_cards(lang):
''' Read the file containing the black cards and return a list of cards '''
fh = pkg_resources.resource_stream(__name__, os.path.join("data/lang", lang, "cards/black.json"))
return json.load(fh)
|