Skip to content

Commit 45a1bde

Browse files
committed
build updates
1 parent dbab6f2 commit 45a1bde

4 files changed

Lines changed: 34 additions & 61 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ jobs:
3131
run: |
3232
uv run pyinstaller --onefile --windowed `
3333
--name "619LogTool-Win" `
34+
--icon "1024hat.png" `
3435
--add-data "3840Wide.png;." `
36+
--add-data "1024hat.png;." `
3537
--add-data "Norwester.otf;." `
3638
--add-data "OpenSans-Regular.ttf;." `
3739
main.py
@@ -41,13 +43,23 @@ jobs:
4143
run: |
4244
uv run pyinstaller --onefile --windowed \
4345
--name "619LogTool-Mac" \
46+
--icon "1024hat.png" \
4447
--add-data "3840Wide.png:." \
48+
--add-data "1024hat.png:." \
4549
--add-data "Norwester.otf:." \
4650
--add-data "OpenSans-Regular.ttf:." \
4751
main.py
4852
49-
- name: Upload Artifacts
53+
- name: Upload Artifacts (Windows)
54+
if: matrix.os == 'windows-latest'
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: 619LogTool-Windows
58+
path: dist/*.exe
59+
60+
- name: Upload Artifacts (macOS)
61+
if: matrix.os == 'macos-latest'
5062
uses: actions/upload-artifact@v4
5163
with:
52-
name: 619LogTool-${{ matrix.os }}
53-
path: dist/*
64+
name: 619LogTool-macOS
65+
path: dist/*.app

.github/workflows/main.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

log.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22
import sys
33
import paramiko
44
from stat import S_ISREG
5+
6+
def resource_path(relative_path):
7+
""" Get absolute path to resource, works for dev and for PyInstaller """
8+
try:
9+
# PyInstaller creates a temp folder and stores path in _MEIPASS
10+
base_path = sys._MEIPASS
11+
except Exception:
12+
base_path = os.path.abspath(".")
13+
14+
return os.path.join(base_path, relative_path)
15+
516
from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout,
617
QPushButton, QTextEdit, QLabel, QCheckBox, QFileDialog,
718
QFrame, QDialog, QLineEdit, QFormLayout, QProgressBar)
819
from PyQt6.QtCore import QThread, pyqtSignal, Qt, QPropertyAnimation, QEasingCurve, QSettings, QSize, QTimer
9-
from PyQt6.QtGui import QFont, QPixmap, QFontDatabase, QColor
20+
from PyQt6.QtGui import QFont, QPixmap, QFontDatabase, QColor, QIcon
1021

1122
# --- Mac Cocoa Fix ---
1223
# This line prevents the "could not find cocoa" error by forcing the plugin path
@@ -284,11 +295,12 @@ def update_status_ui(self, connected, usage, raw):
284295

285296
def init_fonts(self):
286297
# Assumes fonts are in the same folder as the script
287-
QFontDatabase.addApplicationFont("OpenSans-Regular.ttf")
288-
QFontDatabase.addApplicationFont("Norwester.otf")
298+
QFontDatabase.addApplicationFont(resource_path("OpenSans-Regular.ttf"))
299+
QFontDatabase.addApplicationFont(resource_path("Norwester.otf"))
289300

290301
def setup_ui(self):
291302
self.setWindowTitle("619 Log Tool")
303+
self.setWindowIcon(QIcon(resource_path("1024hat.png")))
292304
self.setMinimumSize(900, 500)
293305

294306
central = QWidget()
@@ -309,8 +321,9 @@ def setup_ui(self):
309321
logo_container.setSpacing(5)
310322

311323
self.logo = QLabel()
312-
if os.path.exists("3840Wide.png"):
313-
self.logo.setPixmap(QPixmap("3840Wide.png").scaled(150, 80, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation))
324+
logo_img_path = resource_path("3840Wide.png")
325+
if os.path.exists(logo_img_path):
326+
self.logo.setPixmap(QPixmap(logo_img_path).scaled(150, 80, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation))
314327
else:
315328
self.logo.setText("🛡️")
316329
self.logo.setStyleSheet("font-size: 40px;")

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ dependencies = [
88
"PyQt6>=6.6.1",
99
"paramiko>=3.4.0",
1010
"pyinstaller>=6.4.0",
11+
"Pillow>=10.2.0",
1112
]

0 commit comments

Comments
 (0)