27 lines
522 B
Python
27 lines
522 B
Python
__all__ = ("Entry",)
|
|
|
|
|
|
import logging
|
|
from pathlib import Path
|
|
from typing import Optional
|
|
|
|
logger = logging.getLogger("entry")
|
|
|
|
|
|
class Entry:
|
|
_logger = logger
|
|
|
|
def __init__(self, entry_type: str, basepath: Path):
|
|
self._type = entry_type
|
|
self._basepath = basepath
|
|
|
|
def setup(self):
|
|
raise NotImplemented
|
|
|
|
def __repr__(self):
|
|
return f"{self._type} {str(self._basepath)}"
|
|
|
|
@classmethod
|
|
def detect(cls, basepath: Path) -> Optional["Entry"]:
|
|
raise NotImplemented
|