Properly inherit from lib.imgstream in mangafox.
[automanga.git] / manga / mangafox.py
index e06acfa..0ebca60 100644 (file)
@@ -3,7 +3,7 @@ import BeautifulSoup
 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"]
@@ -11,12 +11,6 @@ class imgstream(object):
     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()
@@ -198,3 +192,6 @@ class library(lib.library):
             pno += 1
             ls = self.alphapage(pno)
             i = 0
+
+    def __iter__(self):
+        raise NotImplementedError("mangafox iterator")