refactor: Remove skip_index from archive related functions

This commit is contained in:
Cristian 2020-12-08 18:42:01 -05:00 committed by Cristian Vargas
parent 9745a5ac56
commit 275ad22db7
3 changed files with 16 additions and 16 deletions

View file

@ -19,7 +19,7 @@ meta_cmds = ('help', 'version')
main_cmds = ('init', 'info', 'config')
archive_cmds = ('add', 'remove', 'update', 'list', 'status')
fake_db = ("oneshot",) + meta_cmds
fake_db = ("oneshot",)
display_first = (*meta_cmds, *main_cmds, *archive_cmds)
@ -60,8 +60,10 @@ def run_subcommand(subcommand: str,
stdin: Optional[IO]=None,
pwd: Union[Path, str, None]=None) -> None:
"""Run a given ArchiveBox subcommand with the given list of args"""
from ..config import setup_django
setup_django(in_memory_db=subcommand in fake_db)
if subcommand not in meta_cmds:
from ..config import setup_django
setup_django(in_memory_db=subcommand in fake_db)
module = import_module('.archivebox_{}'.format(subcommand), __package__)
module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore