CBCFacil v8.0 - Refactored with AMD GPU support

This commit is contained in:
2026-01-09 13:05:46 -03:00
parent cb17136f21
commit b017504c52
54 changed files with 7251 additions and 3670 deletions

View File

@@ -0,0 +1,40 @@
"""
Base File Processor (Strategy Pattern)
"""
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Dict, Any, Optional
from ..core import FileProcessingError
class FileProcessor(ABC):
"""Abstract base class for file processors"""
def __init__(self, name: str):
self.name = name
@abstractmethod
def can_process(self, file_path: str) -> bool:
"""Check if processor can handle this file type"""
pass
@abstractmethod
def process(self, file_path: str) -> Dict[str, Any]:
"""Process the file"""
pass
def get_file_extension(self, file_path: str) -> str:
"""Get file extension from path"""
return Path(file_path).suffix.lower()
def get_base_name(self, file_path: str) -> str:
"""Get base name without extension"""
return Path(file_path).stem
def validate_file(self, file_path: str) -> None:
"""Validate file exists and is accessible"""
path = Path(file_path)
if not path.exists():
raise FileProcessingError(f"File not found: {file_path}")
if not path.is_file():
raise FileProcessingError(f"Path is not a file: {file_path}")