mirror of
https://github.com/shizand/statapp.git
synced 2025-10-02 11:34:58 +03:00
ci: добавлена сборка с помощью pyinstaller (#16)
This commit is contained in:
@@ -2,6 +2,7 @@ from PySide6.QtGui import QMovie
|
||||
from PySide6.QtWidgets import QMainWindow
|
||||
|
||||
from statapp.ui.ui_about_window import Ui_AboutWindow
|
||||
from statapp.utils import resource_path
|
||||
|
||||
|
||||
class AboutWindow(QMainWindow):
|
||||
@@ -12,7 +13,8 @@ class AboutWindow(QMainWindow):
|
||||
self.ui = Ui_AboutWindow()
|
||||
self.ui.setupUi(self)
|
||||
|
||||
image_path = 'statapp\\images\\sticker.gif'
|
||||
image_path = resource_path('images/sticker.gif')
|
||||
|
||||
movie = QMovie(image_path)
|
||||
self.ui.labelgif.setMovie(movie)
|
||||
movie.start()
|
||||
|
11
statapp/utils.py
Normal file
11
statapp/utils.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def resource_path(relative):
|
||||
if getattr(sys, 'frozen', False):
|
||||
bundle_dir = sys._MEIPASS
|
||||
else:
|
||||
# we are running in a normal Python environment
|
||||
bundle_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
return os.path.join(bundle_dir, relative)
|
Reference in New Issue
Block a user