# HG changeset patch # User Goffi # Date 1317291202 -7200 # Node ID e66d300c5d42cf035400bb6860038545c92ff829 # Parent deeebf697d9a40c7eff4f78a56b900ef9a3da418 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix diff -r deeebf697d9a -r e66d300c5d42 frontends/src/bridge/DBus.py --- a/frontends/src/bridge/DBus.py Thu Sep 29 12:09:31 2011 +0200 +++ b/frontends/src/bridge/DBus.py Thu Sep 29 12:13:22 2011 +0200 @@ -56,8 +56,8 @@ else: error(_('Unknown interface')) - def addContact(self, entity, profile_key="@DEFAULT@"): - return self.db_core_iface.addContact(entity, profile_key) + def addContact(self, entity_jid, profile_key="@DEFAULT@"): + return self.db_core_iface.addContact(entity_jid, profile_key) def asyncConnect(self, profile_key="@DEFAULT@", callback=None, errback=None): return self.db_core_iface.asyncConnect(profile_key, reply_handler=callback, error_handler=errback) @@ -74,8 +74,8 @@ def createProfile(self, profile): return self.db_core_iface.createProfile(profile) - def delContact(self, entity, profile_key="@DEFAULT@"): - return self.db_core_iface.delContact(entity, profile_key) + def delContact(self, entity_jid, profile_key="@DEFAULT@"): + return self.db_core_iface.delContact(entity_jid, profile_key) def deleteProfile(self, profile): return self.db_core_iface.deleteProfile(profile) @@ -152,8 +152,8 @@ def subscription(self, sub_type, entity, profile_key="@DEFAULT@"): return self.db_core_iface.subscription(sub_type, entity, profile_key) - def updateContact(self, entity, name, groups, profile_key="@DEFAULT@"): - return self.db_core_iface.updateContact(entity, name, groups, profile_key) + def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@"): + return self.db_core_iface.updateContact(entity_jid, name, groups, profile_key) #methods from plugins @@ -193,8 +193,8 @@ def quizGameAnswer(self, player, referee, answer, profile_key='@DEFAULT@'): return self.db_plugin_iface.quizGameAnswer(player, referee, answer, profile_key) - def sendFile(self, to, path, profile_key='@DEFAULT@'): - return self.db_plugin_iface.sendFile(to, path, profile_key) + def sendFile(self, to, path, data, profile_key='@DEFAULT@'): + return self.db_plugin_iface.sendFile(to, path, data, profile_key) def findGateways(self, target, profile_key='@DEFAULT@'): return self.db_plugin_iface.findGateways(target, profile_key) diff -r deeebf697d9a -r e66d300c5d42 frontends/src/jp/jp --- a/frontends/src/jp/jp Thu Sep 29 12:09:31 2011 +0200 +++ b/frontends/src/jp/jp Thu Sep 29 12:13:22 2011 +0200 @@ -187,11 +187,11 @@ bz2.close() info(_("OK !")) path = abspath(tmpfile) - self.transfert_id = self.bridge.sendFile(self.dest_jid, path, profile_key=self.profile) + self.transfert_id = self.bridge.sendFile(self.dest_jid, path, {}, profile_key=self.profile) else: for file in self.files: path = abspath(file) - self.transfert_id = self.bridge.sendFile(self.dest_jid, path, profile_key=self.profile) #FIXME: show progress only for last transfert_id + self.transfert_id = self.bridge.sendFile(self.dest_jid, path, {}, profile_key=self.profile) #FIXME: show progress only for last transfert_id #TODO: manage ProgressBar diff -r deeebf697d9a -r e66d300c5d42 frontends/src/primitivus/chat.py --- a/frontends/src/primitivus/chat.py Thu Sep 29 12:09:31 2011 +0200 +++ b/frontends/src/primitivus/chat.py Thu Sep 29 12:13:22 2011 +0200 @@ -283,5 +283,5 @@ def onFileSelected(self, filepath): self.host.removePopUp() full_jid = self.host.CM.get_full(self.target) - id = self.host.bridge.sendFile(full_jid, filepath) + id = self.host.bridge.sendFile(full_jid, filepath, {}, self.host.profile) self.host.addProgress(id,filepath) diff -r deeebf697d9a -r e66d300c5d42 frontends/src/wix/chat.py --- a/frontends/src/wix/chat.py Thu Sep 29 12:09:31 2011 +0200 +++ b/frontends/src/wix/chat.py Thu Sep 29 12:13:22 2011 +0200 @@ -260,7 +260,7 @@ if filename: debug(_("filename: %s"),filename) full_jid = self.host.CM.get_full(self.target) - id = self.host.bridge.sendFile(full_jid, filename) + id = self.host.bridge.sendFile(full_jid, filename, {}, self.host.profile) self.host.waitProgress(id, _("File Transfer"), _("Copying %s") % os.path.basename(filename)) def onStartTarot(self, e): diff -r deeebf697d9a -r e66d300c5d42 src/bridge/DBus.py --- a/src/bridge/DBus.py Thu Sep 29 12:09:31 2011 +0200 +++ b/src/bridge/DBus.py Thu Sep 29 12:13:22 2011 +0200 @@ -78,7 +78,7 @@ @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, signature='ss') - def contactDeleted(self, entity, profile): + def contactDeleted(self, entity_jid, profile): pass @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, @@ -93,7 +93,7 @@ @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, signature='sa{ss}ass') - def newContact(self, contact, attributes, groups, profile): + def newContact(self, contact_jid, attributes, groups, profile): pass @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, @@ -108,12 +108,12 @@ @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, signature='ssia{ss}s') - def presenceUpdate(self, entity, show, priority, statuses, profile): + def presenceUpdate(self, entity_jid, show, priority, statuses, profile): pass @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, signature='sss') - def subscribe(self, sub_type, entity, profile): + def subscribe(self, sub_type, entity_jid, profile): pass @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, @@ -127,8 +127,8 @@ @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, in_signature='ss', out_signature='', async_callbacks=None) - def addContact(self, entity, profile_key="@DEFAULT@"): - return self.cb["addContact"](unicode(entity), unicode(profile_key)) + def addContact(self, entity_jid, profile_key="@DEFAULT@"): + return self.cb["addContact"](unicode(entity_jid), unicode(profile_key)) @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, in_signature='s', out_signature='', @@ -163,8 +163,8 @@ @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, in_signature='ss', out_signature='', async_callbacks=None) - def delContact(self, entity, profile_key="@DEFAULT@"): - return self.cb["delContact"](unicode(entity), unicode(profile_key)) + def delContact(self, entity_jid, profile_key="@DEFAULT@"): + return self.cb["delContact"](unicode(entity_jid), unicode(profile_key)) @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, in_signature='s', out_signature='i', @@ -319,8 +319,8 @@ @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, in_signature='ssass', out_signature='', async_callbacks=None) - def updateContact(self, entity, name, groups, profile_key="@DEFAULT@"): - return self.cb["updateContact"](unicode(entity), unicode(name), groups, unicode(profile_key)) + def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@"): + return self.cb["updateContact"](unicode(entity_jid), unicode(name), groups, unicode(profile_key)) def __attributes(self, in_sign): @@ -417,8 +417,8 @@ def connectionError(self, error_type, profile): self.dbus_bridge.connectionError(error_type, profile) - def contactDeleted(self, entity, profile): - self.dbus_bridge.contactDeleted(entity, profile) + def contactDeleted(self, entity_jid, profile): + self.dbus_bridge.contactDeleted(entity_jid, profile) def disconnected(self, profile): self.dbus_bridge.disconnected(profile) @@ -426,8 +426,8 @@ def newAlert(self, message, title, alert_type, profile): self.dbus_bridge.newAlert(message, title, alert_type, profile) - def newContact(self, contact, attributes, groups, profile): - self.dbus_bridge.newContact(contact, attributes, groups, profile) + def newContact(self, contact_jid, attributes, groups, profile): + self.dbus_bridge.newContact(contact_jid, attributes, groups, profile) def newMessage(self, from_jid, message, mess_type, to_jid, profile): self.dbus_bridge.newMessage(from_jid, message, mess_type, to_jid, profile) @@ -435,11 +435,11 @@ def paramUpdate(self, name, value, category, profile): self.dbus_bridge.paramUpdate(name, value, category, profile) - def presenceUpdate(self, entity, show, priority, statuses, profile): - self.dbus_bridge.presenceUpdate(entity, show, priority, statuses, profile) + def presenceUpdate(self, entity_jid, show, priority, statuses, profile): + self.dbus_bridge.presenceUpdate(entity_jid, show, priority, statuses, profile) - def subscribe(self, sub_type, entity, profile): - self.dbus_bridge.subscribe(sub_type, entity, profile) + def subscribe(self, sub_type, entity_jid, profile): + self.dbus_bridge.subscribe(sub_type, entity_jid, profile) def updatedValue(self, name, value, profile): self.dbus_bridge.updatedValue(name, value, profile) diff -r deeebf697d9a -r e66d300c5d42 src/bridge/bridge_constructor/dbus_frontend_template.py --- a/src/bridge/bridge_constructor/dbus_frontend_template.py Thu Sep 29 12:09:31 2011 +0200 +++ b/src/bridge/bridge_constructor/dbus_frontend_template.py Thu Sep 29 12:13:22 2011 +0200 @@ -95,8 +95,8 @@ def quizGameAnswer(self, player, referee, answer, profile_key='@DEFAULT@'): return self.db_plugin_iface.quizGameAnswer(player, referee, answer, profile_key) - def sendFile(self, to, path, profile_key='@DEFAULT@'): - return self.db_plugin_iface.sendFile(to, path, profile_key) + def sendFile(self, to, path, data, profile_key='@DEFAULT@'): + return self.db_plugin_iface.sendFile(to, path, data, profile_key) def findGateways(self, target, profile_key='@DEFAULT@'): return self.db_plugin_iface.findGateways(target, profile_key)