mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-09 12:21:57 -04:00
feat: Refactor remove command to use querysets
This commit is contained in:
parent
be520d137a
commit
a8ed72501d
5 changed files with 68 additions and 75 deletions
|
@ -408,19 +408,18 @@ def log_removal_started(links: List["Link"], yes: bool, delete: bool):
|
|||
except (KeyboardInterrupt, EOFError, AssertionError):
|
||||
raise SystemExit(0)
|
||||
|
||||
def log_removal_finished(all_links: int, to_keep: int):
|
||||
def log_removal_finished(all_links: int, to_remove: int):
|
||||
if all_links == 0:
|
||||
print()
|
||||
print('{red}[X] No matching links found.{reset}'.format(**ANSI))
|
||||
else:
|
||||
num_removed = all_links - to_keep
|
||||
print()
|
||||
print('{red}[√] Removed {} out of {} links from the archive index.{reset}'.format(
|
||||
num_removed,
|
||||
to_remove,
|
||||
all_links,
|
||||
**ANSI,
|
||||
))
|
||||
print(' Index now contains {} links.'.format(to_keep))
|
||||
print(' Index now contains {} links.'.format(all_links - to_remove))
|
||||
|
||||
|
||||
def log_shell_welcome_msg():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue