Skip to content

Commit

Permalink
new: Easily remove a capture from the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Apr 2, 2024
1 parent 3f6efff commit 3599563
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 165 deletions.
9 changes: 9 additions & 0 deletions lookyloo/lookyloo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import json
import logging
import operator
import shutil
import smtplib
import ssl
import time
Expand Down Expand Up @@ -467,6 +468,14 @@ def hide_capture(self, capture_uuid: str, /) -> None:
(capture_dir / 'no_index').touch()
self._captures_index.reload_cache(capture_uuid)

def remove_capture(self, capture_uuid: str, /) -> None:
"""Remove the capture, it won't be accessible anymore."""

removed_captures_dir = get_homedir() / 'removed_captures'
removed_captures_dir.mkdir(parents=True, exist_ok=True)
capture_dir = self._captures_index[capture_uuid].capture_dir
shutil.move(str(capture_dir), str(removed_captures_dir / capture_dir.name))

def update_tree_cache_info(self, process_id: int, classname: str) -> None:
self.redis.hset('tree_cache', f'{process_id}|{classname}', str(self._captures_index.lru_cache_status()))

Expand Down
Loading

0 comments on commit 3599563

Please sign in to comment.