4
1
Fork 1

Add DirectoryGetter abstract class

- init dirgetter module
- init dirgetter.types
- init girgetter.abc
- Add DirGetter absctract class
This commit is contained in:
trueold89 2024-08-03 16:49:22 +03:00
parent cf48b90f2a
commit 0b48cb152e
Signed by: trueold89
GPG Key ID: C122E85DD49E6B30
3 changed files with 46 additions and 0 deletions

View File

29
tubot/dirgetter/abc.py Normal file
View File

@ -0,0 +1,29 @@
# -*- 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):
_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

17
tubot/dirgetter/types.py Normal file
View File

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
#####################################
# Types for Directory-Getter module #
#####################################
# Imports
from enum import Enum
class GetterTypes(Enum):
"""
Types of getters
"""
OS = "Python os module"
Jellyfin = "Jelyfin API"