frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
This commit is contained in:
parent
55a8f2d76a
commit
6005b00583
6 changed files with 32 additions and 32 deletions
|
|
@ -56,8 +56,8 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
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 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
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 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
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 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -187,11 +187,11 @@ class JP():
|
|||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -283,5 +283,5 @@ class Chat(urwid.WidgetWrap, QuickChat):
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ class Chat(wx.Frame, QuickChat):
|
|||
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):
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class DbusObject(dbus.service.Object):
|
|||
|
||||
@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 @@ class DbusObject(dbus.service.Object):
|
|||
|
||||
@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 @@ class DbusObject(dbus.service.Object):
|
|||
|
||||
@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 @@ class DbusObject(dbus.service.Object):
|
|||
@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 @@ class DbusObject(dbus.service.Object):
|
|||
@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 @@ class DbusObject(dbus.service.Object):
|
|||
@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 @@ class DBusBridge(Bridge):
|
|||
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 @@ class DBusBridge(Bridge):
|
|||
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 @@ class DBusBridge(Bridge):
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue