Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

virusscan.py: add ISO8601 signature date

  • Loading branch information...
commit 14c11d040bd3dfc8432d2a8d93fc7a78a27d45b9 1 parent 2cbf33f
@anarchivist authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 python/virusscan.py
View
6 python/virusscan.py
@@ -7,6 +7,7 @@
import sys
from optparse import OptionParser
from pyclamd import pyclamd
+import dateutil.parser
def virusscan(fn, method='socket', socket='/tmp/clamd.socket'):
out = {}
@@ -14,7 +15,10 @@ def virusscan(fn, method='socket', socket='/tmp/clamd.socket'):
raise NotImplementedError
else:
clam = pyclamd.ClamdUnixSocket(filename=socket)
- out['virusScannerVersion'], out['virusScannerSignatureVersion'], out['virusScannerSignatureDate'] = clam.version().split('/')
+ vers = clam.version().split('/')
+ out['virusScannerVersion'] = vers[0]
+ out['virusScannerSignatureVersion'] = vers[1]
+ out['virusScannerSignatureDate'] = dateutil.parser.parse(vers[2]).strftime("%Y-%m-%dT%H:%M:%S")
vscan = clam.scan_file(fn)
if vscan is None:
out['virusFound'] = 'false'

0 comments on commit 14c11d0

Please sign in to comment.
Something went wrong with that request. Please try again.