Skip to content

Commit

Permalink
Ver 1.2.0: nuitka for windows & beautify GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
AnyaCoder committed Nov 4, 2024
1 parent deb9809 commit 27081e4
Show file tree
Hide file tree
Showing 17 changed files with 229 additions and 47 deletions.
Binary file added assets/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
54 changes: 40 additions & 14 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,45 @@

sep = ";" if platform.system() == "Windows" else ":"

args = [
"pyinstaller",
"fish/__main__.py",
f"--{package_type}",
"-n",
"fish",
"--additional-hooks=extra-hooks",
"--noconfirm",
"--add-data",
f"fish/assets{sep}assets",
"--add-data",
f"fish/locales{sep}locales",
"--noconsole",
]
# Use nuitka for faster gui
if platform.system() == "Windows":
args = [
"python",
"-m",
"nuitka",
# "--mingw64",
"--standalone",
f"--output-dir=dist",
"--follow-import-to=fish",
"main.py",
f"--onefile", # default onefile is enough (not unzipping)
"--output-filename=fish",
"--include-data-dir=assets=assets",
"--include-data-dir=locales=locales",
"--windows-disable-console",
"--enable-plugins=pkg-resources",
"--enable-plugins=pyqt6",
"--nofollow-import-to=numpy,mkl,click",
"--include-qt-plugins=sensible,multimedia",
"--show-memory",
"--show-progress",
# "--debug",
]

else:
args = [
"pyinstaller",
"main.py",
f"--{package_type}",
"-n",
"fish",
"--additional-hooks=extra-hooks",
"--noconfirm",
"--add-data",
f"assets{sep}assets",
"--add-data",
f"locales{sep}locales",
"--noconsole",
]

sp.check_call(args)
2 changes: 1 addition & 1 deletion fish/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# path into variable _MEIPASS'.
application_path = Path(sys._MEIPASS)
else:
application_path = Path(__file__).parent
application_path = Path(__file__).parent.parent


@dataclass
Expand Down
46 changes: 28 additions & 18 deletions fish/fap.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from fish.modules.console import ConsoleWidget
from fish.modules.globals import FAP, LINE_ALLOC, STOP_BUTTON_QSS
from fish.modules.registry import widget_registry
from fish.modules.task import TaskManagerMixin
from fish.utils.i18n import _t

Expand All @@ -33,6 +34,7 @@ def __init__(self, console_widget: ConsoleWidget, python: QLineEdit):

def setup_fap_to_wav_settings(self, layout: QVBoxLayout):
row = QGroupBox(_t("FAPToWavWidget.title"))
widget_registry.register(row, "fap_to_wav")
row_layout = QGridLayout()
row_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)

Expand Down Expand Up @@ -85,8 +87,8 @@ def call_to_wav(self):
if not input_dir or not Path(input_dir).is_dir():
QMessageBox.warning(
self,
_t("modules.task.input_dir.error_title"),
_t("modules.task.input_dir.error_msg"),
_t("task.input_dir.error_title"),
_t("task.input_dir.error_msg"),
)
return
if not output_dir or not Path(output_dir).is_dir():
Expand Down Expand Up @@ -132,6 +134,7 @@ def __init__(self, console_widget: ConsoleWidget, python: QLineEdit):

def setup_fap_resample_settings(self, layout: QVBoxLayout):
row = QGroupBox(_t("FAPResampleWidget.title"))
widget_registry.register(row, "fap_resample")
row_layout = QGridLayout()
row_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)

Expand Down Expand Up @@ -192,8 +195,8 @@ def call_resample(self):
if not input_dir or not Path(input_dir).is_dir():
QMessageBox.warning(
self,
_t("modules.task.input_dir.error_title"),
_t("modules.task.input_dir.error_msg"),
_t("task.input_dir.error_title"),
_t("task.input_dir.error_msg"),
)
return
if not output_dir or not Path(output_dir).is_dir():
Expand Down Expand Up @@ -243,6 +246,7 @@ def __init__(self, console_widget: ConsoleWidget, python: QLineEdit):

def setup_fap_loud_norm_settings(self, layout: QVBoxLayout):
row = QGroupBox(_t("FAPLoudNormWidget.title"))
widget_registry.register(row, "fap_loud_norm")
row_layout = QGridLayout()
row_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)

Expand Down Expand Up @@ -338,8 +342,8 @@ def call_loud_norm(self):
if not input_dir or not Path(input_dir).is_dir():
QMessageBox.warning(
self,
_t("modules.task.input_dir.error_title"),
_t("modules.task.input_dir.error_msg"),
_t("task.input_dir.error_title"),
_t("task.input_dir.error_msg"),
)
return
if not output_dir or not Path(output_dir).is_dir():
Expand Down Expand Up @@ -394,6 +398,7 @@ def __init__(self, console_widget: ConsoleWidget, python: QLineEdit):

