Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Release AppImage
name: Build & Release Packages

on:
push:
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:

- name: Install dependencies
run: |
pip install pyinstaller PyQt6 psutil pyudev packaging platformdirs
pip install pyinstaller PyQt6 psutil pyudev requests packaging platformdirs requests

- name: Build with PyInstaller
run: |
Expand Down Expand Up @@ -105,4 +105,48 @@ jobs:
files: |
Lufus-x86_64-${{ github.ref_name }}.tar.gz
Lufus-x86_64-${{ github.ref_name }}.tar.gz.sha256
append_body: true
append_body: true

# for fpm packages
build-fpm:
needs: build-tarball
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
pkg_type: [deb, rpm]
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '3.2'

- name: Install FPM
run: gem install fpm

- name: Download tarball from release
run: |
wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/Lufus-x86_64-${{ github.ref_name }}.tar.gz

- name: Build ${{ matrix.pkg_type }} Package
run: |
mkdir tmp_source && tar -xzf Lufus-x86_64-${{ github.ref_name }}.tar.gz -C tmp_source
fpm -s dir -t ${{ matrix.pkg_type }} \
-n "Lufus" \
-v "${{ github.ref_name }}" \
--iteration 1 \
--prefix /opt/lufus \
--description "Physical drive imaging and formatting utility" \
-C tmp_source/Lufus-x86_64-${{ github.ref_name }} .

- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: |
*.deb
*.rpm
append_body: true
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ license = "MIT"
requires-python = ">=3.10"
dependencies = [
"psutil>=7.2",
"pyqt6>=6.8.0",
"pyside6",
# "pyqt6>=6.8.0",
"pyudev>=0.24.4",
"packaging",
"platformdirs>=4.2",
Expand Down Expand Up @@ -48,10 +49,11 @@ test_sources = [
]
requires = [
"psutil>=7.2",
"pyqt6>=6.8.0",
"pyside6",
# "pyqt6>=6.8.0",
"pyudev>=0.24.4",
"packaging",
"platformdirs>=4.2"
"platformdirs>=4.2",
]
test_requires = [
"pytest",
Expand Down
1 change: 1 addition & 0 deletions requirements-python.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pyinstaller
pyside6
pyqt6
psutil
pyudev
Expand Down
19 changes: 13 additions & 6 deletions src/lufus/drives/autodetect_usb.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from PyQt6.QtCore import QObject, pyqtSignal, QSocketNotifier
from PySide6.QtCore import QObject, Signal, QSocketNotifier
import pyudev
from lufus.lufus_logging import get_logger

log = get_logger(__name__)


class UsbMonitor(QObject):
device_added = pyqtSignal(str)
device_removed = pyqtSignal(str)
device_list_updated = pyqtSignal(dict)
device_added = Signal(str)
device_removed = Signal(str)
device_list_updated = Signal(dict)

def __init__(self):
super().__init__()
Expand Down Expand Up @@ -67,7 +67,10 @@ def _handle_event(self, device):

node = device.device_node
if not node:
log.warning("UsbMonitor: ignoring event with no device_node (action=%s)", device.action)
log.warning(
"UsbMonitor: ignoring event with no device_node (action=%s)",
device.action,
)
return

action = device.action
Expand All @@ -93,7 +96,11 @@ def _handle_event(self, device):
elif action == "remove":
if node in self.devices:
removed_label = self.devices.pop(node)
log.info("UsbMonitor: device removed: %s (was labeled %r)", node, removed_label)
log.info(
"UsbMonitor: device removed: %s (was labeled %r)",
node,
removed_label,
)
self.device_removed.emit(node)
changed = True
else:
Expand Down
10 changes: 5 additions & 5 deletions src/lufus/gui/dialogs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path
from platformdirs import user_config_dir
from PyQt6.QtWidgets import (
from PySide6.QtWidgets import (
QApplication,
QComboBox,
QCheckBox,
Expand All @@ -15,8 +15,8 @@
QTextEdit,
QVBoxLayout,
)
from PyQt6.QtCore import Qt, pyqtSignal, QRegularExpression, QUrl
from PyQt6.QtGui import QFont, QRegularExpressionValidator, QDesktopServices
from PySide6.QtCore import Qt, Signal, QRegularExpression, QUrl
from PySide6.QtGui import QFont, QRegularExpressionValidator, QDesktopServices
import sys

from lufus import state as states
Expand Down Expand Up @@ -189,8 +189,8 @@ def github_open(self):

class SettingsDialog(QDialog):
# signals for when settings change :D
language_changed = pyqtSignal(str)
theme_changed = pyqtSignal(str)
language_changed = Signal(str)
theme_changed = Signal(str)

def __init__(self, parent=None):
super().__init__(parent)
Expand Down
10 changes: 5 additions & 5 deletions src/lufus/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from platformdirs import user_config_dir
from datetime import datetime
from pathlib import Path
from PyQt6.QtWidgets import (
from PySide6.QtWidgets import (
QApplication,
QMainWindow,
QWidget,
Expand All @@ -35,12 +35,12 @@
QToolButton,
QScrollArea,
)
from PyQt6.QtCore import (
from PySide6.QtCore import (
Qt,
QTimer,
QPropertyAnimation,
)
from PyQt6.QtGui import QIcon
from PySide6.QtGui import QIcon

from lufus import state
from lufus import state as states
Expand Down Expand Up @@ -74,7 +74,7 @@ def __init__(self, parent=None):
def set_background(self, image_path):
# load and cache bg pixmap :3
if image_path and Path(image_path).is_file():
from PyQt6.QtGui import QPixmap
from PySide6.QtGui import QPixmap

self._bg_pixmap = QPixmap(str(image_path))
else:
Expand All @@ -83,7 +83,7 @@ def set_background(self, image_path):

def paintEvent(self, event):
if self._bg_pixmap and not self._bg_pixmap.isNull():
from PyQt6.QtGui import QPainter
from PySide6.QtGui import QPainter

painter = QPainter(self)
# scale to fill widget keeping aspect ratio, centre-cropped :D
Expand Down
2 changes: 1 addition & 1 deletion src/lufus/gui/scale.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt6.QtWidgets import QApplication
from PySide6.QtWidgets import QApplication


class Scale:
Expand Down
8 changes: 4 additions & 4 deletions src/lufus/gui/start_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def _load_initial_theme():


def _show_root_warning() -> None:
from PyQt6.QtWidgets import QApplication, QMessageBox
from PyQt6.QtCore import QTimer
from PySide6.QtWidgets import QApplication, QMessageBox
from PySide6.QtCore import QTimer
import sys

app = QApplication(sys.argv)
Expand Down Expand Up @@ -62,8 +62,8 @@ def launch_gui_with_usb_data() -> None:
usb_devices = find_usb()
log.info("Launching GUI with USB devices: %s", usb_devices)

from PyQt6.QtWidgets import QApplication
from PyQt6.QtCore import QTimer
from PySide6.QtWidgets import QApplication
from PySide6.QtCore import QTimer
from lufus.gui.gui import LufusWindow

app = QApplication(sys.argv)
Expand Down
6 changes: 3 additions & 3 deletions src/lufus/gui/themes/icon_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
from PyQt6.QtCore import Qt, QByteArray
from PyQt6.QtGui import QIcon, QPixmap, QPainter
from PyQt6.QtSvg import QSvgRenderer
from PySide6.QtCore import Qt, QByteArray
from PySide6.QtGui import QIcon, QPixmap, QPainter
from PySide6.QtSvg import QSvgRenderer


def svg_icon(svg_path: Path | str, color: str, size: int = 24) -> QIcon:
Expand Down
16 changes: 8 additions & 8 deletions src/lufus/gui/workers.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import sys
from pathlib import Path
from PyQt6.QtCore import QThread, pyqtSignal
from PySide6.QtCore import QThread, Signal
from lufus.writing.partition_scheme import PartitionScheme


class VerifyWorker(QThread):
# worker thread for sha256 verification >:D
progress = pyqtSignal(str)
int_progress = pyqtSignal(int)
flash_done = pyqtSignal(bool)
progress = Signal(str)
int_progress = Signal(int)
flash_done = Signal(bool)

def __init__(self, iso_path: str, expected_hash: str):
super().__init__()
Expand Down Expand Up @@ -48,10 +48,10 @@ def run(self):

class FlashWorker(QThread):
# worker thread for usb flashing operation meow
progress = pyqtSignal(int)
status = pyqtSignal(str)
flash_done = pyqtSignal(bool)
request_tweaks = pyqtSignal()
progress = Signal(int)
status = Signal(str)
flash_done = Signal(bool)
request_tweaks = Signal()

def __init__(self, options: dict, t: dict):
super().__init__()
Expand Down
Loading