mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-21 13:52:30 +02:00
fix lint errors
This commit is contained in:
@@ -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:
|
with open(settings.ERROR_LOG, "a+") as f:
|
||||||
command = ' '.join(sys.argv)
|
command = ' '.join(sys.argv)
|
||||||
ts = datetime.now().strftime('%Y-%m-%d__%H:%M:%S')
|
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:
|
if check_db:
|
||||||
sql_index_path = Path(output_dir) / SQL_INDEX_FILENAME
|
sql_index_path = Path(output_dir) / SQL_INDEX_FILENAME
|
||||||
|
@@ -6,7 +6,6 @@ import re
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from datetime import datetime
|
|
||||||
from django.utils.crypto import get_random_string
|
from django.utils.crypto import get_random_string
|
||||||
|
|
||||||
from ..config import ( # noqa: F401
|
from ..config import ( # noqa: F401
|
||||||
|
@@ -7,7 +7,6 @@ For more information on this file, see
|
|||||||
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
|
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from archivebox.config import setup_django
|
from archivebox.config import setup_django
|
||||||
setup_django(in_memory_db=False, check_db=True)
|
setup_django(in_memory_db=False, check_db=True)
|
||||||
|
@@ -30,7 +30,6 @@ def remove_from_sql_main_index(snapshots: QuerySet, out_dir: Path=OUTPUT_DIR) ->
|
|||||||
@enforce_types
|
@enforce_types
|
||||||
def write_link_to_sql_index(link: Link):
|
def write_link_to_sql_index(link: Link):
|
||||||
from core.models import Snapshot, ArchiveResult
|
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}
|
info = {k: v for k, v in link._asdict().items() if k in Snapshot.keys}
|
||||||
tags = info.pop("tags")
|
tags = info.pop("tags")
|
||||||
if tags is None:
|
if tags is None:
|
||||||
|
@@ -68,7 +68,12 @@ def get_fd_info(fd) -> Dict[str, Any]:
|
|||||||
IS_TERMINAL = not (IS_PIPE or IS_FILE)
|
IS_TERMINAL = not (IS_PIPE or IS_FILE)
|
||||||
IS_LINE_BUFFERED = fd.line_buffering
|
IS_LINE_BUFFERED = fd.line_buffering
|
||||||
IS_READABLE = fd.readable()
|
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
|
# # Log debug information about stdin, stdout, and stderr
|
||||||
|
Reference in New Issue
Block a user