changeset 5581:d692d72ddacf

FIXME another hack for glasgow http proxy.
author Graham Percival <gperciva@gperciva-desktop.(none)>
date Wed, 23 Sep 2009 12:58:45 +0100
parents a66db6ad84c7
children b7ffa2338f75
files gub/versiondb.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gub/versiondb.py	Tue Sep 22 16:11:57 2009 +0100
+++ b/gub/versiondb.py	Wed Sep 23 12:58:45 2009 +0100
@@ -28,12 +28,17 @@
 import os
 import sys
 import misc
+import urllib2
 #
 from gub.syntax import printf
 
 def get_url_versions (url):
     printf (url)
-    opener = urllib.URLopener ()
+    # HACK for glasgow http proxy
+    proxy = urllib2.ProxyHandler({"http": "http://wwwcache.gla.ac.uk:8080"})
+    opener = urllib2.build_opener(proxy)
+    urllib2.install_opener(opener)
+    #url_stream = urllib2.urlopen (url)
     index = opener.open (url).read ()
 
     versions = []