import lib, htcache
soup = BeautifulSoup.BeautifulSoup
-class imgstream(object):
+class imgstream(lib.imgstream):
def __init__(self, url):
self.bk = urllib.urlopen(url)
self.ctype = self.bk.info()["Content-Type"]
def close(self):
self.bk.close()
- def __enter__(self):
- return self
-
- def __exit__(self, *exc_info):
- self.close()
-
def read(self, sz = None):
if sz is None:
return self.bk.read()