ann.py: Fixed searching for names beginning with "a ".
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 22 Dec 2019 03:22:49 +0000 (04:22 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 22 Dec 2019 03:22:49 +0000 (04:22 +0100)
ann.py

diff --git a/ann.py b/ann.py
index ee3d472..935e0a9 100644 (file)
--- a/ann.py
+++ b/ann.py
@@ -157,7 +157,7 @@ class anime(object):
 
 linkpat = re.compile("^/encyclopedia/anime\\.php\\?id=(\d+)$")
 def getlist(name):
-    name = s(name, "^the\s+", "")
+    name = s(name, "^(the|a)\s+", "")
     if len(name) < 1:
         raise error("list() needs a prefix of at least one character")
     fc = name[0]
@@ -173,6 +173,7 @@ def getlist(name):
         for el in link.font:
             if isinstance(el, str):
                 mn += el.strip()
+        mn = s(mn, "^a\s+", "")
         if mn.lower().startswith(name.lower()):
             m = linkpat.match(link["href"])
             if not m: