diff options
author | Joe Robinson <joe@lc8n.com> | 2014-09-24 01:35:11 +0100 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2014-09-24 01:35:11 +0100 |
commit | b4c06e17ad41f3952e15f00bc52c64e0852650dd (patch) | |
tree | 60247e4b33fe63afffb9e2088ea75bb6f81e5a44 /convert.py | |
parent | 7a1c8cc2a638518d2936e7e919d6d2edb0710980 (diff) |
Couple of fixes for convert script
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() |