r7340 - dumbhippo/trunk/firehose/firehose/jobs



Author: walters
Date: 2008-02-22 16:32:35 -0600 (Fri, 22 Feb 2008)
New Revision: 7340

Modified:
   dumbhippo/trunk/firehose/firehose/jobs/poller.py
Log:
Another 2.4 urlparse fallback.


Modified: dumbhippo/trunk/firehose/firehose/jobs/poller.py
===================================================================
--- dumbhippo/trunk/firehose/firehose/jobs/poller.py	2008-02-22 22:18:50 UTC (rev 7339)
+++ dumbhippo/trunk/firehose/firehose/jobs/poller.py	2008-02-22 22:32:35 UTC (rev 7340)
@@ -41,7 +41,12 @@
         parsedurl = urlparse.urlparse(targeturl)
         try:
             _logger.info('Connecting to %r', targeturl)
-            connection = httplib.HTTPConnection(parsedurl.hostname, parsedurl.port)
+            hostport = parsedurl[1].split(':', 1)
+            if len(hostport) == 1:
+                (host,port) = (hostport[0], 80)
+            else:
+                (host,port) = hostport
+            connection = httplib.HTTPConnection(host, port)
             headers = {}
             if prev_timestamp is not None:
                 headers['If-Modified-Since'] = formatdate(prev_timestamp)            



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]