1
0
Fork 0
mirror of synced 2024-06-01 10:09:49 +12:00

fix lint errors

This commit is contained in:
Nick Sweeting 2021-02-16 16:26:48 -05:00
parent d89034dcde
commit 6f0eec92eb
5 changed files with 7 additions and 5 deletions

View file

@ -1097,7 +1097,7 @@ def setup_django(out_dir: Path=None, check_db=False, config: ConfigDict=CONFIG,
with open(settings.ERROR_LOG, "a+") as f:
command = ' '.join(sys.argv)
ts = datetime.now().strftime('%Y-%m-%d__%H:%M:%S')
f.write(f"\n> {command}; ts={ts} version={VERSION} docker={IN_DOCKER} is_tty={IS_TTY}\n")
f.write(f"\n> {command}; ts={ts} version={config['VERSION']} docker={config['IN_DOCKER']} is_tty={config['IS_TTY']}\n")
if check_db:
sql_index_path = Path(output_dir) / SQL_INDEX_FILENAME

View file

@ -6,7 +6,6 @@ import re
import logging
from pathlib import Path
from datetime import datetime
from django.utils.crypto import get_random_string
from ..config import ( # noqa: F401

View file

@ -7,7 +7,6 @@ For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from archivebox.config import setup_django
setup_django(in_memory_db=False, check_db=True)

View file

@ -30,7 +30,6 @@ def remove_from_sql_main_index(snapshots: QuerySet, out_dir: Path=OUTPUT_DIR) ->
@enforce_types
def write_link_to_sql_index(link: Link):
from core.models import Snapshot, ArchiveResult
from index.schema import ArchiveResult as LegacyArchiveResult
info = {k: v for k, v in link._asdict().items() if k in Snapshot.keys}
tags = info.pop("tags")
if tags is None:

View file

@ -68,7 +68,12 @@ def get_fd_info(fd) -> Dict[str, Any]:
IS_TERMINAL = not (IS_PIPE or IS_FILE)
IS_LINE_BUFFERED = fd.line_buffering
IS_READABLE = fd.readable()
return {key: val for key, val in locals().items() if val is not fd}
return {
'NAME': NAME, 'FILENO': FILENO, 'MODE': MODE,
'IS_TTY': IS_TTY, 'IS_PIPE': IS_PIPE, 'IS_FILE': IS_FILE,
'IS_TERMINAL': IS_TERMINAL, 'IS_LINE_BUFFERED': IS_LINE_BUFFERED,
'IS_READABLE': IS_READABLE,
}
# # Log debug information about stdin, stdout, and stderr