fake the class name
This commit is contained in:
parent
41c4039dd0
commit
c3051cd3e2
@ -303,23 +303,17 @@ def interpret_env_var_value(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class PathMeta(type):
|
class ExistingPath(Path):
|
||||||
"""Metaclass for Path."""
|
"""A path that must exist."""
|
||||||
|
|
||||||
def __getattr__(cls, name):
|
@property
|
||||||
"""Get the attribute from the Path class.
|
def __class__(self):
|
||||||
|
"""Get the class of the path.
|
||||||
Args:
|
|
||||||
name: The attribute name.
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The attribute.
|
The class of the path.
|
||||||
"""
|
"""
|
||||||
return getattr(Path, name)
|
return Path
|
||||||
|
|
||||||
|
|
||||||
class ExistingPath(Path, metaclass=PathMeta):
|
|
||||||
"""A path that must exist."""
|
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(init=False)
|
@dataclasses.dataclass(init=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user