Thread (7 messages) 7 messages, 1 author, 2012-09-06

[PATCH obexd 5/7 v3] test: Update pbap-client to work with changes in PhonebookAcess

flat view
STALE5149d

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2012-09-06 09:26:00
Subsystem: the rest · Maintainer: Linus Torvalds

From: Luiz Augusto von Dentz <redacted>

---
 test/pbap-client | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/test/pbap-client b/test/pbap-client
index 498f8a3..7dd54ef 100755
--- a/test/pbap-client
+++ b/test/pbap-client
@@ -70,16 +70,16 @@ class PbapClient:
 		print "Transfer finished with error %s: %s" % (code, message)
 		mainloop.quit()
 
-	def pull(self, vcard, func):
+	def pull(self, vcard, params, func):
 		req = Transfer(func)
-		self.pbap.Pull(vcard, "",
+		self.pbap.Pull(vcard, "", params,
 				reply_handler=lambda r: self.register(r, req),
 				error_handler=self.error)
 		self.transfers += 1
 
-	def pull_all(self, func):
+	def pull_all(self, params, func):
 		req = Transfer(func)
-		self.pbap.PullAll("",
+		self.pbap.PullAll("", params,
 				reply_handler=lambda r: self.register(r, req),
 				error_handler=self.error)
 		self.transfers += 1
@@ -135,18 +135,15 @@ if  __name__ == '__main__':
 		print "Size = %d\n" % (ret)
 
 		print "\n--- List vCard ---\n"
-		ret = pbap_client.interface().List()
+		ret = pbap_client.interface().List(dbus.Dictionary())
+		params = dbus.Dictionary({ "Format" : "vcard30",
+					"Fields" : [ "VERSION", "FN", "TEL"] })
 		for item in ret:
 			print "%s : %s" % (item[0], item[1])
-			pbap_client.interface().SetFormat("vcard30")
-			pbap_client.interface().SetFilter(["VERSION", "FN",
-								"TEL"]);
-			pbap_client.pull(item[0],
+			pbap_client.pull(item[0], params,
 					lambda x: process_result(x, None))
 
-		pbap_client.interface().SetFormat("vcard30")
-		pbap_client.interface().SetFilter(["VERSION", "FN", "TEL"]);
-		pbap_client.pull_all(lambda x: process_result(x,
+		pbap_client.pull_all(params, lambda x: process_result(x,
 							"\n--- PullAll ---\n"))
 
 		pbap_client.flush_transfers(lambda: test_paths(paths[1:]))
-- 
1.7.11.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help