mirror of
https://github.com/aquasecurity/kube-hunter.git
synced 2026-05-20 16:16:04 +00:00
* removed unnecessary imports from main file * added a script that generates static __init__ files based on existing modules * added documentation * added installing of plugins imports to script
18 lines
578 B
Python
18 lines
578 B
Python
from os.path import basename
|
|
import glob
|
|
|
|
def get_py_files(path):
|
|
for py_file in glob.glob("{}*.py".format(path)):
|
|
if not py_file.endswith("__init__.py"):
|
|
yield basename(py_file)[:-3]
|
|
|
|
def install_static_imports(path):
|
|
with open("{}__init__.py".format(path), 'w') as init_f:
|
|
for pf in get_py_files(path):
|
|
init_f.write("from .{} import *\n".format(pf))
|
|
|
|
install_static_imports("src/modules/discovery/")
|
|
install_static_imports("src/modules/hunting/")
|
|
install_static_imports("src/modules/report/")
|
|
install_static_imports("plugins/")
|