- name = info.h3.a.string.strip()
- ret.append(manga(self, id, name, url))
- return ret
+ name = link.text.strip()
+ yield manga(self, id, name, url)
+ p += 1
+ if not hasmore:
+ break
+
+ rure = re.compile(r"/comic/_/([^/]*)$")
+ def search(self, expr):
+ if not isinstance(expr, unicode):
+ expr = expr.decode("utf8")
+ return self._search({"name": expr.encode("utf8"), "name_cond": "c"})
+
+ def byname(self, prefix):
+ if not isinstance(prefix, unicode):
+ prefix = prefix.decode("utf8")
+ for res in self._search({"name": prefix.encode("utf8"), "name_cond": "s"}):
+ if res.name[:len(prefix)].lower() == prefix.lower():
+ yield res
+ else:
+ for aname in res.altnames():
+ if aname[:len(prefix)].lower() == prefix.lower():
+ yield manga(self, res.id, aname, res.url)
+ break
+ else:
+ if False:
+ print "eliding " + res.name
+ print res.altnames()