summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorAli Sabil <ali.sabil@gmail.com>2007-03-06 05:04:11 (GMT)
committerAli Sabil <ali.sabil@gmail.com>2007-03-06 05:04:11 (GMT)
commit41a2c90f768f3039e0bc68ea5e120428c4fa1397 (patch)
treef7bfa0f0cbed69993933b597bb1117c06a3ecadf /test.py
parentc6553a0aded6e7eacfd14ca3203b4f299b55c012 (diff)
downloadpapyon-41a2c90f768f3039e0bc68ea5e120428c4fa1397.tar.gz
papyon-41a2c90f768f3039e0bc68ea5e120428c4fa1397.tar.xz
- 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.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/test.py b/test.py
index b2d3986..bf20df4 100644
--- a/test.py
+++ b/test.py
@@ -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: