Skip to content

Commit

Permalink
Fix missing scapy modules and svg issues (#34)
Browse files Browse the repository at this point in the history
* wip

* Changing back to .png because svg not supported by pyqtdeploy
  • Loading branch information
rllola authored Mar 11, 2021
1 parent 9a15cfa commit d82a857
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion airbnb-scanner.pdy

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airbnb-scanner.spec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exe = EXE(pyz,
strip=False,
upx=True,
icon=icon,
console=True )
console=False)

coll = COLLECT(exe,
a.binaries,
Expand Down
Binary file added icons/reload-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/reload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/spy-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/warning-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PyQt5==5.15.2
PyQt5-sip==12.8.1
scapy==2.4.3
PyQt5==5.14.2
PyQt5-sip==12.8.0
scapy==2.4.2
sip==5.5.0
PyQt-builder==1.7.0
2 changes: 1 addition & 1 deletion scripts/download_libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ echo "Downloading libs"
wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz
wget https://download.qt.io/archive/qt/5.14/5.14.2/single/qt-everywhere-src-5.14.2.tar.xz
wget https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tar.xz
wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.24/sip-4.19.24.tar.gz
wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.25/sip-4.19.25.tar.gz
wget https://files.pythonhosted.org/packages/4d/81/b9a66a28fb9a7bbeb60e266f06ebc4703e7e42b99e3609bf1b58ddd232b9/PyQt5-5.14.2.tar.gz
35 changes: 13 additions & 22 deletions src/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ def __init__(self, config, config_file, *args, **kwargs):
self.menu.setStyleSheet(dark_stylesheet)
self.device_menu.setStyleSheet(dark_stylesheet)

self.icon = QIcon(os.path.join(prefix_path, "icons", "spy-light.svg"))
self.rescan_icon = QIcon(os.path.join(prefix_path, "icons", "reload-light.svg"))
self.warning_icon = QIcon(os.path.join(prefix_path, "icons", "warning-light.svg"))
self.icon = QIcon(os.path.join(prefix_path, "icons", "spy-light.png"))
self.rescan_icon = QIcon(os.path.join(prefix_path, "icons", "reload-light.png"))
self.warning_icon = QIcon(os.path.join(prefix_path, "icons", "warning-light.png"))
else:
self.icon = QIcon(os.path.join(prefix_path, "icons", "spy.svg"))
self.rescan_icon = QIcon(os.path.join(prefix_path, "icons", "reload.svg"))
self.warning_icon = QIcon(os.path.join(prefix_path, "icons", "warning.svg"))
self.icon = QIcon(os.path.join(prefix_path, "icons", "spy.png"))
self.rescan_icon = QIcon(os.path.join(prefix_path, "icons", "reload.png"))
self.warning_icon = QIcon(os.path.join(prefix_path, "icons", "warning.png"))


# Create the tray
self.tray = QSystemTrayIcon(self.icon, None)
Expand All @@ -114,13 +115,13 @@ def handle_dark_mode_change(self):
prefix_path = ":"

if self.dark_mode:
self.icon = QIcon(os.path.join(prefix_path, "icons", "spy-light.svg"))
self.rescan_icon = QIcon(os.path.join(prefix_path, "icons", "reload-light.svg"))
self.warning_icon = QIcon(os.path.join(prefix_path, "icons", "warning-light.svg"))
self.icon = QIcon(os.path.join(prefix_path, "icons", "spy-light.png"))
self.rescan_icon = QIcon(os.path.join(prefix_path, "icons", "reload-light.png"))
self.warning_icon = QIcon(os.path.join(prefix_path, "icons", "warning-light.png"))
else:
self.icon = QIcon(os.path.join(prefix_path, "icons", "spy.svg"))
self.rescan_icon = QIcon(os.path.join(prefix_path, "icons", "reload.svg"))
self.warning_icon = QIcon(os.path.join(prefix_path, "icons", "warning.svg"))
self.icon = QIcon(os.path.join(prefix_path, "icons", "spy.png"))
self.rescan_icon = QIcon(os.path.join(prefix_path, "icons", "reload.png"))
self.warning_icon = QIcon(os.path.join(prefix_path, "icons", "warning.png"))

for action in self.device_menu.actions():
if action.iconText() == 'Rescan':
Expand Down Expand Up @@ -191,13 +192,3 @@ def triggered_info(client_ip, client_mac, company):
clients_list.append(client_dict)

self.menu.insertMenu(self.separator, self.device_menu)


def print_result(results_list):
"""
Print the IP/MAC table
"""
print("IP\t\t\tMAC Address")
print("----------------------------------------------------")
for client in results_list:
print(client["ip"] + "\t\t" + client["mac"])
5 changes: 2 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import configparser
from application import Application


def main():
"""
main function to launch the program
Expand All @@ -25,12 +26,10 @@ def main():
config.read(config_file)

print('Starting...')
print(sys.argv)
app = Application(config, config_file, sys.argv)

print('Executing...')
sys.exit(app.exec_())


if __name__ == '__main__':
main()
main()
2 changes: 1 addition & 1 deletion sysroot.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

"sip": {
"module_name": "PyQt5.sip",
"linux#source": "sip-4.19.24.tar.gz"
"linux#source": "sip-4.19.25.tar.gz"
},

"pyqt5": {
Expand Down

0 comments on commit d82a857

Please sign in to comment.