# HG changeset patch # User Goffi # Date 1308437323 -7200 # Node ID 975e6be24e118c0e761f32d4d63463bfaba35bba # Parent 8f097c1551f3562adc765fe3488bdea28929f5b9 media paths update media now use global media location, obtained throught getConfig('', 'media_dir') Tarot cards have been removed as they are now shared in this location diff -r 8f097c1551f3 -r 975e6be24e11 browser_side/card_game.py --- a/browser_side/card_game.py Sat Jun 18 15:47:21 2011 +0200 +++ b/browser_side/card_game.py Sun Jun 19 00:48:43 2011 +0200 @@ -215,12 +215,14 @@ self.addClickListener(self) - def loadCards(self, dir): - """Load all the cards in memory - @param dir: directory where the PNG files are""" + def loadCards(self): + """Load all the cards in memory""" def _getTarotCardsPathsCb(paths): + print "_getTarotCardsPathsCb" for file in paths: + print "path:", file card = CardWidget(self, file) + print "card:", card self.cards[(card.suit, card.value)]=card self.deck.append(card) self._parent.host.bridge.call('tarotGameReady', None, self.player_nick, self.referee) diff -r 8f097c1551f3 -r 975e6be24e11 browser_side/register.py --- a/browser_side/register.py Sat Jun 18 15:47:21 2011 +0200 +++ b/browser_side/register.py Sun Jun 19 00:48:43 2011 +0200 @@ -55,7 +55,7 @@ self.setMethod(FormPanel.METHOD_POST) main_panel = HorizontalPanel() main_panel.setStyleName('registerPanel_main') - left_side = Image("register_left.png") + left_side = Image("media/libervia/register_left.png") main_panel.add(left_side) ##TabPanel## diff -r 8f097c1551f3 -r 975e6be24e11 libervia.tac --- a/libervia.tac Sat Jun 18 15:47:21 2011 +0200 +++ b/libervia.tac Sun Jun 19 00:48:43 2011 +0200 @@ -52,7 +52,8 @@ TIMEOUT = 10 #Session's time out, after that the user will be disconnected LIBERVIA_DIR = "output/" -CARDS_DIR = "cards/" +MEDIA_DIR = "media/" +CARDS_DIR = "games/cards/tarot" class ISATSession(Interface): profile = Attribute("Sat profile") @@ -242,7 +243,9 @@ def jsonrpc_getTarotCardsPaths(self): """Give the path of all the tarot cards""" - return map(lambda x: x[len(LIBERVIA_DIR):],glob.glob(os.path.join(LIBERVIA_DIR,CARDS_DIR,'*_*.png'))); + _join = os.path.join + _media_dir = _join(self.sat_host.media_dir,'') + return map(lambda x: _join(MEDIA_DIR, x[len(_media_dir):]),glob.glob(_join(_media_dir,CARDS_DIR,'*_*.png'))); def jsonrpc_tarotGameReady(self, player, referee): """Tell to the server that we are ready to start the game""" @@ -602,11 +605,13 @@ 'tarotGameChooseContrat', 'tarotGameShowCards', 'tarotGameInvalidCards', 'tarotGameCardsPlayed', 'tarotGameYourTurn', 'tarotGameScore', 'subscribe', 'contactDeleted', 'newContact']: self.bridge.register(signal_name, self.signal_handler.getGenericCb(signal_name)) + self.media_dir = self.bridge.getConfig('','media_dir') root.putChild('json_signal_api', self.signal_handler) root.putChild('json_api', MethodHandler(self)) root.putChild('register_api', _register) root.putChild('blog', MicroBlog(self)) root.putChild('css', ProtectedFile("server_css/")) + root.putChild(os.path.dirname(MEDIA_DIR), ProtectedFile(self.media_dir)) self.site = server.Site(root) self.site.sessionFactory = LiberviaSession diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/.size --- a/public/cards/.size Sat Jun 18 15:47:21 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -Biggest size: 74X136 diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/COPYING --- a/public/cards/COPYING Sat Jun 18 15:47:21 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -The work in this directory is licensed under the Creative Commons BY-SA License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/; or, (b) send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA. diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/README --- a/public/cards/README Sat Jun 18 15:47:21 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -The Tarot cards pictures come from the deck found on wikicommons (the script used to cut them is available in SàT project @frontends/src/wix/images/split_card.sh), and available at http://upload.wikimedia.org/wikipedia/commons/8/8d/Tarotcards.jpg under Creative Commons BY-SA. The authors shown on the site are Piast and Svick. The splitted cards are, according to the license, available under the same conditions. -Notice that the Creative Common BY-SA apply only to this directory - diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_1.png Binary file public/cards/atout_1.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_10.png Binary file public/cards/atout_10.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_11.png Binary file public/cards/atout_11.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_12.png Binary file public/cards/atout_12.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_13.png Binary file public/cards/atout_13.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_14.png Binary file public/cards/atout_14.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_15.png Binary file public/cards/atout_15.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_16.png Binary file public/cards/atout_16.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_17.png Binary file public/cards/atout_17.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_18.png Binary file public/cards/atout_18.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_19.png Binary file public/cards/atout_19.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_2.png Binary file public/cards/atout_2.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_20.png Binary file public/cards/atout_20.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_21.png Binary file public/cards/atout_21.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_3.png Binary file public/cards/atout_3.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_4.png Binary file public/cards/atout_4.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_5.png Binary file public/cards/atout_5.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_6.png Binary file public/cards/atout_6.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_7.png Binary file public/cards/atout_7.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_8.png Binary file public/cards/atout_8.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_9.png Binary file public/cards/atout_9.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/atout_excuse.png Binary file public/cards/atout_excuse.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_1.png Binary file public/cards/carreau_1.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_10.png Binary file public/cards/carreau_10.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_2.png Binary file public/cards/carreau_2.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_3.png Binary file public/cards/carreau_3.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_4.png Binary file public/cards/carreau_4.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_5.png Binary file public/cards/carreau_5.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_6.png Binary file public/cards/carreau_6.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_7.png Binary file public/cards/carreau_7.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_8.png Binary file public/cards/carreau_8.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_9.png Binary file public/cards/carreau_9.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_cavalier.png Binary file public/cards/carreau_cavalier.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_dame.png Binary file public/cards/carreau_dame.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_roi.png Binary file public/cards/carreau_roi.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/carreau_valet.png Binary file public/cards/carreau_valet.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_1.png Binary file public/cards/coeur_1.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_10.png Binary file public/cards/coeur_10.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_2.png Binary file public/cards/coeur_2.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_3.png Binary file public/cards/coeur_3.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_4.png Binary file public/cards/coeur_4.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_5.png Binary file public/cards/coeur_5.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_6.png Binary file public/cards/coeur_6.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_7.png Binary file public/cards/coeur_7.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_8.png Binary file public/cards/coeur_8.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_9.png Binary file public/cards/coeur_9.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_cavalier.png Binary file public/cards/coeur_cavalier.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_dame.png Binary file public/cards/coeur_dame.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_roi.png Binary file public/cards/coeur_roi.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/coeur_valet.png Binary file public/cards/coeur_valet.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_1.png Binary file public/cards/pique_1.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_10.png Binary file public/cards/pique_10.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_2.png Binary file public/cards/pique_2.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_3.png Binary file public/cards/pique_3.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_4.png Binary file public/cards/pique_4.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_5.png Binary file public/cards/pique_5.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_6.png Binary file public/cards/pique_6.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_7.png Binary file public/cards/pique_7.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_8.png Binary file public/cards/pique_8.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_9.png Binary file public/cards/pique_9.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_cavalier.png Binary file public/cards/pique_cavalier.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_dame.png Binary file public/cards/pique_dame.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_roi.png Binary file public/cards/pique_roi.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/pique_valet.png Binary file public/cards/pique_valet.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_1.png Binary file public/cards/trefle_1.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_10.png Binary file public/cards/trefle_10.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_2.png Binary file public/cards/trefle_2.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_3.png Binary file public/cards/trefle_3.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_4.png Binary file public/cards/trefle_4.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_5.png Binary file public/cards/trefle_5.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_6.png Binary file public/cards/trefle_6.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_7.png Binary file public/cards/trefle_7.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_8.png Binary file public/cards/trefle_8.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_9.png Binary file public/cards/trefle_9.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_cavalier.png Binary file public/cards/trefle_cavalier.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_dame.png Binary file public/cards/trefle_dame.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_roi.png Binary file public/cards/trefle_roi.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/cards/trefle_valet.png Binary file public/cards/trefle_valet.png has changed diff -r 8f097c1551f3 -r 975e6be24e11 public/libervia.css --- a/public/libervia.css Sat Jun 18 15:47:21 2011 +0200 +++ b/public/libervia.css Sun Jun 19 00:48:43 2011 +0200 @@ -396,7 +396,7 @@ font-family: Arial, Helvetica, sans-serif; border: 1px solid #bbb; color: #444; - background: #fff url('unibox.png') top right no-repeat; + background: #fff url('media/libervia/unibox.png') top right no-repeat; border-radius: 9px 9px 9px 9px; -webkit-border-radius: 9px 9px 9px 9px; -moz-border-radius: 9px 9px 9px 9px; @@ -446,7 +446,7 @@ } .registerPanel_right_side { - background: #111 url('popup_right.png'); + background: #111 url('media/libervia/register_right.png'); height: 100%; width: 100%; } @@ -483,7 +483,7 @@ .registerPanel_content .button, .registerPanel_content .button:visited { - background: #222 url('gradient.png') repeat-x; + background: #222 url('media/libervia/gradient.png') repeat-x; display: inline-block; text-decoration: none; -moz-border-radius: 6px;