This repository has been archived on 2024-08-07. You can view files and clone it, but cannot push or open issues or pull requests.
2024-08-03 13:49:22 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Directory-Getter module abstract classes #
|
|
|
|
############################################
|
|
|
|
|
|
|
|
# Imports
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
from tubot.static.abc import IValidatable
|
|
|
|
from tubot.dirgetter.types import GetterTypes
|
|
|
|
|
|
|
|
|
|
|
|
class DirGetter(IValidatable, ABC):
|
2024-08-05 11:56:18 +00:00
|
|
|
"""
|
|
|
|
DirectoryGetter Abstract class
|
|
|
|
"""
|
2024-08-05 12:22:29 +00:00
|
|
|
|
2024-08-03 13:49:22 +00:00
|
|
|
_gtype: GetterTypes
|
|
|
|
|
|
|
|
def __init__(self) -> None:
|
|
|
|
if self._gtype is None:
|
|
|
|
raise NotImplementedError("DirGetter type is not implemented")
|
|
|
|
|
|
|
|
@property
|
|
|
|
@abstractmethod
|
|
|
|
async def folders(self) -> dict:
|
|
|
|
"""
|
|
|
|
Returns a dictionary of media folders {name: path}
|
|
|
|
|
|
|
|
:return: Dict of media folders
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|