mirror of
git://git.acid.vegas/IRCP.git
synced 2024-11-26 01:46:39 +00:00
Added option to search strings in all logs
This commit is contained in:
parent
af94eca852
commit
7eb8f1cce2
@ -19,9 +19,12 @@ def parse(option, data, raw=True):
|
|||||||
if len(sys.argv) >= 2:
|
if len(sys.argv) >= 2:
|
||||||
option = sys.argv[1]
|
option = sys.argv[1]
|
||||||
raw = True
|
raw = True
|
||||||
|
search = False
|
||||||
if len(sys.argv) == 3:
|
if len(sys.argv) == 3:
|
||||||
if sys.argv[2] == 'clean':
|
if sys.argv[2] == 'clean':
|
||||||
raw = False
|
raw = False
|
||||||
|
elif sys.argv[2] == 'search':
|
||||||
|
search = True
|
||||||
logs = os.listdir('logs')
|
logs = os.listdir('logs')
|
||||||
found = list()
|
found = list()
|
||||||
for log in logs:
|
for log in logs:
|
||||||
@ -38,7 +41,7 @@ if len(sys.argv) >= 2:
|
|||||||
elif type(data) == list:
|
elif type(data) == list:
|
||||||
for item in data:
|
for item in data:
|
||||||
found.append(parse(option, item, raw))
|
found.append(parse(option, item, raw))
|
||||||
else:
|
elif search:
|
||||||
for item in data:
|
for item in data:
|
||||||
_data = data[item]
|
_data = data[item]
|
||||||
if type(_data) == str and option in _data:
|
if type(_data) == str and option in _data:
|
||||||
|
Loading…
Reference in New Issue
Block a user