4 def with_db(db_fname
, fn
, *args
, **kwargs
):
5 """Wrapper for a full self-contained SQLite database transaction."""
6 conn
= sqlite3
.connect(db_fname
)
9 fn(cur
, *args
, **kwargs
)
18 infile
= gzip
.open(fname
)
22 if e
.args
[0] == "Not a gzipped file":
23 with
open(fname
) as infile
: