def show_profile(self):
indent = ' '
header = indent + 'List of profiles saved by system:\n'
table = [['Profile name', 'Connection type', 'SSID', 'Passphrase']]
list_profile = os.listdir(self.profile_path)
for fileconf in list_profile:
of_file = open(self.profile_path + fileconf, 'r')
of = of_file.read().split('\n')
if of[0][1::] == 'Open':
table.append([fileconf[:-5:], 'Open', of[2][7:-1:], '-'])
elif of[0][1::] == 'WPA':
table.append([fileconf[:-5:], 'WPA', of[2][7:-1:], of[3][7:-1:]])
of_file.close()
print (Fore.YELLOW + Style.DIM + header + AsciiTable(table).table)
评论列表
文章目录