diff src/plugins/plugin_misc_tarot.py @ 536:a31abb97310d

core, plugins: fixed bad namespace in stanza creation
author Goffi <goffi@goffi.org>
date Thu, 01 Nov 2012 22:41:39 +0100
parents 2a072735e459
children da6eaa2af092
line wrap: on
line diff
--- a/src/plugins/plugin_misc_tarot.py	Thu Nov 01 19:52:59 2012 +0100
+++ b/src/plugins/plugin_misc_tarot.py	Thu Nov 01 22:41:39 2012 +0100
@@ -88,7 +88,7 @@
 
     def createGameElt(self, to_jid, type="normal"):
         type = "normal" if to_jid.resource else "groupchat"
-        elt = domish.Element(('jabber:client','message'))
+        elt = domish.Element((None,'message'))
         elt["to"] = to_jid.full()
         elt["type"] = type
         elt.addElement((NS_CG, CG_TAG))
@@ -96,9 +96,9 @@
 
     def __card_list_to_xml(self, cards_list, elt_name):
         """Convert a card list to domish element"""
-        cards_list_elt = domish.Element(('',elt_name))
+        cards_list_elt = domish.Element((None,elt_name))
         for card in cards_list:
-            card_elt = domish.Element(('','card'))
+            card_elt = domish.Element((None,'card'))
             card_elt['suit'] = card.suit
             card_elt['value'] = card.value
             cards_list_elt.addChild(card_elt) 
@@ -113,10 +113,10 @@
 
     def __create_started_elt(self, players):
         """Create a game_started domish element"""
-        started_elt = domish.Element(('','started'))
+        started_elt = domish.Element((None,'started'))
         idx = 0
         for player in players:
-            player_elt = domish.Element(('','player'))
+            player_elt = domish.Element((None,'player'))
             player_elt.addContent(player)
             player_elt['index'] = str(idx)
             idx+=1
@@ -125,7 +125,7 @@
 
     def __ask_contrat(self):
         """Create a element for asking contrat"""
-        contrat_elt = domish.Element(('','contrat'))
+        contrat_elt = domish.Element((None,'contrat'))
         form = data_form.Form('form', title=_('contrat selection'))
         field = data_form.Field('list-single', 'contrat', options=map(data_form.Option, self.contrats), required=True)
         form.addField(field)
@@ -138,18 +138,18 @@
         @param winners: list of unicode nicks of winners
         @param loosers: list of unicode nicks of loosers"""
 
-        score_elt = domish.Element(('','score'))
+        score_elt = domish.Element((None,'score'))
         form = data_form.Form('form', title=_('scores'))
         for line in scores.split('\n'):
             field = data_form.Field('fixed', value = line)
             form.addField(field)
         score_elt.addChild(form.toElement())
         for winner in winners:
-            winner_elt = domish.Element(('','winner'))
+            winner_elt = domish.Element((None,'winner'))
             winner_elt.addContent(winner)
             score_elt.addChild(winner_elt)
         for looser in loosers:
-            looser_elt = domish.Element(('','looser'))
+            looser_elt = domish.Element((None,'looser'))
             looser_elt.addContent(looser)
             score_elt.addChild(looser_elt)
         return score_elt
@@ -158,7 +158,7 @@
         """Create a element for invalid_cards error
         @param list_cards: list of Card
         @param game_phase: phase of the game ['ecart', 'play']"""
-        error_elt = domish.Element(('','error'))
+        error_elt = domish.Element((None,'error'))
         played_elt = self.__card_list_to_xml(played_cards, 'played')
         invalid_elt = self.__card_list_to_xml(invalid_cards, 'invalid')
         error_elt['type'] = 'invalid_cards'