Skip to content

Commit

Permalink
Merge pull request AlessandroZ#424 from plonibarploni/wifi-order
Browse files Browse the repository at this point in the history
fix wifi output order
  • Loading branch information
AlessandroZ authored Sep 16, 2019
2 parents 8283508 + 04de187 commit a9ab9f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Linux/lazagne/config/write_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from platform import uname
from time import gmtime, strftime

from collections import OrderedDict


class Bcolors():
HEADER = '\033[95m'
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion Linux/lazagne/softwares/wifi/wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
except ImportError:
from configparser import RawConfigParser # Python 3

from collections import OrderedDict


class Wifi(ModuleInfo):
def __init__(self):
Expand All @@ -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')
Expand Down

0 comments on commit a9ab9f0

Please sign in to comment.