mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
ceee615da2
commit
395fbf8189
|
@ -22,16 +22,17 @@ def _text_in_file2(text: str, filename: str,
|
||||||
"""
|
"""
|
||||||
if not case_sensitive:
|
if not case_sensitive:
|
||||||
text = text.lower()
|
text = text.lower()
|
||||||
|
content = ''
|
||||||
try:
|
try:
|
||||||
with open(filename, 'r', encoding='utf-8') as fp_file:
|
with open(filename, 'r', encoding='utf-8') as fp_file:
|
||||||
content = fp_file.read()
|
content = fp_file.read()
|
||||||
|
except OSError:
|
||||||
|
print('EX: unable to find text in missing file 2 ' + filename)
|
||||||
if content:
|
if content:
|
||||||
if not case_sensitive:
|
if not case_sensitive:
|
||||||
content = content.lower()
|
content = content.lower()
|
||||||
if text in content:
|
if text in content:
|
||||||
return True
|
return True
|
||||||
except OSError:
|
|
||||||
print('EX: unable to find text in missing file 2 ' + filename)
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue