22 lines
574 B
Python
22 lines
574 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Self, Any
|
|
from abc import ABC, abstractmethod
|
|
|
|
class FilesDriverInterface(ABC):
|
|
|
|
ROOT:str = None
|
|
SLASH:str = None
|
|
|
|
@abstractmethod
|
|
def get_absolute_path(self:Self, path:str) -> str|None:pass
|
|
|
|
@abstractmethod
|
|
def load_file(self:Self, path:str, mode:str = "r") -> str|bytes|None:pass
|
|
|
|
@abstractmethod
|
|
def load_json(self:Self,
|
|
data:str|dict[str, Any|None]|list[Any|None],
|
|
only_dictionaries:bool = True
|
|
) -> list[dict[str, Any|None]|list[Any|None]]:pass |