#!/usr/bin/env python
import pyclamd
import boto3
import pprint
import sys

cd = pyclamd.ClamdNetworkSocket(host='127.0.0.1', port=8310, timeout=None)
pprint.pprint(cd.stats())

#sys.exit()

fobj= open("./tests/eicar_com.zip", "rb")
result = cd.scan_stream(fobj)
pprint.pprint(result)

fobj= open("./tests/1Mfile01.rnd", "rb")
result = cd.scan_stream(fobj)
pprint.pprint(result)

#sys.exit()
#https://github.com/fvinas/multi_sqs_listener

bucketname = 'srf-formio-upload-test'
itemname = '1603805859188-480/anarchy-f62eebb5-2a8e-4bab-ae7d-6a766c088f63.png'

s3_res = boto3.resource('s3')
obj = s3_res.Object(bucketname, itemname)

result = cd.scan_stream(obj.get()['Body'].read())
pprint.pprint(result)

sys.exit()