Dolda2000 GitWeb
/
automanga.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36ec46b
)
Fixed up cursor iteration more properly(?)
author
Fredrik Tolf
<fredrik@dolda2000.com>
Mon, 15 May 2017 03:05:28 +0000
(
05:05
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Mon, 15 May 2017 03:05:28 +0000
(
05:05
+0200)
manga/lib.py
patch
|
blob
|
blame
|
history
diff --git
a/manga/lib.py
b/manga/lib.py
index
8cc96cb
..
da64e0c
100644
(file)
--- 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):