From 04de187ad25d5cca5e8d7e3e9ee6d4778162aa58 Mon Sep 17 00:00:00 2001 From: plonibarploni <44826203+plonibarploni@users.noreply.github.com> Date: Sun, 15 Sep 2019 23:34:03 -0400 Subject: [PATCH] fix wifi output order fixes #420 --- Linux/lazagne/config/write_output.py | 4 +++- Linux/lazagne/softwares/wifi/wifi.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Linux/lazagne/config/write_output.py b/Linux/lazagne/config/write_output.py index 6e03877a..4aaa00da 100755 --- a/Linux/lazagne/config/write_output.py +++ b/Linux/lazagne/config/write_output.py @@ -11,6 +11,8 @@ from platform import uname from time import gmtime, strftime +from collections import OrderedDict + class Bcolors(): HEADER = '\033[95m' @@ -143,7 +145,7 @@ def print_output(self, software_name, pwd_found): to_write = [] # Remove duplicated password - pwd_found = [dict(t) for t in set([tuple(d.items()) for d in pwd_found])] + pwd_found = [OrderedDict(t) for t in set([tuple(d.items()) for d in pwd_found])] for pwd in pwd_found: password_category = False diff --git a/Linux/lazagne/softwares/wifi/wifi.py b/Linux/lazagne/softwares/wifi/wifi.py index 4cd62544..bb31ca28 100755 --- a/Linux/lazagne/softwares/wifi/wifi.py +++ b/Linux/lazagne/softwares/wifi/wifi.py @@ -11,6 +11,8 @@ except ImportError: from configparser import RawConfigParser # Python 3 +from collections import OrderedDict + class Wifi(ModuleInfo): def __init__(self): @@ -27,7 +29,7 @@ def run(self): for w in wireless_ssid: cp = RawConfigParser() cp.read(os.path.join(directory, w)) - values = {} + values = OrderedDict() try: values['SSID'] = cp.get('wifi', 'ssid') values['Password'] = cp.get('wifi-security', 'psk')