Skip to content

Commit

Permalink
#21 manage module path
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed May 3, 2017
1 parent fa812a8 commit 5ad33a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion contrib/misp-modules-loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ def run(argv):

elif opt in ('-i','--info'):
module = arg
print(module)
if path:
sys.path.append(mod(path)[0])
m = __import__(mod(path)[1])

data = json.load(sys.stdin)
print(json.dumps(m.handler(json.dumps(data))))
sys.exit(0)

m = __import__(module)
print(({'name': module, 'mispattributes': m.mispattributes,
'moduleinfo':m.moduleinfo}))
Expand Down

0 comments on commit 5ad33a8

Please sign in to comment.