Enhance build process and GUI for Path Juggler. Updated build script to use Nuitka for creating a standalone macOS app. Added .DS_Store and build artifacts to .gitignore. Refactored GUI to utilize PySide6, improving layout and styling. Updated logging mechanism for thread-safe operations and enhanced status indicators.
This commit is contained in:
@@ -13,7 +13,7 @@ import time
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from threading import Thread, Event
|
||||
from typing import Callable
|
||||
from typing import Callable, Optional
|
||||
|
||||
from watchdog.observers import Observer
|
||||
from watchdog.events import FileSystemEventHandler
|
||||
@@ -57,7 +57,7 @@ def is_file_open(file_path: Path) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
def get_file_owner_process(file_path: Path) -> str | None:
|
||||
def get_file_owner_process(file_path: Path) -> Optional[str]:
|
||||
"""Get the name of the process that has the file open."""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
@@ -83,7 +83,7 @@ def get_file_owner_process(file_path: Path) -> str | None:
|
||||
|
||||
def wait_for_file_ready(
|
||||
file_path: Path,
|
||||
stop_event: Event | None = None,
|
||||
stop_event: Optional[Event] = None,
|
||||
check_interval: float = 2.0,
|
||||
stable_duration: float = 5.0,
|
||||
timeout: float = 3600.0
|
||||
@@ -151,7 +151,7 @@ def get_honey_volumes() -> list[Path]:
|
||||
return sorted(volumes)
|
||||
|
||||
|
||||
def parse_filename(filename: str) -> dict | None:
|
||||
def parse_filename(filename: str) -> Optional[dict]:
|
||||
"""Parse an MXF filename to extract camera and reel info."""
|
||||
match = FILENAME_PATTERN.match(filename)
|
||||
if not match:
|
||||
@@ -169,7 +169,7 @@ def parse_filename(filename: str) -> dict | None:
|
||||
}
|
||||
|
||||
|
||||
def find_bin_folder(reel_prefix: str, volumes: list[Path]) -> dict | None:
|
||||
def find_bin_folder(reel_prefix: str, volumes: list[Path]) -> Optional[dict]:
|
||||
"""Search HONEY volumes for a bin folder matching the reel prefix."""
|
||||
for volume in volumes:
|
||||
project_path = volume / PROJECT_FOLDER
|
||||
@@ -312,10 +312,10 @@ class PathJuggler:
|
||||
|
||||
def __init__(self, dry_run: bool = False):
|
||||
self.dry_run = dry_run
|
||||
self.observer: Observer | None = None
|
||||
self.observer: Optional[Observer] = None
|
||||
self.stop_event = Event()
|
||||
self.running = False
|
||||
self._thread: Thread | None = None
|
||||
self._thread: Optional[Thread] = None
|
||||
|
||||
def setup_folders(self):
|
||||
"""Ensure watch and destination folders exist."""
|
||||
|
||||
Reference in New Issue
Block a user