28 lines
723 B
Python
28 lines
723 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Self
|
|
from abc import ABC, abstractmethod
|
|
|
|
class FilesDriverInterface(ABC):
|
|
|
|
@abstractmethod
|
|
def get_absolute_path(self:Self, path:str) -> str|None:pass
|
|
|
|
@abstractmethod
|
|
def exists(self:Self, path:str) -> bool:pass
|
|
|
|
@abstractmethod
|
|
def is_file(self:Self, path:str) -> bool:pass
|
|
|
|
@abstractmethod
|
|
def is_directory(self:Self, path:str) -> bool:pass
|
|
|
|
@abstractmethod
|
|
def load(self:Self, path:str, mode:str = "r") -> str|bytes|None:pass
|
|
|
|
@abstractmethod
|
|
def load_json(self:Self, path:str) -> str|bytes|None:pass
|
|
|
|
@abstractmethod
|
|
def save(self:Self, path:str, content:str|bytes, mode:str = "w") -> bool:pass |