From 0fb08748e5285e5d4adc6135eec8889887a63299 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sun, 14 Jun 2015 22:31:48 +0100 Subject: use a python package instead of just modules The package is contained in the CAO/ folder. server.py is still at the root of the repository though. Signed-off-by: Olivier Gayot --- CAO/Cards.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 CAO/Cards.py (limited to 'CAO/Cards.py') diff --git a/CAO/Cards.py b/CAO/Cards.py new file mode 100644 index 0000000..b796b97 --- /dev/null +++ b/CAO/Cards.py @@ -0,0 +1,13 @@ +class Cards(): + @staticmethod + def get_white_cards(lang): + ''' Read the file containing the white cards and return a list of cards ''' + with open('lang/' + lang + '/cards/white') as fd: + return [line.strip() for line in fd] + + @staticmethod + def get_black_cards(lang): + ''' Read the file containing the black cards and return a list of cards ''' + + with open('lang/' + lang + '/cards/black') as fd: + return [line.strip() for line in fd] -- cgit v1.2.3