diff options
Diffstat (limited to 'examples/pubsub_events.py')
-rwxr-xr-x[-rw-r--r--] | examples/pubsub_events.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/pubsub_events.py b/examples/pubsub_events.py index 6fe7159b..12c33a76 100644..100755 --- a/examples/pubsub_events.py +++ b/examples/pubsub_events.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + import sys import logging import getpass @@ -14,8 +17,8 @@ from sleekxmpp.xmlstream.handler import Callback # throughout SleekXMPP, we will set the default encoding # ourselves to UTF-8. if sys.version_info < (3, 0): - reload(sys) - sys.setdefaultencoding('utf8') + from sleekxmpp.util.misc_ops import setdefaultencoding + setdefaultencoding('utf8') else: raw_input = input @@ -77,7 +80,7 @@ class PubsubEvents(sleekxmpp.ClientXMPP): """Handle receiving a node deletion event.""" print('Deleted node %s' % ( msg['pubsub_event']['delete']['node'])) - + def _config(self, msg): """Handle receiving a node configuration event.""" print('Configured node %s:' % ( |