misc bugfixes

- wix: added forgotten profile in gateways management
- xml_tools: removed XMLClass to the 2 methods as a direct methods
- plugin_xep_100 (gateways discovery): added error callback
This commit is contained in:
Goffi 2010-06-22 13:58:53 +08:00
commit 2f2594de6b
10 changed files with 112 additions and 91 deletions

View file

@ -32,7 +32,7 @@ import random
from zope.interface import implements
from wokkel import disco, iwokkel, data_form
from tools.xml_tools import XMLTools
from tools.xml_tools import dataForm2xml
try:
from twisted.words.protocols.xmlstream import XMPPHandler
@ -55,7 +55,7 @@ PLUGIN_INFO = {
"description": _("""Implementation of Tarot card game""")
}
suits_order = ['pique', 'coeur', 'trefle', 'carreau', 'atout'] #I have swith the usual order 'trefle' and 'carreau' because card are more easy to see if suit colour change (black, red, black, red)
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 = map(str,range(1,11))+["valet","cavalier","dame","roi"]
class Card():
@ -591,7 +591,7 @@ class Tarot():
elif elt.name == 'contrat': #it's time to choose contrat
form = data_form.Form.fromElement(elt.firstChildElement())
xml_data = XMLTools.dataForm2xml(form)
xml_data = dataForm2xml(form)
self.host.bridge.tarotGameChooseContrat(room_jid.userhost(), xml_data, profile)
elif elt.name == 'contrat_choosed':
@ -733,7 +733,7 @@ class Tarot():
for looser in elt.elements(name='looser', uri=''):
loosers.append(unicode(looser))
form = data_form.Form.fromElement(form_elt)
xml_data = XMLTools.dataForm2xml(form)
xml_data = dataForm2xml(form)
self.host.bridge.tarotGameScore(room_jid.userhost(), xml_data, winners, loosers, profile)
elif elt.name == 'error':
if elt['type'] == 'invalid_cards':