Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from intervisionlord/dev
Browse files Browse the repository at this point in the history
[1.3.0] Оптимизация ассетов
  • Loading branch information
intervisionlord authored Oct 5, 2022
2 parents b94b894 + 339dea3 commit a31c0be
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
Binary file added Builder/SSE.exe
Binary file not shown.
Binary file added Builder/SSE.zip
Binary file not shown.
8 changes: 3 additions & 5 deletions Builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ def getconfig() -> dict:
print('File not found')
return conf

def zipOutput(getconfig):
def zipOutput():
"""Упаковывает готовый файл в архив.
"""
with zipfile.ZipFile('SSE.zip', 'w',
compression=zipfile.ZIP_DEFLATED,
compresslevel=9) as zipArch:
zipArch.write('SSE.exe')
for item in getconfig['files']:
zipArch.write(f'../{item}', item)

def makeParamStr(getconfig) -> str:
"""Создает строку параметров сборки из данных конфига.
Expand All @@ -48,5 +46,5 @@ def makeParamStr(getconfig) -> str:
paramsStr = makeParamStr(getconfig())
plugins = getconfig()['plugins']
icon = getconfig()['main']['icon']
runCommand(f'nuitka {paramsStr} --plugin-enable={plugins} --windows-icon-from-ico={icon} ../SSE.py')
zipOutput(getconfig())
runCommand(f'nuitka {paramsStr} --plugin-enable={plugins} --windows-icon-from-ico={icon} --include-data-files=../config.yaml=./ --include-data-files=../imgs/*.ico=imgs/ ../SSE.py')
zipOutput()
2 changes: 1 addition & 1 deletion Builder/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
main:
version: '0.1.2.6'
version: '0.1.3.0'
author: 'intervision'
authorlink: 'https://github.com/intervisionlord'
icon: '../imgs/SSE_Icon.ico'
Expand Down
6 changes: 3 additions & 3 deletions SSE.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class MainForm(QMainWindow, gui.Ui_mainWindow):
def __init__(self) -> None:
super().__init__()
self.setupUi(self)
self.setWindowIcon(QIcon('imgs/SSE_icon.ico'))
self.saveButton.setIcon(QIcon('imgs/save_icon_16.ico'))
self.setWindowIcon(QIcon(path.join(path.dirname(__file__), 'imgs/SSE_icon.ico')))
self.saveButton.setIcon(QIcon(path.join(path.dirname(__file__), 'imgs/save_icon_16.ico')))
self.savesLabel.setText(self.getPaths()[0])
self.savesCombo.currentIndexChanged.connect(self.saveChangeSig)
self.saveButton.clicked.connect(self.rewriteSave)
Expand Down Expand Up @@ -128,7 +128,7 @@ def buildInfo() -> list:
Returns:
list: Список данных о версии и авторе
"""
with open('config.yaml', 'r') as config:
with open(path.join(path.dirname(__file__), 'config.yaml'), 'r') as config:
progAbout = loadyaml(config)
return progAbout['main']['version'], progAbout['main']['author'], progAbout['main']['authorlink']

Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
main:
version: '0.1.2.6'
version: '0.1.3.0'
author: 'intervision'
authorlink: 'https://github.com/intervisionlord'

0 comments on commit a31c0be

Please sign in to comment.