archivebox_shell.py 602 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python3
  2. __package__ = 'archivebox.cli'
  3. from typing import Iterable
  4. import rich_click as click
  5. from archivebox.misc.util import docstring
  6. def shell(args: Iterable[str]=()) -> None:
  7. """Enter an interactive ArchiveBox Django shell"""
  8. from django.core.management import call_command
  9. call_command("shell_plus", *args)
  10. @click.command(add_help_option=False, context_settings=dict(ignore_unknown_options=True))
  11. @click.argument('args', nargs=-1)
  12. @docstring(shell.__doc__)
  13. def main(args: Iterable[str]=()) -> None:
  14. shell(args=args)
  15. if __name__ == '__main__':
  16. main()