mirror of https://github.com/MISP/misp-modules
Exclude dot files from modules list to be loaded
parent
e0d8462227
commit
0284aee1a2
|
@ -25,6 +25,7 @@ import tornado.web
|
||||||
import importlib
|
import importlib
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
runPath = os.path.dirname(os.path.realpath(__file__))
|
runPath = os.path.dirname(os.path.realpath(__file__))
|
||||||
sys.path.append(os.path.join(runPath, '..'))
|
sys.path.append(os.path.join(runPath, '..'))
|
||||||
|
@ -46,6 +47,8 @@ modules = []
|
||||||
for module in os.listdir(modulesdir):
|
for module in os.listdir(modulesdir):
|
||||||
if ".py" not in module or ".pyc" in module:
|
if ".py" not in module or ".pyc" in module:
|
||||||
continue
|
continue
|
||||||
|
if re.match("^\.", module):
|
||||||
|
continue
|
||||||
modulename = module.split(".")[0]
|
modulename = module.split(".")[0]
|
||||||
moduletype = os.path.split(modulesdir)[1]
|
moduletype = os.path.split(modulesdir)[1]
|
||||||
modules.append(modulename)
|
modules.append(modulename)
|
||||||
|
|
Loading…
Reference in New Issue