core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'

This commit is contained in:
Goffi 2014-03-21 16:27:09 +01:00
commit 005ec59a8a

View file

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sat.core.i18n import _, D_
from sat.core.constants import Const as C
from sat.core import exceptions
from sat.tools import xml_tools
from logging import debug, info, warning, error
@ -137,12 +138,12 @@ class XEP_0100(object):
self.host.addContact(jid_, profile_key=profile)
self.host.setPresence(jid_, profile_key=profile)
def _gatewayRegister(self, target_jid_s, profile_key='@NONE@'):
def _gatewayRegister(self, target_jid_s, profile_key=C.PROF_KEY_NONE):
d = self.gatewayRegister(jid.JID(target_jid_s), profile_key)
d.addCallback(lambda xmlui: xmlui.toXml())
return d
def gatewayRegister(self, target_jid, profile_key='@NONE@'):
def gatewayRegister(self, target_jid, profile_key=C.PROF_KEY_NONE):
"""Register gateway using in-band registration, then log-in to gateway"""
profile = self.host.memory.getProfileName(profile_key)
assert(profile)