X-Git-Url: http://dolda2000.com/gitweb/?p=automanga.git;a=blobdiff_plain;f=manga%2Flib.py;h=da64e0c1a0e4ee56d7b632d6d2170e0c59ae5dce;hp=8cc96cb712d9f398f0c18bda1a839fe74b953c93;hb=9d051be1387a18756e9e01e93e8d52ecd53cadd1;hpb=36ec46b3e26fe306a16a4686f51cd76e99c35df1 diff --git a/manga/lib.py b/manga/lib.py index 8cc96cb..da64e0c 100644 --- a/manga/lib.py +++ b/manga/lib.py @@ -206,9 +206,6 @@ class cursor(object): return self.cur raise StopIteration() - def __next__(self): - return self.next() - def prev(self): for n, i in reversed(self.cur.stack): if i > 0: @@ -217,7 +214,14 @@ class cursor(object): raise StopIteration() def __iter__(self): - return self + def iterator(): + yield self.cur + while True: + try: + yield self.next() + except StopIteration: + break + return iterator() loaded = {} def findlib(name):