# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/mxns/04_kind.ipynb.

# %% auto 0
__all__ = ['FileKindMixin', 'DirKindMixin']

# %% ../../nbs/mxns/04_kind.ipynb 6
import os, pathlib
from abc import abstractmethod

# %% ../../nbs/mxns/04_kind.ipynb 8
from typing import Callable, Optional

# %% ../../nbs/mxns/04_kind.ipynb 10
from atyp import PathType
from nlit import (PathKind, NAME)

from chck.path import ispath

# %% ../../nbs/mxns/04_kind.ipynb 12
#| export


# %% ../../nbs/mxns/04_kind.ipynb 15
class FileKindMixin:
    pkind: PathKind = PathKind.FILE
    file: PathType

    @property
    def filename(self): 
        return self.file.name if ispath(self.file) or hasattr(self, NAME) else self.file

# %% ../../nbs/mxns/04_kind.ipynb 17
class DirKindMixin:
    pkind: PathKind = PathKind.DIR
    dir: PathType

    @property
    def dirname(self): return self.dir.name
