forked from OrudoCA/qBitDownload-Bot
Add DirectoryGetter abstract class
- init dirgetter module - init dirgetter.types - init girgetter.abc - Add DirGetter absctract class
This commit is contained in:
parent
cf48b90f2a
commit
0b48cb152e
|
@ -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
|
|
@ -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"
|
Loading…
Reference in New Issue