comparison sat.tac @ 102:94011f553cd0

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
author Goffi <goffi@goffi.org>
date Tue, 22 Jun 2010 13:58:53 +0800
parents 783e9d6980ec
children 6be927a465ed
comparison
equal deleted inserted replaced
101:783e9d6980ec 102:94011f553cd0
45 45
46 import signal, sys 46 import signal, sys
47 import os.path 47 import os.path
48 48
49 from tools.memory import Memory 49 from tools.memory import Memory
50 from tools.xml_tools import XMLTools 50 from tools.xml_tools import tupleList2dataForm
51 from glob import glob 51 from glob import glob
52 52
53 import gettext 53 import gettext
54 gettext.install('sat', "i18n", unicode=True) 54 gettext.install('sat', "i18n", unicode=True)
55 55
525 iq = compat.IQ(self.profiles[profile].xmlstream, 'set') 525 iq = compat.IQ(self.profiles[profile].xmlstream, 'set')
526 iq["to"] = target 526 iq["to"] = target
527 iq["from"] = self.profiles[profile].jid.full() 527 iq["from"] = self.profiles[profile].jid.full()
528 query = iq.addElement(('jabber:iq:register', 'query')) 528 query = iq.addElement(('jabber:iq:register', 'query'))
529 if action=='SUBMIT': 529 if action=='SUBMIT':
530 form = XMLTools.tupleList2dataForm(fields) 530 form = tupleList2dataForm(fields)
531 query.addChild(form.toElement()) 531 query.addChild(form.toElement())
532 elif action=='CANCEL': 532 elif action=='CANCEL':
533 query.addElement('remove') 533 query.addElement('remove')
534 else: 534 else:
535 error (_("FIXME FIXME FIXME: Unmanaged action (%s) in submitForm") % action) 535 error (_("FIXME FIXME FIXME: Unmanaged action (%s) in submitForm") % action)
772 """return the help string of the menu""" 772 """return the help string of the menu"""
773 profile = self.memory.getProfileName(profile_key) 773 profile = self.memory.getProfileName(profile_key)
774 if not profile_key: 774 if not profile_key:
775 error (_('Non-exsitant profile')) 775 error (_('Non-exsitant profile'))
776 return "" 776 return ""
777 try: 777 if self.menus.has_key((category,name,type)):
778 id = self.get_next_id() 778 id = self.get_next_id()
779 self.menus[(category,name,type)]['callback'](id, profile) 779 self.menus[(category,name,type)]['callback'](id, profile)
780 return id 780 return id
781 except KeyError: 781 else:
782 error (_("Trying to access an unknown menu")) 782 error (_("Trying to access an unknown menu (%(category)s/%(name)s/%(type)s)")%{'category':category, 'name':name,'type':type})
783 return "" 783 return ""
784 784
785 785
786 786
787 application = service.Application('SàT') 787 application = service.Application('SàT')