diff options
author | Ali Sabil <ali.sabil@gmail.com> | 2007-03-06 10:34:11 +0530 |
---|---|---|
committer | Ali Sabil <ali.sabil@gmail.com> | 2007-03-06 10:34:11 +0530 |
commit | 41a2c90f768f3039e0bc68ea5e120428c4fa1397 (patch) | |
tree | f7bfa0f0cbed69993933b597bb1117c06a3ecadf /test.py | |
parent | c6553a0aded6e7eacfd14ca3203b4f299b55c012 (diff) |
- Fixed GNet protocol/HTTP.py http proxy authentication support
- Added HTTPPoll Transport
- Added transport selection to the client
- Added --http switch to test.py
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -18,10 +18,14 @@ def get_proxies(): return result class Client(pymsn.Client): - def __init__(self, account, quit): + def __init__(self, account, quit, http_mode=False): server = ('207.46.109.66', 1863) self.quit = quit - pymsn.Client.__init__(self, server, account, proxies = get_proxies()) + if http_mode: + from pymsn.transport import HTTPPollConnection + pymsn.Client.__init__(self, server, account, get_proxies(), HTTPPollConnection) + else: + pymsn.Client.__init__(self, server, account, proxies = get_proxies()) gobject.idle_add(self.connect) def connect(self): @@ -43,6 +47,12 @@ def main(): import sys import getpass import signal + + if "--http" in sys.argv: + http_mode = True + sys.argv.remove('--http') + else: + http_mode = False if len(sys.argv) < 2: account = raw_input('Account: ') @@ -64,7 +74,7 @@ def main(): signal.signal(signal.SIGTERM, sigterm_cb) - n = Client((account, passwd), quit) + n = Client((account, passwd), quit, http_mode) while mainloop.is_running(): try: |