Don't crash on tag listing when a manga has ceased to exist.
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 4 May 2014 20:30:30 +0000 (22:30 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 4 May 2014 20:30:30 +0000 (22:30 +0200)
automanga

index 98b3c9b..a3e7af4 100755 (executable)
--- a/automanga
+++ b/automanga
@@ -79,8 +79,11 @@ def main():
     if listtag is not None:
         if profile is not None:
             for mprof in profile.bytag(listtag):
     if listtag is not None:
         if profile is not None:
             for mprof in profile.bytag(listtag):
-                mng = mprof.open()
-                sys.stdout.write("%s %s: \"%s\"\n" % (mprof.libnm, mprof.id, mng.name))
+                try:
+                    mng = mprof.open()
+                    sys.stdout.write("%s %s: \"%s\"\n" % (mprof.libnm, mprof.id, mng.name))
+                except KeyError:
+                    sys.stdout.write("%s %s: no longer exists\n" % (mprof.libnm, mprof.id))
         return
 
     if alias and (alias.find('=') > 0):
         return
 
     if alias and (alias.find('=') > 0):