From 22fb9c2ad7226b17a3dea1d515c0f4b069f16e0b Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Sat, 31 Oct 2020 19:32:43 -0400 Subject: [PATCH] tweak icons --- archivebox.egg-info/PKG-INFO | 9 +++++++++ archivebox/config.py | 3 +-- archivebox/core/admin.py | 4 ++-- archivebox/core/utils.py | 14 +++++++------- archivebox/index/html.py | 2 +- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/archivebox.egg-info/PKG-INFO b/archivebox.egg-info/PKG-INFO index 2b7b8301..adc65f60 100644 --- a/archivebox.egg-info/PKG-INFO +++ b/archivebox.egg-info/PKG-INFO @@ -429,6 +429,15 @@ Description:
# Optional: install the extractor dependencies ./bin/setup.sh + + # Optional: develop via docker by mounting the code dir into the container + # if you edit e.g. ./archivebox/core/models.py on the docker host, runserver + # inside the container will reload and pick up your changes + docker build . -t archivebox + docker run -it -p 8000:8000 \ + -v $PWD/data:/data \ + -v $PWD/archivebox:/app/archivebox \ + archivebox server 0.0.0.0:8000 --debug --reload ``` ### Common development tasks diff --git a/archivebox/config.py b/archivebox/config.py index d9716113..d29cecd4 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -7,7 +7,6 @@ import sys import json import getpass import shutil -import platform import django from hashlib import md5 @@ -322,7 +321,7 @@ DERIVED_CONFIG_DEFAULTS: ConfigDefaultDict = { 'SAVE_PDF': {'default': lambda c: c['USE_CHROME'] and c['SAVE_PDF']}, 'SAVE_SCREENSHOT': {'default': lambda c: c['USE_CHROME'] and c['SAVE_SCREENSHOT']}, 'SAVE_DOM': {'default': lambda c: c['USE_CHROME'] and c['SAVE_DOM']}, - 'SAVE_SINGLEFILE': {'default': lambda c: c['USE_CHROME'] and c['USE_SINGLEFILE'] and c['USE_NODE']}, + 'SAVE_SINGLEFILE': {'default': lambda c: c['USE_CHROME'] and c['SAVE_SINGLEFILE'] and c['USE_NODE']}, 'SAVE_READABILITY': {'default': lambda c: c['USE_READABILITY'] and c['USE_NODE']}, 'SAVE_MERCURY': {'default': lambda c: c['USE_MERCURY'] and c['USE_NODE']}, diff --git a/archivebox/core/admin.py b/archivebox/core/admin.py index 14328519..20def353 100644 --- a/archivebox/core/admin.py +++ b/archivebox/core/admin.py @@ -137,7 +137,7 @@ class SnapshotAdmin(admin.ModelAdmin): if archive_size > 52428800: size_txt = mark_safe(f'{size_txt}') else: - size_txt = 'pending' + size_txt = mark_safe('...') return format_html( '{}', obj.archive_path, @@ -146,7 +146,7 @@ class SnapshotAdmin(admin.ModelAdmin): def url_str(self, obj): return format_html( - '{}', + '{}', obj.url, obj.url.split('://www.', 1)[-1].split('://', 1)[-1][:64], ) diff --git a/archivebox/core/utils.py b/archivebox/core/utils.py index 1496ab74..0bb8fceb 100644 --- a/archivebox/core/utils.py +++ b/archivebox/core/utils.py @@ -17,18 +17,18 @@ def get_icons(snapshot: Snapshot) -> str: return format_html( '' - '🌐 ' - '🗜 ' - '📄 ' - '🖥 ' + '' + '🆆 ' '🅷 ' - '🆆 ' + '📄 ' + '💻 ' + '📦 ' '📼 ' - '📦 ' + '🅶 ' '🏛 ' '', - *link_tuple(link, 'wget_path'), *link_tuple(link, 'singlefile_path'), + *link_tuple(link, 'wget_path')[:2], any((out_dir / link.domain).glob('*')), *link_tuple(link, 'pdf_path'), *link_tuple(link, 'screenshot_path'), *link_tuple(link, 'dom_path'), diff --git a/archivebox/index/html.py b/archivebox/index/html.py index 48e517bb..793a60af 100644 --- a/archivebox/index/html.py +++ b/archivebox/index/html.py @@ -140,7 +140,7 @@ def link_details_template(link: Link) -> str: ) or 'about:blank', 'extension': link.extension or 'html', 'tags': link.tags or 'untagged', - 'size': printable_filesize(link.archive_size) if link.archive_size else mark_safe('pending'), + 'size': printable_filesize(link.archive_size) if link.archive_size else 'pending', 'status': 'archived' if link.is_archived else 'not yet archived', 'status_color': 'success' if link.is_archived else 'danger', 'oldest_archive_date': ts_to_date(link.oldest_archive_date),