diff options
author | Rob Taylor <rob.taylor@codethink.co.uk> | 2009-02-06 14:32:41 +0100 |
---|---|---|
committer | Rob Taylor <rob.taylor@codethink.co.uk> | 2009-02-06 14:32:41 +0100 |
commit | 6fe219985afb9e28bc8a7ab3f4f70713de434d60 (patch) | |
tree | 51ccd3c1e15b5b15d338cdaa4985c031c786ee9a /python | |
parent | 50bdddd0f3f9885b0d1b57706767b0b76643e971 (diff) |
Fix up python tests for new callback types.
Diffstat (limited to 'python')
-rw-r--r-- | python/ContextProvider.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/python/ContextProvider.py b/python/ContextProvider.py index 28e9290a..0e0305a8 100644 --- a/python/ContextProvider.py +++ b/python/ContextProvider.py @@ -16,7 +16,8 @@ class PROVIDER(c_void_p): class ContextProvider: GET_CALLBACK = CFUNCTYPE(c_int, STRING_SET, CHANGE_SET, c_void_p) - SUBSCRIBE_CALLBACK = CFUNCTYPE(c_int, STRING_SET, c_void_p) + SUBSCRIBED_CALLBACK = CFUNCTYPE(c_int, STRING_SET, c_void_p) + UNSUBSCRIBED_CALLBACK = CFUNCTYPE(c_int, STRING_SET, STRING_SET, c_void_p) init = cfunc('context_provider_init', _dll, None, ('useSessionBus', c_int, 1), @@ -25,9 +26,9 @@ class ContextProvider: ('provided_keys', ListPOINTER (c_char_p), 1), ('get_cb', GET_CALLBACK, 1), ('get_cb_target', c_void_p, 1), - ('first_cb', SUBSCRIBE_CALLBACK, 1), + ('first_cb', SUBSCRIBED_CALLBACK, 1), ('first_cb_target', c_void_p, 1), - ('last_cb', SUBSCRIBE_CALLBACK, 1), + ('last_cb', UNSUBSCRIBED_CALLBACK, 1), ('last_cb_target', c_void_p, 1)) remove = cfunc('context_provider_remove', _dll, None, ('provider', PROVIDER, 1)) @@ -118,15 +119,16 @@ if __name__ == "__main__": return 0 def first_cb (ss, d): print StringSet.debug(ss) - def last_cb (ss, d): + def last_cb (ss, ss_remain, d): print StringSet.debug(ss) + print StringSet.debug(ss_remain) ContextProvider.init(1, "org.freedesktop.ContextKit.Testing.Provider") p =ContextProvider.install(["foo.bar", "foo.baz"], ContextProvider.GET_CALLBACK(get_cb), None, - ContextProvider.SUBSCRIBE_CALLBACK(first_cb), None, - ContextProvider.SUBSCRIBE_CALLBACK(last_cb), None) + ContextProvider.SUBSCRIBED_CALLBACK(first_cb), None, + ContextProvider.UNSUBSCRIBED_CALLBACK(last_cb), None) print ContextProvider.no_of_subscribers("foo.bar") cs = ContextProvider.change_set_create() ContextProvider.change_set_cancel(cs) |