diff --git a/tiramisu/option.py b/tiramisu/option.py index 59b0bdb..1af3a81 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -373,20 +373,19 @@ class StrOption(Option): class SymLinkOption(object): opt_type = 'symlink' - def __init__(self, name, path): + def __init__(self, name, path, opt): self._name = name self.path = path + self.opt = opt def setoption(self, config, value, who): - setattr(config, self.path, value) # .setoption(self.path, value, who) + setattr(config, self.path, value) def __getattr__(self, name): - if name not in ('setoption', 'getkey'): - raise TypeError("shall not call {0} method/attribute on " - "SymLinkOption {1}".format(name, self._name)) - - def getkey(self, value): - return value + if name in ('_name', 'path', 'opt', 'setoption'): + return self.__dict__[name] + else: + return getattr(self.opt, name) class IPOption(Option): opt_type = 'ip'