Workshop - second step

Processed files are now added in the Redis set
This commit is contained in:
Alexandre Dulaunoy 2015-01-10 19:20:31 +01:00
parent 1cb5fe46d3
commit d3b76fd9bb

View file

@ -1,12 +1,16 @@
import argparse import argparse
import sys import sys
import redis
argParser = argparse.ArgumentParser(description='Malware classifier') argParser = argparse.ArgumentParser(description='Malware classifier')
argParser.add_argument('-f', action='append', help='Filename') argParser.add_argument('-f', action='append', help='Filename')
args = argParser.parse_args() args = argParser.parse_args()
r = redis.StrictRedis(host='localhost', port=6379, db=0)
if args.f is not None: if args.f is not None:
filename = args.f md5 = args.f[0].split(".")[0]
r.sadd('processed', md5)
for line in sys.stdin: for line in sys.stdin:
print (line.split(",")[0]) print (line.split(",")[0])
else: else: