changeset 1540:9a4e95c62380

plugin ad-hoc D-Bus: exception fixe + minor fixes
author Goffi <goffi@goffi.org>
date Wed, 30 Sep 2015 17:24:19 +0200
parents 98f92a054539
children 685fad1c18e4
files src/plugins/plugin_adhoc_dbus.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_adhoc_dbus.py	Tue Sep 29 20:19:43 2015 +0200
+++ b/src/plugins/plugin_adhoc_dbus.py	Wed Sep 30 17:24:19 2015 +0200
@@ -17,12 +17,12 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-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 @@
         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 @@
                     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 @@
                 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: