[libsocialweb] examples: Allow to pass the query string on the command line



commit b05c8227852d656c26a34186718f0de38d694b0b
Author: Marco Barisione <marco barisione org>
Date:   Wed Oct 27 11:53:49 2010 +0100

    examples: Allow to pass the query string on the command line

 examples/query.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/examples/query.py b/examples/query.py
index 66034fd..5421e77 100755
--- a/examples/query.py
+++ b/examples/query.py
@@ -27,7 +27,11 @@ bus.start_service_by_name("com.meego.libsocialweb")
 
 service = bus.get_object("com.meego.libsocialweb", "/com/meego/libsocialweb/Service/%s" % sys.argv[1])
 
-path = service.OpenView("feed", {}, dbus_interface="com.meego.libsocialweb.Query")
+if len(sys.argv) > 2:
+    query = sys.argv[2]
+else:
+    query = "feed"
+path = service.OpenView(query, {}, dbus_interface="com.meego.libsocialweb.Query")
 view = bus.get_object("com.meego.libsocialweb", path)
 view = dbus.Interface(view, "com.meego.libsocialweb.ItemView")
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]