Push manifest into table crx column manifest.

This commit is contained in:
Michael Herzberg 2017-08-29 15:41:13 +01:00
parent 2b11117b6f
commit 7ffdf30545
1 changed files with 8 additions and 6 deletions

View File

@ -209,12 +209,6 @@ def parse_and_insert_crx(ext_id, date, datepath, con, verbose, indent):
size = os.path.getsize(crx_path)
public_key = read_crx(crx_path).public_key
con.insert(
"crx",
crx_etag=etag,
filename=filename,
size=size,
publickey=public_key)
with f.open("manifest.json") as m:
raw_content = m.read()
@ -235,6 +229,14 @@ def parse_and_insert_crx(ext_id, date, datepath, con, verbose, indent):
lines[index] = ""
content = "\n".join(lines)
con.insert(
"crx",
crx_etag=etag,
filename=filename,
size=size,
manifest=content,
publickey=public_key)
manifest = json.loads(content, strict=False)
if "permissions" in manifest:
for permission in manifest["permissions"]: