From ae208435c9c979720fad8f7782d6c74247b6c069 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 13 Jul 2020 12:21:37 -0400 Subject: [PATCH] fix the add links form --- archivebox/cli/logging.py | 2 +- archivebox/core/admin.py | 2 +- archivebox/core/forms.py | 7 +++++-- archivebox/core/views.py | 4 ++-- archivebox/extractors/git.py | 1 - archivebox/themes/default/add_links.html | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/archivebox/cli/logging.py b/archivebox/cli/logging.py index d11ffd9e..f002e922 100644 --- a/archivebox/cli/logging.py +++ b/archivebox/cli/logging.py @@ -191,7 +191,7 @@ def log_deduping_finished(num_new_links: int): def log_crawl_started(new_links): - print('{lightblue}[*] Starting crawl of {} sites 1 hop out from starting point{reset}'.format(len(new_links), **ANSI)) + print('{lightred}[*] Starting crawl of {} sites 1 hop out from starting point{reset}'.format(len(new_links), **ANSI)) ### Indexing Stage diff --git a/archivebox/core/admin.py b/archivebox/core/admin.py index 7942c6c2..1b05c580 100644 --- a/archivebox/core/admin.py +++ b/archivebox/core/admin.py @@ -49,7 +49,7 @@ class SnapshotAdmin(admin.ModelAdmin): '📼 ' '📦 ' '🏛 ' - '' + '
' '{}', obj.archive_path, canon['wget_path'] or '', obj.archive_path, canon['pdf_path'], diff --git a/archivebox/core/forms.py b/archivebox/core/forms.py index 5f67e2c6..8bf0cbd0 100644 --- a/archivebox/core/forms.py +++ b/archivebox/core/forms.py @@ -1,7 +1,10 @@ from django import forms -CHOICES = (('url', 'URL'), ('feed', 'Feed')) +CHOICES = ( + ('0', 'depth=0 (archive just this url)'), + ('1', 'depth=1 (archive this url and all sites one link away)'), +) class AddLinkForm(forms.Form): url = forms.URLField() - source = forms.ChoiceField(choices=CHOICES, widget=forms.RadioSelect, initial='url') + depth = forms.ChoiceField(choices=CHOICES, widget=forms.RadioSelect, initial='0') diff --git a/archivebox/core/views.py b/archivebox/core/views.py index d9c51700..5fb43119 100644 --- a/archivebox/core/views.py +++ b/archivebox/core/views.py @@ -66,9 +66,9 @@ class AddLinks(View): if form.is_valid(): url = form.cleaned_data["url"] print(f'[+] Adding URL: {url}') - depth = 0 if form.cleaned_data["source"] == "url" else 1 + depth = 0 if form.cleaned_data["depth"] == "0" else 0 input_kwargs = { - "url": url, + "urls": url, "depth": depth, "update_all": False, "out_dir": OUTPUT_DIR, diff --git a/archivebox/extractors/git.py b/archivebox/extractors/git.py index dcb1df3c..c8a5eeaf 100644 --- a/archivebox/extractors/git.py +++ b/archivebox/extractors/git.py @@ -56,7 +56,6 @@ def save_git(link: Link, out_dir: Optional[str]=None, timeout: int=TIMEOUT) -> A cmd = [ GIT_BINARY, 'clone', - # '--mirror', '--recursive', *([] if CHECK_SSL_VALIDITY else ['-c', 'http.sslVerify=false']), without_query(without_fragment(link.url)), diff --git a/archivebox/themes/default/add_links.html b/archivebox/themes/default/add_links.html index 7143c576..6e35f38c 100644 --- a/archivebox/themes/default/add_links.html +++ b/archivebox/themes/default/add_links.html @@ -212,7 +212,7 @@ - Go back to Snapshot list + Go back to Main Index