From 9bef4b4d4d54768cb753e4bbfec049e97d063882 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 1 Sep 2010 14:47:42 -0400 Subject: [PATCH] Move the examples to a top-level examples directory. --- .../component_example.py => examples/component.py | 0 example.py => examples/echo_client.py | 12 ++++++------ 2 files changed, 6 insertions(+), 6 deletions(-) rename sleekxmpp/component_example.py => examples/component.py (100%) rename example.py => examples/echo_client.py (93%) diff --git a/sleekxmpp/component_example.py b/examples/component.py similarity index 100% rename from sleekxmpp/component_example.py rename to examples/component.py diff --git a/example.py b/examples/echo_client.py similarity index 93% rename from example.py rename to examples/echo_client.py index 4eb88b3b..5e6314f0 100644 --- a/example.py +++ b/examples/echo_client.py @@ -14,12 +14,12 @@ if sys.version_info < (3,0): class Example(sleekxmpp.ClientXMPP): - + def __init__(self, jid, password): sleekxmpp.ClientXMPP.__init__(self, jid, password) self.add_event_handler("session_start", self.start) self.add_event_handler("message", self.message) - + def start(self, event): self.getRoster() self.sendPresence() @@ -36,18 +36,18 @@ if __name__ == '__main__': optp.add_option("-j","--jid", dest="jid", help="JID to use") optp.add_option("-p","--password", dest="password", help="password to use") opts,args = optp.parse_args() - + logging.basicConfig(level=opts.loglevel, format='%(levelname)-8s %(message)s') xmpp = Example(opts.jid, opts.password) - xmpp.registerPlugin('xep_0030') + xmpp.registerPlugin('xep_0030') xmpp.registerPlugin('xep_0004') xmpp.registerPlugin('xep_0060') xmpp.registerPlugin('xep_0199') # use this if you don't have pydns, and want to # talk to GoogleTalk (e.g.) -# if xmpp.connect(('talk.google.com', 5222)): - if xmpp.connect(): + if xmpp.connect(('talk.google.com', 5222)): + #khif xmpp.connect(): xmpp.process(threaded=False) print("done") else: