Fixed sqlite creation, added missing commit

This commit is contained in:
Michael Herzberg 2017-06-20 23:47:31 +01:00
parent 4220d48d34
commit 6833ba6683
1 changed files with 7 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class SelfclosingSqliteDB:
self.con = sqlite3.connect(self.filename)
return self.con
def __exit__(self, *args):
self.con.commit()
self.con.close()
@ -94,6 +95,12 @@ def setup_tables(con):
def get_etag(ext_id, datepath, con, verbose, indent):
txt = ""
# Trying to parse etag file
etagpath = next(iter(glob.glob(os.path.join(datepath, "*.crx.etag"))), None)
if etagpath:
with open(etagpath) as f:
return f.read(), txt
# Trying to parse header file for etag
headerpath = next(
iter(glob.glob(os.path.join(datepath, "*.crx.headers"))), None)