def setup_fap_separate_settings(self, layout: QVBoxLayout):
row = QGroupBox(_t("FAPSeparateWidget.title"))
widget_registry.register(row, "fap_separate")
row_layout = QGridLayout()
row_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)

Expand Down Expand Up @@ -478,8 +483,8 @@ def call_separate(self):
if not input_dir or not Path(input_dir).is_dir():
QMessageBox.warning(
self,
_t("modules.task.input_dir.error_title"),
_t("modules.task.input_dir.error_msg"),
_t("task.input_dir.error_title"),
_t("task.input_dir.error_msg"),
)
return
if not output_dir or not Path(output_dir).is_dir():
Expand Down Expand Up @@ -533,6 +538,7 @@ def __init__(self, console_widget: ConsoleWidget, python: QLineEdit):

def setup_fap_slice_settings(self, layout: QVBoxLayout):
row = QGroupBox(_t("FAPSliceAudioWidget.title"))
widget_registry.register(row, "fap_slice")
row_layout = QGridLayout()
row_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)

Expand Down Expand Up @@ -640,8 +646,8 @@ def call_slice_audio(self):
if not input_dir or not Path(input_dir).is_dir():
QMessageBox.warning(
self,
_t("modules.task.input_dir.error_title"),
_t("modules.task.input_dir.error_msg"),
_t("task.input_dir.error_title"),
_t("task.input_dir.error_msg"),
)
return
if not output_dir or not Path(output_dir).is_dir():
Expand Down Expand Up @@ -710,6 +716,7 @@ def __init__(self, console_widget: ConsoleWidget, python: QLineEdit):

def setup_fap_transcribe_settings(self, layout: QVBoxLayout):
row = QGroupBox(_t("FAPTranscribeWidget.title"))
widget_registry.register(row, "fap_transcribe")
row_layout = QGridLayout()
row_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)

Expand Down Expand Up @@ -800,8 +807,8 @@ def call_transcribe(self):
if not input_dir or not Path(input_dir).is_dir():
QMessageBox.warning(
self,
_t("modules.task.input_dir.error_title"),
_t("modules.task.input_dir.error_msg"),
_t("task.input_dir.error_title"),
_t("task.input_dir.error_msg"),
)
return

Expand Down Expand Up @@ -857,6 +864,7 @@ def __init__(self, console_widget: ConsoleWidget, python: QLineEdit):

def setup_fap_length_settings(self, layout: QVBoxLayout):
row = QGroupBox(_t("FAPLengthStatWidget.title"))
widget_registry.register(row, "fap_length")
row_layout = QGridLayout()
row_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)

Expand Down Expand Up @@ -925,8 +933,8 @@ def call_fap_length(self):
if not input_dir or not Path(input_dir).is_dir():
QMessageBox.warning(
self,
_t("modules.task.input_dir.error_title"),
_t("modules.task.input_dir.error_msg"),
_t("task.input_dir.error_title"),
_t("task.input_dir.error_msg"),
)
return

Expand Down Expand Up @@ -976,6 +984,7 @@ def __init__(self, console_widget: ConsoleWidget, python: QLineEdit):

def setup_fap_frequency_settings(self, layout: QVBoxLayout):
row = QGroupBox(_t("FAPFrequencyStatWidget.title"))
widget_registry.register(row, "fap_frequency")
row_layout = QGridLayout()
row_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)

Expand Down Expand Up @@ -1021,8 +1030,8 @@ def call_fap_frequency(self):
if not input_dir or not Path(input_dir).is_dir():
QMessageBox.warning(
self,
_t("modules.task.input_dir.error_title"),
_t("modules.task.input_dir.error_msg"),
_t("task.input_dir.error_title"),
_t("task.input_dir.error_msg"),
)
return

Expand Down Expand Up @@ -1064,6 +1073,7 @@ def __init__(self, console_widget: ConsoleWidget, python: QLineEdit):

def setup_fap_merge_settings(self, layout: QVBoxLayout):
row = QGroupBox(_t("FAPMergeLabWidget.title"))
widget_registry.register(row, "fap_merge_lab")
row_layout = QGridLayout()
row_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)

Expand Down Expand Up @@ -1118,8 +1128,8 @@ def call_merge_lab(self):
if not input_dir or not Path(input_dir).is_dir():
QMessageBox.warning(
self,
_t("modules.task.input_dir.error_title"),
_t("modules.task.input_dir.error_msg"),
_t("task.input_dir.error_title"),
_t("task.input_dir.error_msg"),
)
return

Expand Down
Loading

0 comments on commit 27081e4

Please sign in to comment.