mirror of
https://github.com/NinjaCheetah/NUSGet.git
synced 2025-04-25 15:11:02 -04:00
Renamed files to make more sense, updated CI to match, also uses TARs to preserve executability
This commit is contained in:
parent
75d34bbf0a
commit
ef2efbe902
16
.github/workflows/python-build.yml
vendored
16
.github/workflows/python-build.yml
vendored
@ -31,14 +31,15 @@ jobs:
|
||||
pip install -r requirements.txt
|
||||
- name: Build Package
|
||||
run: |
|
||||
nuitka3 --onefile --plugin-enable=pyside6 main.py
|
||||
nuitka3 --assume-yes-for-downloads --onefile --plugin-enable=pyside6 main.py
|
||||
- name: Prepare Package for Upload
|
||||
run: |
|
||||
mv main.bin ~/NUSD-Py
|
||||
mv NUSD-Py.bin ~/NUSD-Py
|
||||
tar cvf NUSD-Py.tar NUSD-Py.bin
|
||||
- name: Upload Package
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
with:
|
||||
path: ~/NUSD-Py
|
||||
path: ~/NUSD-Py.tar
|
||||
name: NUSD-Py-linux-bin
|
||||
|
||||
build-macos:
|
||||
@ -60,11 +61,12 @@ jobs:
|
||||
nuitka3 --assume-yes-for-downloads --onefile --plugin-enable=pyside6 main.py --macos-create-app-bundle --disable-console
|
||||
- name: Prepare Package for Upload
|
||||
run: |
|
||||
mv main.app ~/NUSD-Py.app
|
||||
mv NUSD-Py.app ~/NUSD-Py.app
|
||||
tar cvf NUSD-Py.tar NUSD-Py.app
|
||||
- name: Upload Package
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
with:
|
||||
path: ~/NUSD-Py.app
|
||||
path: ~/NUSD-Py.tar
|
||||
name: NUSD-Py-macos-bin
|
||||
|
||||
build-windows:
|
||||
@ -85,10 +87,10 @@ jobs:
|
||||
pip install -r requirements.txt
|
||||
- name: Build Package
|
||||
run: |
|
||||
nuitka --assume-yes-for-downloads --standalone --plugin-enable=pyside6 main.py --disable-console
|
||||
nuitka --assume-yes-for-downloads --onefile --plugin-enable=pyside6 main.py --disable-console
|
||||
- name: Upload Package
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
with:
|
||||
path: D:\a\NUSD-Py\NUSD-Py\main.dist\
|
||||
path: D:\a\NUSD-Py\NUSD-Py\NUSD-Py.exe
|
||||
name: NUSD-Py-windows-bin
|
||||
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -24,6 +24,9 @@ share/python-wheels/
|
||||
*.egg-info/
|
||||
main.build/
|
||||
main.dist/
|
||||
NUSD-Py.build/
|
||||
NUSD-Py.dist/
|
||||
NUSD-Py.onefile-build/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
@ -1,10 +1,11 @@
|
||||
import sys
|
||||
import os
|
||||
import json
|
||||
import pathlib
|
||||
|
||||
import libWiiPy
|
||||
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox, QTreeWidgetItem, QTreeWidget
|
||||
from PySide6.QtCore import QRunnable, Slot, QThreadPool, Signal, QObject, Qt
|
||||
|
||||
from qt.py.ui_MainMenu import Ui_MainWindow
|
||||
@ -28,7 +29,7 @@ class Worker(QRunnable):
|
||||
def run(self):
|
||||
try:
|
||||
self.fn(**self.kwargs)
|
||||
except ValueError:
|
||||
except ValueError as e:
|
||||
self.signals.result.emit(1)
|
||||
else:
|
||||
self.signals.result.emit(0)
|
||||
@ -44,6 +45,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.ui.download_btn.clicked.connect(self.download_btn_pressed)
|
||||
self.ui.pack_wad_chkbox.clicked.connect(self.pack_wad_chkbox_toggled)
|
||||
|
||||
tree = self.ui.title_tree
|
||||
|
||||
for title in sys_titles:
|
||||
new_title = QTreeWidgetItem(tree)
|
||||
new_title.setText(0, title["Name"])
|
||||
|
||||
def update_log_text(self, new_text):
|
||||
self.log_text += new_text + "\n"
|
||||
self.ui.log_text_browser.setText(self.log_text)
|
||||
@ -65,12 +72,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
def check_download_result(self, result):
|
||||
if result == 1:
|
||||
msgBox = QMessageBox()
|
||||
msgBox.setWindowTitle("Invalid Title ID/Version")
|
||||
msgBox.setWindowTitle("Invalid Title ID")
|
||||
msgBox.setIcon(QMessageBox.Icon.Critical)
|
||||
msgBox.setTextFormat(Qt.MarkdownText)
|
||||
msgBox.setText("### No title with the requested Title ID or version could be found!")
|
||||
msgBox.setInformativeText("Please make sure the Title ID is entered correctly, and if a specific version is"
|
||||
" set, that it exists for the chosen title.")
|
||||
msgBox.setText("No title with the provided Title ID could be found!")
|
||||
msgBox.setInformativeText("Please make sure that you have entered a valid Title ID or selected one from the"
|
||||
" title database.")
|
||||
msgBox.setStandardButtons(QMessageBox.StandardButton.Ok)
|
||||
msgBox.setDefaultButton(QMessageBox.StandardButton.Ok)
|
||||
msgBox.exec()
|
||||
@ -78,6 +84,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
def run_nus_download(self, progress_callback):
|
||||
tid = self.ui.tid_entry.text()
|
||||
if tid == "":
|
||||
raise ValueError
|
||||
try:
|
||||
version = int(self.ui.version_entry.text())
|
||||
except ValueError:
|
||||
@ -173,6 +181,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
if __name__ == "__main__":
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
wii_database = json.load(open("wii-database.json", "r"))
|
||||
sys_titles = []
|
||||
for key in wii_database["SYS"]:
|
||||
sys_titles.append(key)
|
||||
print(sys_titles[0]["Name"])
|
||||
|
||||
out_folder = pathlib.Path("titles")
|
||||
if not out_folder.is_dir():
|
||||
out_folder.mkdir()
|
@ -15,22 +15,34 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QHBoxLayout, QLabel,
|
||||
QLineEdit, QMainWindow, QMenuBar, QPushButton,
|
||||
QSizePolicy, QStatusBar, QTextBrowser, QVBoxLayout,
|
||||
QWidget)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QHBoxLayout, QHeaderView,
|
||||
QLabel, QLineEdit, QMainWindow, QMenuBar,
|
||||
QPushButton, QSizePolicy, QStatusBar, QTextBrowser,
|
||||
QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
if not MainWindow.objectName():
|
||||
MainWindow.setObjectName(u"MainWindow")
|
||||
MainWindow.resize(305, 605)
|
||||
MainWindow.setMinimumSize(QSize(305, 605))
|
||||
MainWindow.setMaximumSize(QSize(305, 605))
|
||||
MainWindow.resize(610, 605)
|
||||
MainWindow.setMinimumSize(QSize(610, 605))
|
||||
MainWindow.setMaximumSize(QSize(800, 605))
|
||||
self.centralwidget = QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName(u"centralwidget")
|
||||
self.verticalLayout_2 = QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.horizontalLayout_3 = QHBoxLayout(self.centralwidget)
|
||||
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
||||
self.title_tree = QTreeWidget(self.centralwidget)
|
||||
__qtreewidgetitem = QTreeWidgetItem()
|
||||
__qtreewidgetitem.setText(0, u"1");
|
||||
self.title_tree.setHeaderItem(__qtreewidgetitem)
|
||||
self.title_tree.setObjectName(u"title_tree")
|
||||
self.title_tree.setColumnCount(1)
|
||||
self.title_tree.header().setVisible(False)
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.title_tree)
|
||||
|
||||
self.verticalLayout_3 = QVBoxLayout()
|
||||
self.verticalLayout_3.setObjectName(u"verticalLayout_3")
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.show_titles_btn = QPushButton(self.centralwidget)
|
||||
@ -44,7 +56,7 @@ class Ui_MainWindow(object):
|
||||
self.horizontalLayout.addWidget(self.show_more_btn)
|
||||
|
||||
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout)
|
||||
|
||||
self.horizontalLayout_2 = QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
@ -65,17 +77,17 @@ class Ui_MainWindow(object):
|
||||
self.horizontalLayout_2.addWidget(self.version_entry)
|
||||
|
||||
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout_2)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
|
||||
|
||||
self.download_btn = QPushButton(self.centralwidget)
|
||||
self.download_btn.setObjectName(u"download_btn")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.download_btn)
|
||||
self.verticalLayout_3.addWidget(self.download_btn)
|
||||
|
||||
self.log_text_browser = QTextBrowser(self.centralwidget)
|
||||
self.log_text_browser.setObjectName(u"log_text_browser")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.log_text_browser)
|
||||
self.verticalLayout_3.addWidget(self.log_text_browser)
|
||||
|
||||
self.horizontalLayout_4 = QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
|
||||
@ -91,29 +103,32 @@ class Ui_MainWindow(object):
|
||||
self.horizontalLayout_4.addWidget(self.wad_file_entry)
|
||||
|
||||
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout_4)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout_4)
|
||||
|
||||
self.keep_enc_chkbox = QCheckBox(self.centralwidget)
|
||||
self.keep_enc_chkbox.setObjectName(u"keep_enc_chkbox")
|
||||
self.keep_enc_chkbox.setChecked(True)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.keep_enc_chkbox)
|
||||
self.verticalLayout_3.addWidget(self.keep_enc_chkbox)
|
||||
|
||||
self.create_dec_chkbox = QCheckBox(self.centralwidget)
|
||||
self.create_dec_chkbox.setObjectName(u"create_dec_chkbox")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.create_dec_chkbox)
|
||||
self.verticalLayout_3.addWidget(self.create_dec_chkbox)
|
||||
|
||||
self.use_local_chkbox = QCheckBox(self.centralwidget)
|
||||
self.use_local_chkbox.setObjectName(u"use_local_chkbox")
|
||||
self.use_local_chkbox.setEnabled(False)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.use_local_chkbox)
|
||||
self.verticalLayout_3.addWidget(self.use_local_chkbox)
|
||||
|
||||
|
||||
self.horizontalLayout_3.addLayout(self.verticalLayout_3)
|
||||
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QMenuBar(MainWindow)
|
||||
self.menubar.setObjectName(u"menubar")
|
||||
self.menubar.setGeometry(QRect(0, 0, 305, 30))
|
||||
self.menubar.setGeometry(QRect(0, 0, 610, 30))
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName(u"statusbar")
|
||||
|
@ -6,19 +6,19 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>305</width>
|
||||
<width>610</width>
|
||||
<height>605</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>305</width>
|
||||
<width>610</width>
|
||||
<height>605</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>305</width>
|
||||
<width>800</width>
|
||||
<height>605</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -26,121 +26,140 @@
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="show_titles_btn">
|
||||
<property name="text">
|
||||
<string>Titles</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="show_more_btn">
|
||||
<property name="text">
|
||||
<string>More</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QTreeWidget" name="title_tree">
|
||||
<property name="columnCount">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="tid_entry">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="show_titles_btn">
|
||||
<property name="text">
|
||||
<string>Titles</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="show_more_btn">
|
||||
<property name="text">
|
||||
<string>More</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="tid_entry">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Title ID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>v</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="version_entry">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Version</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="download_btn">
|
||||
<property name="text">
|
||||
<string>Start NUS Download!</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="log_text_browser">
|
||||
<property name="markdown">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Title ID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="pack_wad_chkbox">
|
||||
<property name="text">
|
||||
<string>Pack WAD</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="wad_file_entry">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>File Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="keep_enc_chkbox">
|
||||
<property name="text">
|
||||
<string>v</string>
|
||||
<string>Keep Enc. Contents</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="version_entry">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Version</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="download_btn">
|
||||
<property name="text">
|
||||
<string>Start NUS Download!</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="log_text_browser">
|
||||
<property name="markdown">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="pack_wad_chkbox">
|
||||
<widget class="QCheckBox" name="create_dec_chkbox">
|
||||
<property name="text">
|
||||
<string>Pack WAD</string>
|
||||
<string>Create Decrypted Contents (*.app)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="wad_file_entry">
|
||||
<widget class="QCheckBox" name="use_local_chkbox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>File Name</string>
|
||||
<property name="text">
|
||||
<string>Use Local Files If They Exist</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="keep_enc_chkbox">
|
||||
<property name="text">
|
||||
<string>Keep Enc. Contents</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="create_dec_chkbox">
|
||||
<property name="text">
|
||||
<string>Create Decrypted Contents (*.app)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="use_local_chkbox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use Local Files If They Exist</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
@ -148,7 +167,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>305</width>
|
||||
<width>610</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user