From 0c2a4699ef9265b79fd575271b01b12fea5c2fd8 Mon Sep 17 00:00:00 2001 From: mh4x0f Date: Sun, 9 Feb 2020 22:19:20 -0300 Subject: [PATCH] change do_info command to tabulate style --- core/common/terminal.py | 13 +++++++------ core/main.py | 12 +++++++++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/core/common/terminal.py b/core/common/terminal.py index ce7e22d..6cc2c32 100644 --- a/core/common/terminal.py +++ b/core/common/terminal.py @@ -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): diff --git a/core/main.py b/core/main.py index 72ae1c0..0458400 100644 --- a/core/main.py +++ b/core/main.py @@ -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')