From 2dc7e75414f26778b0bb713a0a1f1071f832dc25 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 25 Jan 2020 00:58:06 -0800 Subject: [PATCH] Dedent even more. Thanks continue! --- search.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/search.py b/search.py index a4c70cf..eea4560 100644 --- a/search.py +++ b/search.py @@ -162,6 +162,7 @@ def search( else: search_text = search_object result_text = search_object + if line_numbers: result_text = f'{index+1:>4} | {result_text}' @@ -170,15 +171,16 @@ def search( if not content_args: yield result_text - else: - filepath = pathclass.Path(search_object) - if not filepath.is_file: - continue + continue - if filepath.extension.lower() == 'lnk' and winshell: - yield from search_contents_windows_lnk(filepath, content_args) - else: - yield from search_contents_generic(filepath, content_args) + filepath = pathclass.Path(search_object) + if not filepath.is_file: + continue + + if filepath.extension.lower() == 'lnk' and winshell: + yield from search_contents_windows_lnk(filepath, content_args) + else: + yield from search_contents_generic(filepath, content_args) def argparse_to_dict(args): text = args.text