-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathBADministration.py
44 lines (36 loc) · 1.26 KB
/
BADministration.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/python
import cmd
from Modules.Solarwinds.solarwinds import *
from Modules.McAfee.mcafee import *
from Modules.Acronis.acronis import *
from Modules.Common.common import *
#https://stackoverflow.com/questions/5822164/object-inheritance-and-nested-cmd
#https://stackoverflow.com/questions/34145686/handling-argparse-escaped-character-as-option
class MainMenu(BADminConsole):
def __init__(self, context):
BADminConsole.__init__(self, context)
self.solarwinds = Solarwinds_Main(context)
self.mcafee = McAfee_Main(context)
self.acronis = Acronis_Main(context)
context.print_title()
self.prompt = '[BADministration]#'
self.modules = ['mcafee', 'solarwinds', 'acronis']
def do_solarwinds(self, args):
"""Solarwinds parent BADministration module"""
self.solarwinds.cmdloop()
def do_mcafee(self, args):
"""McAfee parent BADministration module"""
self.mcafee.cmdloop()
def do_acronis(self, args):
"""Acronis parent BADministration module"""
self.acronis.cmdloop()
def do_show_modules(self, args):
"""Prints available parent modules"""
print self.modules
def do_exit(self, args):
"""Exit"""
return True
if __name__ == '__main__':
context = BADminContext()
con = MainMenu(context)
con.cmdloop()