From f0033f75d07d856d9b3c60ea679f3b6241806ba5 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Thu, 4 May 2023 01:43:34 -0700 Subject: [PATCH] config.py lint fixes --- archivebox/config.py | 6 +++--- archivebox/extractors/__init__.py | 2 +- bin/build_docker.sh | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/archivebox/config.py b/archivebox/config.py index 4e434c12..a047ff20 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -53,6 +53,7 @@ from .config_stubs import ( ### Pre-Fetch Minimal System Config +TIMEZONE = 'UTC' SYSTEM_USER = getpass.getuser() or os.getlogin() try: @@ -81,7 +82,6 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = { 'IN_QEMU': {'type': bool, 'default': False}, 'PUID': {'type': int, 'default': os.getuid()}, 'PGID': {'type': int, 'default': os.getgid()}, - # TODO: 'SHOW_HINTS': {'type: bool, 'default': True}, }, 'GENERAL_CONFIG': { @@ -393,7 +393,7 @@ def get_version(config): def get_commit_hash(config): try: - git_dir = config['PACKAGE_DIR'] / '../') + git_dir = config['PACKAGE_DIR'] / '../' ref = (git_dir / 'HEAD').read_text().strip().split(' ')[-1] commit_hash = git_dir.joinpath(ref).read_text().strip() return commit_hash @@ -1195,7 +1195,7 @@ def check_dependencies(config: ConfigDict=CONFIG, show_help: bool=True) -> None: if config['USE_YOUTUBEDL'] and config['MEDIA_TIMEOUT'] < 20: stderr(f'[!] Warning: MEDIA_TIMEOUT is set too low! (currently set to MEDIA_TIMEOUT={config["MEDIA_TIMEOUT"]} seconds)', color='red') - stderr(' Youtube-dl will fail to archive all media if set to less than ~20 seconds.') + stderr(' youtube-dl/yt-dlp will fail to archive any media if set to less than ~20 seconds.') stderr(' (Setting it somewhere over 60 seconds is recommended)') stderr() stderr(' If you want to disable media archiving entirely, set SAVE_MEDIA=False instead:') diff --git a/archivebox/extractors/__init__.py b/archivebox/extractors/__init__.py index edcf218b..2515b8fd 100644 --- a/archivebox/extractors/__init__.py +++ b/archivebox/extractors/__init__.py @@ -184,7 +184,7 @@ def archive_link(link: Link, overwrite: bool=False, methods: Optional[Iterable[s link.url, command, ts - ) + "\n")) + ) + "\n" + str(e) + "\n")) #f.write(f"\n> {command}; ts={ts} version={config['VERSION']} docker={config['IN_DOCKER']} is_tty={config['IS_TTY']}\n") # print(' ', stats) diff --git a/bin/build_docker.sh b/bin/build_docker.sh index c88ed54c..e427c0a6 100755 --- a/bin/build_docker.sh +++ b/bin/build_docker.sh @@ -74,6 +74,7 @@ echo "[+] Generating requirements.txt and pdm.lock from pyproject.toml..." pdm lock --group=':all' --strategy="cross_platform" --production pdm export --group=':all' --production --without-hashes -o requirements.txt + echo "[+] Building archivebox:$VERSION docker image..." # docker builder prune # docker build . --no-cache -t archivebox-dev \