Mercurial > libervia-backend
diff src/core/sat_main.py @ 916:1a759096ccbd
core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 21 Mar 2014 16:27:09 +0100 |
parents | 1a3ba959f0ab |
children | a9401694d2dc |
line wrap: on
line diff
--- a/src/core/sat_main.py Fri Mar 21 16:19:46 2014 +0100 +++ b/src/core/sat_main.py Fri Mar 21 16:27:09 2014 +0100 @@ -219,11 +219,11 @@ self.plugins[import_name].is_handler = False #TODO: test xmppclient presence and register handler parent - def connect(self, profile_key='@NONE@'): + def connect(self, profile_key=C.PROF_KEY_NONE): """Connect to jabber server""" self.asyncConnect(profile_key) - def asyncConnect(self, profile_key='@NONE@'): + def asyncConnect(self, profile_key=C.PROF_KEY_NONE): """Connect to jabber server with asynchronous reply @param profile_key: %(doc_profile)s """ @@ -392,7 +392,7 @@ return None return self.profiles[profile].getHostJid() - def registerNewAccount(self, login, password, email, server, port=5222, id_=None, profile_key='@NONE@'): + def registerNewAccount(self, login, password, email, server, port=5222, id_=None, profile_key=C.PROF_KEY_NONE): """Connect to a server and create a new account using in-band registration""" profile = self.memory.getProfileName(profile_key) assert(profile) @@ -469,12 +469,12 @@ ret.append((conf_id, conf_type, data)) return ret - def _sendMessage(self, to_s, msg, subject=None, mess_type='auto', extra={}, profile_key='@NONE@'): + def _sendMessage(self, to_s, msg, subject=None, mess_type='auto', extra={}, profile_key=C.PROF_KEY_NONE): to_jid = jid.JID(to_s) #XXX: we need to use the dictionary comprehension because D-Bus return its own types, and pickle can't manage them. TODO: Need to find a better way return self.sendMessage(to_jid, msg, subject, mess_type, {unicode(key): unicode(value) for key, value in extra.items()}, profile_key=profile_key) - def sendMessage(self, to_jid, msg, subject=None, mess_type='auto', extra={}, no_trigger=False, profile_key='@NONE@'): + def sendMessage(self, to_jid, msg, subject=None, mess_type='auto', extra={}, no_trigger=False, profile_key=C.PROF_KEY_NONE): #FIXME: check validity of recipient profile = self.memory.getProfileName(profile_key) assert(profile) @@ -574,10 +574,10 @@ extra=mess_data['extra'], profile=profile) - def _setPresence(self, to="", show="", priority=0, statuses=None, profile_key='@NONE@'): + def _setPresence(self, to="", show="", priority=0, statuses=None, profile_key=C.PROF_KEY_NONE): return self.setPresence(jid.JID(to) if to else None, show, priority, statuses, profile_key) - def setPresence(self, to_jid=None, show="", priority=0, statuses=None, profile_key='@NONE@'): + def setPresence(self, to_jid=None, show="", priority=0, statuses=None, profile_key=C.PROF_KEY_NONE): """Send our presence information""" if statuses is None: statuses = {} @@ -866,7 +866,7 @@ debug("Removing callback [%s]" % callback_id) del self._cb_map[callback_id] - def launchCallback(self, callback_id, data=None, profile_key="@NONE@"): + def launchCallback(self, callback_id, data=None, profile_key=C.PROF_KEY_NONE): """Launch a specific callback @param callback_id: id of the action (callback) to launch @param data: optional data