Skip to content

Commit 5fe4b29

Browse files
committed
files arggroups does not have deleted arg because it is an immediate file-tree scan
1 parent b9bdcbd commit 5fe4b29

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

library/utils/arggroups.py

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,16 +2540,16 @@ def files(parent_parser, no_db=False):
25402540
def files_post(args):
25412541
if not getattr(args, "database", None):
25422542
import time
2543-
2543+
25442544
if args.sizes:
25452545
args.sizes = sql_utils.parse_human_to_lambda(nums.human_to_bytes, args.sizes)
25462546

25472547
now = time.time()
2548-
2548+
25492549
# Calculate threshold timestamps for time_created
25502550
created_within_thresholds = [now - nums.human_to_seconds(s) for s in args.created_within]
25512551
created_before_thresholds = [now - nums.human_to_seconds(s) for s in args.created_before]
2552-
2552+
25532553
def time_created_filter(timestamp):
25542554
if timestamp is None:
25552555
return False
@@ -2560,13 +2560,13 @@ def time_created_filter(timestamp):
25602560
if timestamp >= threshold:
25612561
return False
25622562
return True
2563-
2563+
25642564
args.time_created = time_created_filter
2565-
2565+
25662566
# Calculate threshold timestamps for time_modified
25672567
modified_within_thresholds = [now - nums.human_to_seconds(s) for s in args.modified_within]
25682568
modified_before_thresholds = [now - nums.human_to_seconds(s) for s in args.modified_before]
2569-
2569+
25702570
def time_modified_filter(timestamp):
25712571
if timestamp is None:
25722572
return False
@@ -2577,25 +2577,8 @@ def time_modified_filter(timestamp):
25772577
if timestamp >= threshold:
25782578
return False
25792579
return True
2580-
2580+
25812581
args.time_modified = time_modified_filter
2582-
2583-
# Calculate threshold timestamps for time_deleted
2584-
deleted_within_thresholds = [now - nums.human_to_seconds(s) for s in args.deleted_within]
2585-
deleted_before_thresholds = [now - nums.human_to_seconds(s) for s in args.deleted_before]
2586-
2587-
def time_deleted_filter(timestamp):
2588-
if timestamp is None:
2589-
return False
2590-
for threshold in deleted_within_thresholds:
2591-
if timestamp < threshold:
2592-
return False
2593-
for threshold in deleted_before_thresholds:
2594-
if timestamp >= threshold:
2595-
return False
2596-
return True
2597-
2598-
args.time_deleted = time_deleted_filter
25992582

26002583
if args.type:
26012584
args.type = set(args.type)

0 commit comments

Comments
 (0)