[d-feet] ExecuteMethodDialog: Pretty-print multiple results
- From: Will Thompson <wjt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [d-feet] ExecuteMethodDialog: Pretty-print multiple results
- Date: Fri, 24 Nov 2017 15:57:00 +0000 (UTC)
commit 3d3f0ec0ce84d0caeeba6adbbee873e91f9be211
Author: Simon McVittie <smcv collabora com>
Date: Fri Jun 30 16:17:39 2017 +0100
ExecuteMethodDialog: Pretty-print multiple results
If a D-Bus method returns multiple results, d-feet previously only
pretty-printed the first. Print them one per line, so a method with
return signature 'isa{sv}' might end up showing:
123,
"hello, world!",
{}
Signed-off-by: Simon McVittie <smcv collabora com>
https://bugzilla.gnome.org/show_bug.cgi?id=784387
src/dfeet/executemethoddialog.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/dfeet/executemethoddialog.py b/src/dfeet/executemethoddialog.py
index 31b274e..92dc94d 100644
--- a/src/dfeet/executemethoddialog.py
+++ b/src/dfeet/executemethoddialog.py
@@ -108,7 +108,8 @@ class ExecuteMethodDialog:
# output result
if result:
self.source_textview.get_buffer().set_text(str(result))
- self.prettyprint_textview.get_buffer().set_text(pformat(result.unpack()[0]))
+ lines = [pformat(x) for x in result.unpack()]
+ self.prettyprint_textview.get_buffer().set_text(',\n'.join(lines))
else:
self.prettyprint_textview.get_buffer().set_text(
'This method did not return anything')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]