comparison src/memory/memory.py @ 802:9007bb133009

core, frontends: XMLUI refactoring: - XMLUI now use objects with 2 main classes: widgets (button, label, etc), and container which contain widgets according to a layout - widgets and containers classes are found through introspection, thereby it's really easy to add a new one - there is still the AddWidgetName helper, for example AddText('jid', 'test@example.net') will add a StringWidget with name "jid" and default value "test@example.net" - container can be inside other containers. changeContainer change the first parent container
author Goffi <goffi@goffi.org>
date Tue, 04 Feb 2014 18:19:00 +0100
parents 900987e1c0c4
children 1fe00f0c9a91
comparison
equal deleted inserted replaced
801:02ee9ef95277 802:9007bb133009
27 from uuid import uuid4 27 from uuid import uuid4
28 from logging import debug, info, warning, error 28 from logging import debug, info, warning, error
29 from twisted.internet import defer, reactor 29 from twisted.internet import defer, reactor
30 from twisted.words.protocols.jabber import jid 30 from twisted.words.protocols.jabber import jid
31 from twisted.python.failure import Failure 31 from twisted.python.failure import Failure
32 from sat.tools.xml_tools import paramsXml2xmlUI 32 from sat.tools.xml_tools import paramsXML2XMLUI
33 from sat.core.default_config import default_config 33 from sat.core.default_config import default_config
34 from sat.memory.sqlite import SqliteStorage 34 from sat.memory.sqlite import SqliteStorage
35 from sat.memory.persistent import PersistentDict 35 from sat.memory.persistent import PersistentDict
36 from sat.core import exceptions 36 from sat.core import exceptions
37 37
128 <param name="JabberID" value="name@example.org/SàT" type="string" /> 128 <param name="JabberID" value="name@example.org/SàT" type="string" />
129 <param name="Password" value="" type="password" /> 129 <param name="Password" value="" type="password" />
130 <param name="Priority" value="50" type="string" /> 130 <param name="Priority" value="50" type="string" />
131 <param name="Server" value="example.org" type="string" /> 131 <param name="Server" value="example.org" type="string" />
132 <param name="Port" value="5222" type="string" /> 132 <param name="Port" value="5222" type="string" />
133 <param name="NewAccount" value="%(label_NewAccount)s" type="button" callback_id="registerNewAccount"/> 133 <param name="NewAccount" label="%(label_NewAccount)s" type="button" callback_id="registerNewAccount"/>
134 <param name="autoconnect" label="%(label_autoconnect)s" value="true" type="bool" /> 134 <param name="autoconnect" label="%(label_autoconnect)s" value="true" type="bool" />
135 <param name="autodisconnect" label="%(label_autodisconnect)s" value="false" type="bool" /> 135 <param name="autodisconnect" label="%(label_autodisconnect)s" value="false" type="bool" />
136 </category> 136 </category>
137 <category name="Misc" label="%(category_misc)s"> 137 <category name="Misc" label="%(category_misc)s">
138 <param name="Watched" value="test@Jabber.goffi.int" type="string" /> 138 <param name="Watched" value="test@Jabber.goffi.int" type="string" />
619 profile = self.getProfileName(profile_key) 619 profile = self.getProfileName(profile_key)
620 if not profile: 620 if not profile:
621 error(_("Asking params for inexistant profile")) 621 error(_("Asking params for inexistant profile"))
622 return "" 622 return ""
623 d = self.getParams(security_limit, app, profile) 623 d = self.getParams(security_limit, app, profile)
624 return d.addCallback(lambda param_xml: paramsXml2xmlUI(param_xml)) 624 return d.addCallback(lambda param_xml: paramsXML2XMLUI(param_xml))
625 625
626 def getParams(self, security_limit, app, profile_key): 626 def getParams(self, security_limit, app, profile_key):
627 """Construct xml for asked profile, take params xml as skeleton 627 """Construct xml for asked profile, take params xml as skeleton
628 @param security_limit: NO_SECURITY_LIMIT (-1) to return all the params. 628 @param security_limit: NO_SECURITY_LIMIT (-1) to return all the params.
629 Otherwise sole the params which have a security level defined *and* 629 Otherwise sole the params which have a security level defined *and*