change do_info command to tabulate style

This commit is contained in:
mh4x0f 2020-02-09 22:19:20 -03:00
parent 444c3caaf9
commit 0c2a4699ef
2 changed files with 16 additions and 9 deletions

View File

@ -23,9 +23,10 @@ class ConsoleUI(Cmd):
def set_prompt(self):
self.prompt = '{} > '.format(setcolor('wp3',color='blue',underline=True))
def do_modules(self,args):
""" show modules available"""
pass
# def do_modules(self,args):
# """ show modules available"""
# pass
def do_search(self,args):
""" search modules by name"""
pass
@ -34,9 +35,9 @@ class ConsoleUI(Cmd):
""" load module on session"""
pass
def do_back(self,args):
""" unload module on session"""
pass
# def do_back(self,args):
# """ unload module on session"""
# pass
## Override methods in Cmd object ##
def preloop(self):

View File

@ -231,9 +231,15 @@ class PumpkinShell(Qt.QObject, ConsoleUI):
def do_info(self, args):
''' show all variable for settings AP'''
print(display_messages('Settings Access Point:',info=True,sublime=True))
for item in self.commands.keys():
print('{} = {} '.format(item, self.conf.get('accesspoint',self.commands[item])))
headers_table, output_table = ["BSSID", "SSID", "Channel", "Iface"], []
print(display_messages('Settings AccessPoint:',info=True,sublime=True))
output_table.append([
self.conf.get('accesspoint',self.commands["bssid"]),
self.conf.get('accesspoint',self.commands["ssid"]),
self.conf.get('accesspoint',self.commands["channel"]),
self.conf.get('accesspoint',self.commands["interface"]),
])
print(tabulate(output_table, headers_table,tablefmt="simple"))
print('\n')