diff options
Diffstat (limited to 'convert.py')
-rwxr-xr-x | convert.py | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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() |