Dedent this code by reversing condition and continue.
This commit is contained in:
parent
9d8c9fdf51
commit
91bf90862b
1 changed files with 13 additions and 11 deletions
24
search.py
24
search.py
|
@ -166,18 +166,20 @@ def search(
|
||||||
if line_numbers:
|
if line_numbers:
|
||||||
result_text = '%4d | %s' % (index+1, result_text)
|
result_text = '%4d | %s' % (index+1, result_text)
|
||||||
|
|
||||||
if all_terms_match(search_text, terms, term_matches):
|
if not all_terms_match(search_text, terms, term_matches):
|
||||||
if not content_args:
|
continue
|
||||||
yield result_text
|
|
||||||
else:
|
|
||||||
filepath = pathclass.Path(search_object)
|
|
||||||
if not filepath.is_file:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if filepath.extension.lower() == 'lnk' and winshell:
|
if not content_args:
|
||||||
yield from search_contents_windows_lnk(filepath, content_args)
|
yield result_text
|
||||||
else:
|
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):
|
def argparse_to_dict(args):
|
||||||
text = args.text
|
text = args.text
|
||||||
|
|
Loading…
Reference in a new issue