From 11c90ef88589382bb4f9b9edfd3b762d6ba46201 Mon Sep 17 00:00:00 2001 From: Sven Bachmann Date: Fri, 20 Feb 2015 21:37:40 +0100 Subject: [PATCH] fixed sqlite create table parse regex At least SQLite 3.8.6 uses the format: [item] type, [item] type, [item] type, The previous variant tried to parse lines like: "item" type, "item" type, "item" type, --- scripts/extract_sqlite_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/extract_sqlite_models.py b/scripts/extract_sqlite_models.py index b9638ede..c21603c1 100644 --- a/scripts/extract_sqlite_models.py +++ b/scripts/extract_sqlite_models.py @@ -83,7 +83,7 @@ def sqlite(database_name): for line in sql_lines[1:-1]: if re.search('KEY', line) or re.search('PRIMARY', line) or re.search('"ID"', line) or line.startswith(')'): continue - hit = re.search(r'"(\S+)"\s+(\w+(\(\S+\))?),?( .*)?', line) + hit = re.search(r'\[(\S+)\]\s+(\w+(\(\S+\))?),?( .*)?', line) if hit is not None: name, d_type = hit.group(1), hit.group(2) d_type = re.sub(r'(\w+)\(.*', r'\1', d_type)