From b4c06e17ad41f3952e15f00bc52c64e0852650dd Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Wed, 24 Sep 2014 01:35:11 +0100 Subject: Couple of fixes for convert script --- convert.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/convert.py b/convert.py index e5e35eb..005507f 100755 --- a/convert.py +++ b/convert.py @@ -47,7 +47,7 @@ def create(): cur.execute("INSERT INTO info (key, value) VALUES('version', '1')") except sqlite3.Error, e: - print "Database Error %d: %s" % (e.args[0],e.args[1]) + print "Database Error %s" % (e.args[0]) sys.exit(1) def select_wn(): @@ -223,7 +223,6 @@ def parse_foldoc(): if char == "}": count_braces += 1 if count_braces == 1: - print "print " see_also = True definition += remaining.strip("<> ").replace("{", "").replace("}", "") @@ -255,7 +254,7 @@ def parse_foldoc(): definition += part.replace("{", "").replace("}", "") elif len(line) > 0: #Ignore date lines - if line[0] != "(" and line[-1] != ")" and not line[1].isdigit(): + if len(line) > 1 and line[0] != "(" and line[-1] != ")" and not line[1].isdigit(): definition += line.replace("{", "").replace("}", "") if len(definition) > 0 and definition[-1] != " ": definition += " " @@ -273,10 +272,10 @@ def main(): version = get_db_version() - if version == 0: - create() - items = select() - insert(items) + # if version == 0: + # create() + # items = select_wn() + # insert(items) update_db(version) parse_foldoc() -- cgit v1.2.3