From f52abec67347ebdbf42c6d0aad3af6ed2bb52b1b Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 30 Sep 2015 17:24:19 +0200 Subject: [PATCH] plugin ad-hoc D-Bus: exception fixe + minor fixes --- src/plugins/plugin_adhoc_dbus.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/plugin_adhoc_dbus.py b/src/plugins/plugin_adhoc_dbus.py index 2ffd6d93..bf78489a 100644 --- a/src/plugins/plugin_adhoc_dbus.py +++ b/src/plugins/plugin_adhoc_dbus.py @@ -17,12 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from sat.core.i18n import _, D_ +from sat.core.i18n import _ from sat.core.constants import Const as C from sat.core.log import getLogger log = getLogger(__name__) -from twisted.words.protocols.jabber import jid -from twisted.internet import defer, reactor +from sat.core import exceptions +from twisted.internet import defer from wokkel import data_form from lxml import etree from os import path @@ -103,7 +103,7 @@ class AdHocDBus(object): el = etree.fromstring(introspect_xml) for node in el.iterchildren('node', 'interface'): if node.tag == 'node': - new_path = path.join(proxy.object_path, node.get('name')) + new_path = os.path.join(proxy.object_path, node.get('name')) new_proxy = self.session_bus.get_object(bus_name, new_path, introspect=False) yield self._introspect(methods, bus_name, new_proxy) elif node.tag == 'interface': @@ -183,7 +183,7 @@ class AdHocDBus(object): x_elt = command_elt.elements(data_form.NS_X_DATA,'x').next() answer_form = data_form.Form.fromElement(x_elt) command = answer_form['command'] - except KeyError, StopIteration: + except (KeyError, StopIteration): raise self.XEP_0050.AdHocError(self.XEP_0050.ERROR.BAD_PAYLOAD) if command not in names_map: @@ -192,7 +192,7 @@ class AdHocDBus(object): path, iface, command = names_map[command] proxy = self.session_bus.get_object(bus_name, path) - d = self._DBusAsyncCall(proxy, command, interface=iface) + self._DBusAsyncCall(proxy, command, interface=iface) # job done, we can end the session, except if we have FLAG_LOOP if FLAG_LOOP in flags: