From d3b76fd9bb3540553b07862ecc58c4bd417e5d8b Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Sat, 10 Jan 2015 19:20:31 +0100 Subject: [PATCH] Workshop - second step Processed files are now added in the Redis set --- bin/import.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/import.py b/bin/import.py index 3741274..51eccea 100644 --- a/bin/import.py +++ b/bin/import.py @@ -1,12 +1,16 @@ import argparse import sys +import redis argParser = argparse.ArgumentParser(description='Malware classifier') argParser.add_argument('-f', action='append', help='Filename') args = argParser.parse_args() +r = redis.StrictRedis(host='localhost', port=6379, db=0) + if args.f is not None: - filename = args.f + md5 = args.f[0].split(".")[0] + r.sadd('processed', md5) for line in sys.stdin: print (line.split(",")[0]) else: