summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2014-09-24 01:35:11 +0100
committerJoe Robinson <joe@lc8n.com>2014-09-24 01:35:11 +0100
commitb4c06e17ad41f3952e15f00bc52c64e0852650dd (patch)
tree60247e4b33fe63afffb9e2088ea75bb6f81e5a44
parent7a1c8cc2a638518d2936e7e919d6d2edb0710980 (diff)
Couple of fixes for convert script
-rwxr-xr-xconvert.py13
1 files 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()