def help(self,args=None): table = prettytable.PrettyTable([bcolors.BOLD + 'Command' + bcolors.ENDC,bcolors.BOLD + 'Description' + bcolors.ENDC]) table.border = False table.align = 'l' table.add_row(['-'*7,'-'*11]) for i in self.HELPCOMMANDS: table.add_row([bcolors.OKBLUE + i[0] + bcolors.ENDC,i[1]]) print table
def help(self, args=None): table = prettytable.PrettyTable(['Command', 'Description']) table.border = False table.align = 'l' table.add_row(['-' * 7, '-' * 11]) for i in self.HELPCOMMANDS: table.add_row([i[0], i[1]]) print(table)
def show(self,args=None): table = prettytable.PrettyTable([bcolors.BOLD + 'Name' + bcolors.ENDC,bcolors.BOLD + 'Current Setting' + bcolors.ENDC,bcolors.BOLD + 'Required' + bcolors.ENDC,bcolors.BOLD + 'Description' + bcolors.ENDC]) table.border = False table.align = 'l' table.add_row(['-'*4,'-'*15,'-'*8,'-'*11]) for i in options: table.add_row([bcolors.OKBLUE + i + bcolors.ENDC,options[i][0],options[i][1],options[i][2]]) print table
def list(self,args=None): table = prettytable.PrettyTable([bcolors.BOLD + 'ID' + bcolors.ENDC, bcolors.BOLD + 'IP' + bcolors.ENDC, bcolors.BOLD + 'Username' + bcolors.ENDC]) table.border = False table.align = 'l' table.add_row(['-'*2,'-'*2,'-'*8]) for i in Global.AGENTS: j = re.search('^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})*', i).group() table.add_row([bcolors.OKBLUE + i + bcolors.ENDC,j,i[len(j)+1:]]) print table
def show(self,args=None): table = prettytable.PrettyTable(['Nombre' , 'Configuracion asignada' , 'Requerida' , 'Descripcion' ]) table.border = False table.align = 'l' table.add_row(['-'*4,'-'*15,'-'*8,'-'*11]) for i in options: table.add_row([ i ,options[i][0],options[i][1],options[i][2]]) print table
def list(self,args=None): table = prettytable.PrettyTable(['ID', 'IP', 'Username']) table.border = False table.align = 'l' table.add_row(['-'*2,'-'*2,'-'*8]) for i in Global.AGENTS: j = re.search('^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})*', i).group() table.add_row([ i ,j,i[len(j)+1:]]) print table
def show(self, args=None): table = prettytable.PrettyTable( ['Name', 'Current Setting', 'Required', 'Description']) table.border = False table.align = 'l' table.add_row(['-' * 4, '-' * 15, '-' * 8, '-' * 11]) for i in options: table.add_row([i, options[i][0], options[i][1], options[i][2]]) print(table)
def show(self,args,pointer = None): if(len(args) < 2): return None if(args[1] == 'modules'): table = prettytable.PrettyTable([bcolors.BOLD + 'Modules' + bcolors.ENDC,bcolors.BOLD + 'Description' + bcolors.ENDC]) table.border = False table.align = 'l' table.add_row(['-'*7,'-'*11]) for i in sorted(modules): table.add_row([bcolors.OKBLUE + i + bcolors.ENDC,modules[i].info['Description']]) print(table) if(args[1] == 'options'): if(pointer): table = prettytable.PrettyTable([bcolors.BOLD + 'Name' + bcolors.ENDC,bcolors.BOLD + 'Current Setting' + bcolors.ENDC,bcolors.BOLD + 'Required' + bcolors.ENDC,bcolors.BOLD + 'Description' + bcolors.ENDC]) table.border = False table.align = 'l' table.add_row(['-'*4,'-'*15,'-'*8,'-'*11]) for i in sorted(modules[pointer].options): table.add_row([bcolors.OKBLUE + i + bcolors.ENDC,modules[pointer].options[i][0],modules[pointer].options[i][1],modules[pointer].options[i][2]]) print(table)