update build .exe
This commit is contained in:
17
main.py
17
main.py
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
import os
|
||||
import socket
|
||||
import ipaddress
|
||||
import platform
|
||||
@@ -116,6 +117,15 @@ def get_default_network(ip):
|
||||
return "192.168.1.0/24"
|
||||
|
||||
|
||||
def resource_path(relative_path):
|
||||
""" Get absolute path to resource, works for dev and for PyInstaller """
|
||||
try:
|
||||
base_path = sys._MEIPASS
|
||||
except Exception:
|
||||
base_path = os.path.abspath(".")
|
||||
return os.path.join(base_path, relative_path)
|
||||
|
||||
|
||||
def get_machine_info():
|
||||
"""Collect machine info."""
|
||||
hostname = socket.gethostname()
|
||||
@@ -501,7 +511,8 @@ class App(QWidget):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setWindowTitle("IoT Firmware Loader")
|
||||
self.setWindowTitle("MiraV3 Firmware Loader")
|
||||
self.setWindowIcon(QIcon(resource_path("icon.ico")))
|
||||
self.firmware = None
|
||||
self.all_devices = [] # all scan results (unfiltered)
|
||||
self.devices = [] # currently displayed (filtered)
|
||||
@@ -516,12 +527,12 @@ class App(QWidget):
|
||||
layout.setContentsMargins(8, 6, 8, 6)
|
||||
|
||||
# ── Title ──
|
||||
title = QLabel("⚡ IoT Firmware Loader (MiraV3)")
|
||||
title = QLabel("⚡ MiraV3 Firmware Loader")
|
||||
title.setObjectName("title")
|
||||
title.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
layout.addWidget(title)
|
||||
|
||||
copyright_label = QLabel(f"© {datetime.datetime.now().year} Smatec — R&D Software")
|
||||
copyright_label = QLabel(f"© {datetime.datetime.now().year} Smatec — R&D Software Team. v1.0.0")
|
||||
copyright_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
copyright_label.setStyleSheet(
|
||||
"color: #9399b2; font-size: 11px; font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto;"
|
||||
|
||||
Reference in New Issue
Block a user