diff options
author | Ali Sabil <ali.sabil@gmail.com> | 2007-05-08 20:12:01 +0200 |
---|---|---|
committer | Ali Sabil <ali.sabil@gmail.com> | 2007-05-08 20:12:01 +0200 |
commit | ebc2c89bbcd77db9aef7c48638405066d4627a53 (patch) | |
tree | 3f5c46a9b611167209f35506d050425ffe963a3f /test.py | |
parent | d911010e27879b0ae65755c34873b9c0f4e8aaad (diff) |
- Added initial switchboard protocol implementation
- Changed the Client interface to use events handlers
- Improved error reporting in GNet
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -23,32 +23,38 @@ def get_proxies(): class Client(pymsn.Client): def __init__(self, account, quit, http_mode=False): - server = ('207.46.109.66', 1863) + server = ('messenger.hotmail.com', 1863) self.quit = quit + self.account = account if http_mode: from pymsn.transport import HTTPPollConnection - pymsn.Client.__init__(self, server, account, get_proxies(), HTTPPollConnection) + pymsn.Client.__init__(self, server, get_proxies(), HTTPPollConnection) else: - pymsn.Client.__init__(self, server, account, proxies = get_proxies()) + pymsn.Client.__init__(self, server, proxies = get_proxies()) + self.add_events_handler(self) gobject.idle_add(self._connect) def _connect(self): - self.login() + self.login(*self.account) return False - def on_connect_failure(self, proto): - print "Connect failed" + def on_connect_failure(self, reason): + print "Connect failed", reason self.quit() - def on_login_failure(self, proto): + def on_login_failure(self): print "Login failed" self.quit() - def on_login_success(self, proto): + def on_login_success(self): self.profile.presence = pymsn.Presence.ONLINE self.profile.display_name = "Kimbix" self.profile.personal_message = "Testing pymsn, and freeing the pandas!" + def on_disconnected(self, reason): + print "Disconnected" + self.quit() + def main(): import sys import getpass |