aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/extract.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/extract.py b/tools/extract.py
index d60de84..f323d44 100644
--- a/tools/extract.py
+++ b/tools/extract.py
@@ -53,11 +53,15 @@ def keep(name):
return k == "+"
return True
+class Row(sqlite3.Row):
+ def __getattr__(self, name):
+ return self[name]
+
db = sqlite3.connect("trac.db")
-db.row_factory = sqlite3.Row
+db.row_factory = Row
for row in db.execute(wiki_query):
- if keep(row["name"]):
- print(urllib.parse.quote(row["name"], ""), row["version"])
+ if keep(row.name):
+ print(urllib.parse.quote(row.name, ""), row.version)
db.close()