simplify tiramisu/option/symlinkoption.py

This commit is contained in:
Emmanuel Garette 2018-11-14 18:08:20 +01:00
parent dde7ad3373
commit 5d26762761
2 changed files with 8 additions and 12 deletions

View File

@ -29,7 +29,7 @@ class DynSymLinkOption(object):
def __init__(self,
opt,
rootpath,
suffix):
suffix) -> None:
self._opt = opt
self._rootpath = rootpath
self._suffix = suffix

View File

@ -18,6 +18,7 @@
# the rough pypy's guys: http://codespeak.net/svn/pypy/dist/pypy/config/
# the whole pypy projet is under MIT licence
# ____________________________________________________________
from typing import Any
from .baseoption import BaseOption
from ..i18n import _
@ -39,26 +40,21 @@ class SymLinkOption(BaseOption):
opt._add_dependency(self)
def __getattr__(self,
name):
if name == '_path':
return
name: str) -> Any:
return getattr(self._opt, name)
def impl_has_dependency(self,
self_is_dep=True):
self_is_dep: bool=True) -> bool:
"""If self_is_dep is True, it has dependency (self._opt), so return True
if self_is_dep is False, cannot has validation or callback, so return False
"""
return self_is_dep is True
return self_is_dep
def impl_is_symlinkoption(self):
def impl_is_symlinkoption(self) -> bool:
return True
def impl_getopt(self):
def impl_getopt(self) -> BaseOption:
return self._opt
def impl_is_readonly(self):
return self._path is not None
def get_consistencies(self):
def get_consistencies(self) -> tuple:
return ()