(feat:file_abstract) process files method

This commit is contained in:
ManishMadan2882
2025-04-16 03:36:45 +05:30
parent e567d88951
commit 377e33c148
3 changed files with 77 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
"""Base storage class for file system abstraction."""
from abc import ABC, abstractmethod
from typing import BinaryIO, List
from typing import BinaryIO, List, Optional, Callable
class BaseStorage(ABC):
@@ -33,6 +33,24 @@ class BaseStorage(ABC):
"""
pass
@abstractmethod
def process_file(self, path: str, processor_func: Callable, **kwargs):
"""
Process a file using the provided processor function.
This method handles the details of retrieving the file and providing
it to the processor function in an appropriate way based on the storage type.
Args:
path: Path to the file
processor_func: Function that processes the file
**kwargs: Additional arguments to pass to the processor function
Returns:
The result of the processor function
"""
pass
@abstractmethod
def delete_file(self, path: str) -> bool:
"""