diff options
| author | Devendra | 2014-04-23 21:35:06 +0530 | 
|---|---|---|
| committer | Devendra | 2014-04-23 21:35:06 +0530 | 
| commit | f7b89bfafae34fa22509c1d1c59d1284ec62c5df (patch) | |
| tree | 2eeaf63f906ade16c82c86844e8f76b191b9ad6c /python/examples/dev-console.py | |
| parent | 1d97c69f186719fe007a4fa0033d39d9a68a4e43 (diff) | |
| download | pubnub-python-f7b89bfafae34fa22509c1d1c59d1284ec62c5df.tar.bz2 | |
exception handling changes
Diffstat (limited to 'python/examples/dev-console.py')
| -rwxr-xr-x | python/examples/dev-console.py | 26 | 
1 files changed, 10 insertions, 16 deletions
| diff --git a/python/examples/dev-console.py b/python/examples/dev-console.py index 2e93c7e..868ba7c 100755 --- a/python/examples/dev-console.py +++ b/python/examples/dev-console.py @@ -55,13 +55,13 @@ parser.add_option("--uuid",  print(options) -pubnub = Pubnub(options.publish_key,  -                options.subscribe_key,  -                options.secret_key,  -                options.cipher_key,  -                options.auth_key,  -                options.ssl,  -                options.origin,  +pubnub = Pubnub(options.publish_key, +                options.subscribe_key, +                options.secret_key, +                options.cipher_key, +                options.auth_key, +                options.ssl, +                options.origin,                  options.uuid) @@ -87,7 +87,7 @@ def print_ok(msg, channel=None):          "] " if channel is not None else "" + color.END      try:          print(chstr + color.GREEN + str(msg) + color.END) -    except Exception as e: +    except UnicodeEncodeError as e:          print(msg) @@ -98,7 +98,7 @@ def print_error(msg, channel=None):          "] " if channel is not None else "" + color.END      try:          print(chstr + color.RED + color.BOLD + str(msg) + color.END) -    except: +    except UnicodeEncodeError as e:          print(msg)  import threading @@ -107,13 +107,7 @@ import threading  def kill_all_threads():      for thread in threading.enumerate():          if thread.isAlive(): -            try: -                thread._Thread__stop() -            except Exception as e: -                pass -                #print(e) -                #thread.exit() -                #print(str(thread.getName()) + ' could not be terminated') +            thread._Thread__stop()  def get_input(message, t=None): | 
