diff options
| author | Devendra | 2014-04-23 12:54:16 +0530 |
|---|---|---|
| committer | Devendra | 2014-04-23 12:54:16 +0530 |
| commit | fdb46e56fa6794940f9fbe51a2863d58e927e655 (patch) | |
| tree | 99d71159c47858aaa17b31b77d4e5a153c2153cf /python/examples/dev-console.py | |
| parent | 69240816755406b26b364f37ca521fdb269581d1 (diff) | |
| download | pubnub-python-fdb46e56fa6794940f9fbe51a2863d58e927e655.tar.bz2 | |
switching to positional arguments
Diffstat (limited to 'python/examples/dev-console.py')
| -rwxr-xr-x | python/examples/dev-console.py | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/python/examples/dev-console.py b/python/examples/dev-console.py index adade8f..383fa68 100755 --- a/python/examples/dev-console.py +++ b/python/examples/dev-console.py @@ -145,12 +145,7 @@ def _publish_command_handler(): print_ok(r) def _error(r): print_error(r) - pubnub.publish({ - 'channel' : channel, - 'message' : message, - 'callback' : _callback, - 'error' : _error - }) + pubnub.publish(channel, message, _callback, _error) def _subscribe_command_handler(): @@ -159,11 +154,7 @@ def _subscribe_command_handler(): print_ok(r, channel) def _error(r): print_error(r, channel) - pubnub.subscribe({ - 'channel' : channel, - 'callback' : _callback, - 'error' : _error - }) + pubnub.subscribe(channel, _callback, _error) def _unsubscribe_command_handler(): channel = get_input("[UNSUBSCRIBE] Enter Channel Name ", str) @@ -171,11 +162,7 @@ def _unsubscribe_command_handler(): print_ok(r) def _error(r): print_error(r) - pubnub.unsubscribe({ - 'channel' : channel, - 'callback' : _callback, - 'error' : _error - }) + pubnub.unsubscribe(channel) def _grant_command_handler(): def _callback(r): @@ -217,12 +204,7 @@ def _history_command_handler(): channel = get_input("[HISTORY] Enter Channel Name ", str) count = get_input("[HISTORY] Enter Count ", int) - pubnub.history({ - 'channel' : channel, - 'count' : count, - 'callback' : _callback, - 'error' : _error - }) + pubnub.history(channel, count, callback=_callback, error=_error) def _here_now_command_handler(): @@ -232,13 +214,7 @@ def _here_now_command_handler(): print_error(r) channel = get_input("[HERE NOW] Enter Channel Name ", str) - pubnub.here_now({ - 'channel' : channel, - 'callback' : _callback, - 'error' : _error - }) - - + pubnub.here_now(channel, callback=_callback, error=_error) commands = [] |
