changeset 1933:16e65f15f31f

plugin adhoc_dbus, jp (cmd/adhoc): fixes adHocDBusAddAuto when no bus is found fix bug 134
author souliane <souliane@mailoo.org>
date Sun, 17 Apr 2016 13:37:40 +0200
parents 44342730df66
children 2daf7b4c6756
files frontends/src/jp/cmd_adhoc.py src/plugins/plugin_adhoc_dbus.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/jp/cmd_adhoc.py	Sun Apr 17 13:00:44 2016 +0200
+++ b/frontends/src/jp/cmd_adhoc.py	Sun Apr 17 13:37:40 2016 +0200
@@ -48,6 +48,9 @@
         bus_name, methods = self.host.bridge.adHocDBusAddAuto(name, jids, self.args.groups, magics,
                                                               self.args.forbidden_jids, self.args.forbidden_groups,
                                                               flags, self.profile)
+        if not bus_name:
+            self.disp(_("No bus name found"), 1)
+            return
         self.disp(_("Bus name found: [%s]" % bus_name), 1)
         for method in methods:
             path, iface, command = method
--- a/src/plugins/plugin_adhoc_dbus.py	Sun Apr 17 13:00:44 2016 +0200
+++ b/src/plugins/plugin_adhoc_dbus.py	Sun Apr 17 13:37:40 2016 +0200
@@ -130,7 +130,7 @@
         bus_names = [bus_name for bus_name in bus_names if '.' + prog_name in bus_name]
         if not bus_names:
             log.info("Can't find any bus for [%s]" % prog_name)
-            return
+            defer.returnValue(("", []))
         bus_names.sort()
         for bus_name in bus_names:
             if bus_name.endswith(prog_name):