Changeset 517
- Timestamp:
- 03/14/08 18:35:27 (8 months ago)
- Files:
-
- trunk/py/ModestMaps/__init__.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/py/ModestMaps/__init__.py
r480 r517 8 8 """ 9 9 10 import PIL.Image, urllib, StringIO, math, thread, time10 import sys, PIL.Image, urllib, httplib, urlparse, StringIO, math, thread, time 11 11 12 12 import Tiles … … 107 107 # this is the time-consuming part 108 108 try: 109 imgs = [PIL.Image.open(StringIO.StringIO(urllib.urlopen(url).read())).convert('RGBA') 110 for url in urls] 109 imgs = [] 110 111 for (scheme, netloc, path, params, query, fragment) in map(urlparse.urlparse, urls): 112 conn = httplib.HTTPConnection(netloc) 113 conn.request('GET', path + '?' + query) 114 response = conn.getresponse() 115 116 if str(response.status).startswith('2'): 117 imgs.append(PIL.Image.open(StringIO.StringIO(response.read())).convert('RGBA')) 118 111 119 except: 112 120
