Skip to content

Commit

Permalink
Include data directory
Browse files Browse the repository at this point in the history
  • Loading branch information
naghim committed Mar 7, 2024
1 parent 2a66720 commit 9cd978f
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Visual Studio
uses: ilammy/msvc-dev-cmd@v1
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: "x64"
Expand All @@ -23,8 +23,8 @@ jobs:
- name: Build executable
shell: powershell
run: >
python -OO -m nuitka --standalone --onefile --python-flag=-OO --assume-yes-for-downloads --static-libpython=auto --windows-disable-console --windows-icon-from-ico=resources/subassistant.ico --windows-product-name=SubAssistant --windows-company-name=naghim --windows-file-version=1.0.0.0 --windows-file-description=SubAssistant --enable-plugin=pyside6 -o SubAssistant.exe subassistant/__main__.py
- uses: actions/upload-artifact@v3
python -OO -m nuitka --standalone --onefile --python-flag=-OO --assume-yes-for-downloads --static-libpython=auto --include-data-dir=subassistant/resources=resources --windows-disable-console --windows-icon-from-ico=subassistant/resources/subassistant.ico --windows-product-name=SubAssistant --windows-company-name=naghim --windows-file-version=1.0.0.0 --windows-file-description=SubAssistant --enable-plugin=pyside6 -o SubAssistant.exe subassistant/__main__.py
- uses: actions/upload-artifact@v4
with:
name: SubAssistant
path: SubAssistant.exe
3 changes: 2 additions & 1 deletion subassistant/__main__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import sys
from PySide6.QtWidgets import QApplication
from subassistant.globals import RESOURCES_DIR
from subassistant.gui.window import SubAssistantWindow

if __name__ == "__main__":
app = QApplication(sys.argv)

with open("./resources/styles.css", "r") as f:
with open(f'{RESOURCES_DIR}/styles.css', "r") as f:
app.setStyleSheet(f.read())

window = SubAssistantWindow()
Expand Down
4 changes: 4 additions & 0 deletions subassistant/globals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import os

BASE_DIR = os.path.dirname(__file__)
RESOURCES_DIR = f'{BASE_DIR}/resources'
9 changes: 5 additions & 4 deletions subassistant/gui/window.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import sys
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QTabWidget, QWidget, QVBoxLayout
from subassistant.globals import RESOURCES_DIR
from subassistant.gui.tab import CommentTab, RemoveCommentTab, AboutTab

class SubAssistantWindow(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("SubAssistant")
self.setWindowIcon(QIcon("./resources/curly_braces_icon.png"))
self.setWindowIcon(QIcon(f'{RESOURCES_DIR}/curly_braces_icon.png'))
self.setFixedSize(550, 350)
self.initUI()

Expand All @@ -17,9 +18,9 @@ def initUI(self):
self.tab_widget = QTabWidget()
self.tab_widget.setTabPosition(QTabWidget.West)

self.tab_widget.addTab(CommentTab(), QIcon("./resources/curly_braces.png"), "")
self.tab_widget.addTab(RemoveCommentTab(), QIcon("./resources/no_curly_braces.png"), "")
self.tab_widget.addTab(AboutTab(), QIcon("./resources/about.png"), "")
self.tab_widget.addTab(CommentTab(), QIcon(f'{RESOURCES_DIR}/curly_braces.png'), "")
self.tab_widget.addTab(RemoveCommentTab(), QIcon(f'{RESOURCES_DIR}/no_curly_braces.png'), "")
self.tab_widget.addTab(AboutTab(), QIcon(f'{RESOURCES_DIR}//about.png'), "")


self.tab_widget.setStyleSheet("QTabBar::tab { height: 60px; width: 100px;}")
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.

0 comments on commit 9cd978f

Please sign in to comment.