Add parent and timestamp files and fix debug logging

This commit is contained in:
J.C. Jones 2020-05-01 17:31:36 -07:00
Родитель 2c86b825f5
Коммит c60aa586a0
4 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -1,4 +1,4 @@
[flake8]
# See http://pep8.readthedocs.io/en/latest/intro.html#configuration
ignore = E121, E123, E126, E129, E133, E203, E226, E231, E241, E242, E704, W503, E402, E741
max-line-length = 99
max-line-length = 101

Просмотреть файл

@ -237,6 +237,7 @@ class CRLiteDB(object):
all_entries = stash_entries + [filter_entries.pop()]
for entry in progressbar.progressbar(all_entries):
log.debug(f"Downloading Kinto entry={entry})")
local_path = self.db_path / entry["details"]["name"]
ensure_local(
base_url=attachments_base_url, local_path=local_path, entry=entry

Просмотреть файл

@ -32,8 +32,6 @@ def find_attachments_base_url(urlstring):
def main():
logging.basicConfig(level=logging.INFO)
parser = argparse.ArgumentParser(
description="Query CRLite data",
epilog="""
@ -89,11 +87,13 @@ def main():
args.crlite_url = crlite_collection_stage
if args.verbose > 0:
log.setLevel("DEBUG")
logging.basicConfig(level=logging.DEBUG)
if args.verbose > 1:
from pyasn1 import debug
debug.setLogger(debug.Debug("all"))
else:
logging.basicConfig(level=logging.INFO)
db_dir = args.db.expanduser()

Просмотреть файл

@ -81,6 +81,7 @@ class MockCRLiteDataRequestHandler(MockCollectionRequestHandler):
"extra": {
"details": {"name": "2020-04-02T06:00:00Z-full"},
"incremental": False,
"effectiveTimestamp": 1585807200000,
},
},
{
@ -90,6 +91,8 @@ class MockCRLiteDataRequestHandler(MockCollectionRequestHandler):
"extra": {
"details": {"name": "2020-04-02T12:00:00Z-diff"},
"incremental": True,
"effectiveTimestamp": 1585828800000,
"parent": "80e8e148fbf95aed39783f1fcc2d4576074f8c487656ca2d53571da4b17e20a9",
},
},
]