From ba4c9158ea4bd9274b1432c1827c8dbe752956d3 Mon Sep 17 00:00:00 2001 From: souliane Date: Fri, 18 Oct 2013 11:58:42 +0200 Subject: [PATCH] tools: moved src/tools/games.py to src/tools/frontends/ --- frontends/src/primitivus/card_game.py | 2 +- frontends/src/wix/card_game.py | 2 +- src/plugins/plugin_misc_quiz.py | 2 +- src/plugins/plugin_misc_tarot.py | 2 +- src/tools/{ => frontends}/games.py | 4 +--- 5 files changed, 5 insertions(+), 7 deletions(-) rename src/tools/{ => frontends}/games.py (92%) diff --git a/frontends/src/primitivus/card_game.py b/frontends/src/primitivus/card_game.py index ad07dc01..ea49ff47 100644 --- a/frontends/src/primitivus/card_game.py +++ b/frontends/src/primitivus/card_game.py @@ -19,7 +19,7 @@ import urwid from urwid_satext import sat_widgets -from sat.tools.games import TarotCard +from sat.tools.frontends.games import TarotCard from sat_frontends.quick_frontend.quick_card_game import QuickCardGame from sat_frontends.primitivus.xmlui import XMLUI diff --git a/frontends/src/wix/card_game.py b/frontends/src/wix/card_game.py index 4776bea0..117a79df 100644 --- a/frontends/src/wix/card_game.py +++ b/frontends/src/wix/card_game.py @@ -24,7 +24,7 @@ import os.path, glob import pdb from logging import debug, info, error from sat.tools.jid import JID -from sat.tools.games import TarotCard +from sat.tools.frontends.games import TarotCard from sat_frontends.quick_frontend.quick_card_game import QuickCardGame from sat_frontends.wix.xmlui import XMLUI diff --git a/src/plugins/plugin_misc_quiz.py b/src/plugins/plugin_misc_quiz.py index ec9eba52..b1ad1de8 100755 --- a/src/plugins/plugin_misc_quiz.py +++ b/src/plugins/plugin_misc_quiz.py @@ -29,7 +29,7 @@ from zope.interface import implements from wokkel import disco, iwokkel, data_form from sat.tools.xml_tools import dataForm2XML -from sat.tools.games import TarotCard +from sat.tools.frontends.games import TarotCard from time import time diff --git a/src/plugins/plugin_misc_tarot.py b/src/plugins/plugin_misc_tarot.py index 1fe789d5..09af2709 100755 --- a/src/plugins/plugin_misc_tarot.py +++ b/src/plugins/plugin_misc_tarot.py @@ -26,8 +26,8 @@ from zope.interface import implements from wokkel import disco, iwokkel, data_form from sat.tools.xml_tools import dataForm2XML -from sat.tools.games import TarotCard +from sat.tools.frontends.games import TarotCard from time import time try: diff --git a/src/tools/games.py b/src/tools/frontends/games.py similarity index 92% rename from src/tools/games.py rename to src/tools/frontends/games.py index 9881bd94..1f7e9a67 100644 --- a/src/tools/games.py +++ b/src/tools/frontends/games.py @@ -17,8 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from logging import debug, info, error -"""This library help manage general games (e.g. card games)""" +"""This library help manage general games (e.g. card games) and it is shared by the frontends""" SUITS_ORDER = ['pique', 'coeur', 'trefle', 'carreau', 'atout'] # I have switched the usual order 'trefle' and 'carreau' because card are more easy to see if suit colour change (black, red, black, red) VALUES_ORDER = [str(i) for i in xrange(1, 11)] + ["valet", "cavalier", "dame", "roi"] @@ -26,7 +25,6 @@ VALUES_ORDER = [str(i) for i in xrange(1, 11)] + ["valet", "cavalier", "dame", " class TarotCard(object): """This class is used to represent a car logically""" - #TODO: move this in a library in tools, and share this with frontends (e.g. card_game in wix use the same class) def __init__(self, tuple_card): """@param tuple_card: tuple (suit, value)"""