mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 23:24:30 -04:00
add hints
This commit is contained in:
parent
9d093a34f8
commit
fc0d064ddf
1 changed files with 8 additions and 3 deletions
|
@ -55,6 +55,7 @@ from .index.html import parse_html_main_index
|
||||||
from .extractors import archive_links, archive_link, ignore_methods
|
from .extractors import archive_links, archive_link, ignore_methods
|
||||||
from .config import (
|
from .config import (
|
||||||
stderr,
|
stderr,
|
||||||
|
hint,
|
||||||
ConfigDict,
|
ConfigDict,
|
||||||
ANSI,
|
ANSI,
|
||||||
IS_TTY,
|
IS_TTY,
|
||||||
|
@ -523,11 +524,15 @@ def add(urls: Union[str, List[str]],
|
||||||
update_all: bool=not ONLY_NEW,
|
update_all: bool=not ONLY_NEW,
|
||||||
index_only: bool=False,
|
index_only: bool=False,
|
||||||
overwrite: bool=False,
|
overwrite: bool=False,
|
||||||
|
init: bool=False,
|
||||||
out_dir: str=OUTPUT_DIR) -> List[Link]:
|
out_dir: str=OUTPUT_DIR) -> List[Link]:
|
||||||
"""Add a new URL or list of URLs to your archive"""
|
"""Add a new URL or list of URLs to your archive"""
|
||||||
|
|
||||||
assert depth in (0, 1), 'Depth must be 0 or 1 (depth >1 is not supported yet)'
|
assert depth in (0, 1), 'Depth must be 0 or 1 (depth >1 is not supported yet)'
|
||||||
|
|
||||||
|
if init:
|
||||||
|
run_subcommand('init', stdin=None, pwd=out_dir)
|
||||||
|
|
||||||
# Load list of links from the existing index
|
# Load list of links from the existing index
|
||||||
check_data_folder(out_dir=out_dir)
|
check_data_folder(out_dir=out_dir)
|
||||||
check_dependencies()
|
check_dependencies()
|
||||||
|
@ -605,8 +610,8 @@ def remove(filter_str: Optional[str]=None,
|
||||||
color='red',
|
color='red',
|
||||||
)
|
)
|
||||||
stderr()
|
stderr()
|
||||||
stderr(' {lightred}Hint:{reset} To remove all urls you can run:'.format(**ANSI))
|
hint(('To remove all urls you can run:',
|
||||||
stderr(" archivebox remove --filter-type=regex '.*'")
|
'archivebox remove --filter-type=regex ".*"'))
|
||||||
stderr()
|
stderr()
|
||||||
raise SystemExit(2)
|
raise SystemExit(2)
|
||||||
elif filter_str:
|
elif filter_str:
|
||||||
|
@ -1065,7 +1070,7 @@ def server(runserver_args: Optional[List[str]]=None,
|
||||||
|
|
||||||
print('{green}[+] Starting ArchiveBox webserver...{reset}'.format(**ANSI))
|
print('{green}[+] Starting ArchiveBox webserver...{reset}'.format(**ANSI))
|
||||||
if admin_user:
|
if admin_user:
|
||||||
print("{lightred}[i] The admin username is:{lightblue} {}{reset}".format(admin_user.username, **ANSI))
|
hint('The admin username is{lightblue} {}{reset}\n'.format(admin_user.username, **ANSI))
|
||||||
else:
|
else:
|
||||||
print('{lightyellow}[!] No admin users exist yet, you will not be able to edit links in the UI.{reset}'.format(**ANSI))
|
print('{lightyellow}[!] No admin users exist yet, you will not be able to edit links in the UI.{reset}'.format(**ANSI))
|
||||||
print()
|
print()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue