diff 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
line wrap: on
line diff
--- a/sat.tac	Sat Jun 19 17:15:30 2010 +0800
+++ b/sat.tac	Tue Jun 22 13:58:53 2010 +0800
@@ -47,7 +47,7 @@
 import os.path
 
 from tools.memory import Memory
-from tools.xml_tools import XMLTools 
+from tools.xml_tools import tupleList2dataForm
 from glob import glob
 
 import gettext
@@ -527,7 +527,7 @@
         iq["from"] = self.profiles[profile].jid.full()
         query = iq.addElement(('jabber:iq:register', 'query'))
         if action=='SUBMIT':
-            form = XMLTools.tupleList2dataForm(fields)
+            form = tupleList2dataForm(fields)
             query.addChild(form.toElement())
         elif action=='CANCEL':
             query.addElement('remove')
@@ -774,12 +774,12 @@
         if not profile_key:
             error (_('Non-exsitant profile'))
             return ""
-        try:
+        if self.menus.has_key((category,name,type)):
             id = self.get_next_id()
             self.menus[(category,name,type)]['callback'](id, profile)
             return id
-        except KeyError:
-            error (_("Trying to access an unknown menu"))
+        else:
+            error (_("Trying to access an unknown menu (%(category)s/%(name)s/%(type)s)")%{'category':category, 'name':name,'type':type})
             return ""