diff --git a/.run/pytest.run.xml b/.run/pytest.run.xml new file mode 100644 index 000000000..0876f1362 --- /dev/null +++ b/.run/pytest.run.xml @@ -0,0 +1,30 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="pytest" type="tests" factoryName="py.test" nameIsGenerated="true"> + <module name="buzz" /> + <option name="ENV_FILES" value="" /> + <option name="INTERPRETER_OPTIONS" value="" /> + <option name="PARENT_ENVS" value="true" /> + <option name="SDK_HOME" value="$PROJECT_DIR$/.venv/bin/python" /> + <option name="SDK_NAME" value="Poetry (buzz) (2)" /> + <option name="WORKING_DIRECTORY" value="" /> + <option name="IS_MODULE_SDK" value="false" /> + <option name="ADD_CONTENT_ROOTS" value="true" /> + <option name="ADD_SOURCE_ROOTS" value="true" /> + <EXTENSION ID="net.ashald.envfile"> + <option name="IS_ENABLED" value="false" /> + <option name="IS_SUBST" value="false" /> + <option name="IS_PATH_MACRO_SUPPORTED" value="false" /> + <option name="IS_IGNORE_MISSING_FILES" value="false" /> + <option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" /> + <ENTRIES> + <ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" /> + </ENTRIES> + </EXTENSION> + <option name="_new_keywords" value="""" /> + <option name="_new_parameters" value="""" /> + <option name="_new_additionalArguments" value=""-s"" /> + <option name="_new_target" value="""" /> + <option name="_new_targetType" value=""CUSTOM"" /> + <method v="2" /> + </configuration> +</component> diff --git a/Buzz.spec b/Buzz.spec index d87721ae6..396b7bbcf 100644 --- a/Buzz.spec +++ b/Buzz.spec @@ -5,32 +5,35 @@ import shutil from PyInstaller.utils.hooks import collect_data_files, copy_metadata -from buzz.__version__ import VERSION - datas = [] -datas += collect_data_files('torch') -datas += copy_metadata('tqdm') -datas += copy_metadata('torch') -datas += copy_metadata('regex') -datas += copy_metadata('requests') -datas += copy_metadata('packaging') -datas += copy_metadata('filelock') -datas += copy_metadata('numpy') -datas += copy_metadata('tokenizers') +datas += collect_data_files("torch") +datas += copy_metadata("tqdm") +datas += copy_metadata("torch") +datas += copy_metadata("regex") +datas += copy_metadata("requests") +datas += copy_metadata("packaging") +datas += copy_metadata("filelock") +datas += copy_metadata("numpy") +datas += copy_metadata("tokenizers") # Allow transformers package to load __init__.py file dynamically: # https://github.com/chidiwilliams/buzz/issues/272 -datas += collect_data_files('transformers', include_py_files=True) +datas += collect_data_files("transformers", include_py_files=True) -datas += collect_data_files('whisper') -datas += [(file[1], os.path.dirname(file[1])) for file in - Tree('./locale', prefix='locale', excludes=['*.po'])] -datas += [(shutil.which('ffmpeg'), '.')] +datas += collect_data_files("whisper") +datas += [ + ("buzz/whisper.dll" if platform.system() == "Windows" else "buzz/libwhisper.*", ".") +] +datas += [ + (file[1], os.path.dirname(file[1])) + for file in Tree("./locale", prefix="locale", excludes=["*.po"]) +] +datas += [(shutil.which("ffmpeg"), ".")] block_cipher = None a = Analysis( - ['main.py'], + ["main.py"], pathex=[], binaries=[], datas=datas, @@ -50,9 +53,9 @@ exe = EXE( pyz, a.scripts, [], - icon='./assets/buzz.ico', + icon="./assets/buzz.ico", exclude_binaries=True, - name='Buzz', + name="Buzz", debug=True, bootloader_ignore_signals=False, strip=False, @@ -72,17 +75,17 @@ coll = COLLECT( strip=False, upx=False, upx_exclude=[], - name='Buzz', + name="Buzz", ) app = BUNDLE( coll, - name='Buzz.app', - icon='./assets/buzz.icns', - bundle_identifier='com.chidiwilliams.buzz', - version='0.8.4', + name="Buzz.app", + icon="./assets/buzz.icns", + bundle_identifier="com.chidiwilliams.buzz", + version="0.8.4", info_plist={ - 'NSPrincipalClass': 'NSApplication', - 'NSHighResolutionCapable': 'True', - 'NSMicrophoneUsageDescription': 'Allow Buzz to record audio from your microphone.' - } + "NSPrincipalClass": "NSApplication", + "NSHighResolutionCapable": "True", + "NSMicrophoneUsageDescription": "Allow Buzz to record audio from your microphone.", + }, ) diff --git a/buzz/widgets/import_url_dialog.py b/buzz/widgets/import_url_dialog.py index 4f6e89ada..5b003cf6d 100644 --- a/buzz/widgets/import_url_dialog.py +++ b/buzz/widgets/import_url_dialog.py @@ -1,7 +1,7 @@ from typing import Optional from PyQt6.QtCore import Qt, QRegularExpression -from PyQt6.QtWidgets import QDialog, QWidget, QDialogButtonBox, QVBoxLayout, QMessageBox +from PyQt6.QtWidgets import QDialog, QWidget, QDialogButtonBox, QMessageBox, QFormLayout from buzz.locale import _ from buzz.widgets.line_edit import LineEdit @@ -19,7 +19,7 @@ def __init__(self, parent: Optional[QWidget] = None): self.setWindowTitle(_("Import URL")) self.line_edit = LineEdit() - self.line_edit.setPlaceholderText(_("URL")) + self.line_edit.setPlaceholderText(_("https://example.com/audio.mp3")) self.line_edit.setMinimumWidth(350) self.button_box = QDialogButtonBox( @@ -28,8 +28,8 @@ def __init__(self, parent: Optional[QWidget] = None): self.button_box.accepted.connect(self.accept) self.button_box.rejected.connect(self.reject) - self.layout = QVBoxLayout() - self.layout.addWidget(self.line_edit) + self.layout = QFormLayout() + self.layout.addRow(_("URL:"), self.line_edit) self.layout.addWidget(self.button_box) self.setLayout(self.layout)