]> git.armaanb.net Git - lightcards.git/commitdiff
Make parser reject single column tables
authorArmaan Bhojwani <me@armaanb.net>
Tue, 9 Feb 2021 03:58:20 +0000 (22:58 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Tue, 9 Feb 2021 03:58:20 +0000 (22:58 -0500)
lightcards/parse.py

index ea3468d66bfdca5f898431ce3a8d6743712b405f..6fc2a759cf2ac152f636b9a376efa9ddf2d9db29 100644 (file)
@@ -32,7 +32,7 @@ def parse_html(html):
         sys.exit("lightcards: No table found")
 
     ths = soup.find_all("th")
-    if not len(ths) in [1, 2]:
+    if len(ths) != 2:
         sys.exit("lightcards: Headings malformed")
 
     # Return a tuple of nested lists