mirror of https://github.com/MISP/misp-modules
chg: [qrcode] various fixes to make it PEP compliant
parent
a0fce1bc90
commit
d5180e7e79
|
@ -20,6 +20,7 @@ cryptocurrencies = {'bitcoin'}
|
|||
schemas = {'http://', 'https://', 'ftp://'}
|
||||
moduleconfig = []
|
||||
|
||||
|
||||
def handler(q=False):
|
||||
if q is False:
|
||||
return False
|
||||
|
@ -27,7 +28,7 @@ def handler(q=False):
|
|||
filename = q['attachment']
|
||||
try:
|
||||
img_array = np.fromstring(binascii.a2b_base64(q['data']), np.uint8)
|
||||
except:
|
||||
except Exception as e:
|
||||
err = "Couldn't fetch attachment (JSON 'data' is empty). Are you using the 'Query enrichment' action?"
|
||||
misperrors['error'] = err
|
||||
print(err)
|
||||
|
@ -77,6 +78,7 @@ def handler(q=False):
|
|||
misperrors['error'] = "Couldn't decode QR code in attachment."
|
||||
return misperrors
|
||||
|
||||
|
||||
def introspection():
|
||||
return mispattributes
|
||||
|
||||
|
|
Loading…
Reference in New Issue