Fix WOFileUtils
This commit is contained in:
@@ -173,6 +173,7 @@ Apps & Tools shipped with WordOps :
|
||||
- [ClamAV](https://github.com/Cisco-Talos/clamav-devel)
|
||||
- [cheat.sh](https://github.com/chubin/cheat.sh)
|
||||
- [ProFTPd](https://github.com/proftpd/proftpd)
|
||||
- [nginx-ultimate-bad-bot-blocker](https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/)
|
||||
|
||||
Cache Plugins supported by WordOps :
|
||||
|
||||
|
||||
@@ -280,15 +280,15 @@ class WOFileUtils():
|
||||
"""
|
||||
Searches for string in file and returns True or False.
|
||||
"""
|
||||
if os.path.isfile(fnm):
|
||||
if os.path.isfile('{0}'.format(fnm)):
|
||||
try:
|
||||
Log.debug(self, "Finding string {0} to file {1}"
|
||||
.format(sstr, fnm))
|
||||
for line in open(fnm, encoding='utf-8'):
|
||||
if sstr in line:
|
||||
return True
|
||||
return False
|
||||
except OSError as e:
|
||||
for line in open(fnm, encoding='utf-8'):
|
||||
if sstr in line:
|
||||
return True
|
||||
return False
|
||||
except OSError as e:
|
||||
Log.debug(self, "{0}".format(e.strerror))
|
||||
Log.error(self, "Unable to Search string {0} in {1}"
|
||||
.format(sstr, fnm))
|
||||
|
||||
Reference in New Issue
Block a user