private method _get_multitype()

This commit is contained in:
gwen 2013-02-25 15:12:09 +01:00
parent 77633c84ce
commit ea7d297c9b
2 changed files with 3 additions and 4 deletions

View File

@ -30,7 +30,6 @@ from tiramisu.option import (OptionDescription, Option, SymLinkOption,
from tiramisu.setting import groups, owners, Setting from tiramisu.setting import groups, owners, Setting
from tiramisu.value import Values from tiramisu.value import Values
# ____________________________________________________________ # ____________________________________________________________
class Config(object): class Config(object):
"main configuration management entry" "main configuration management entry"

View File

@ -38,7 +38,7 @@ class Values(object):
self.slaves = {} self.slaves = {}
self.context = context self.context = context
def _get_multitype(self): def _get_multitype(self, opt):
if opt in self.slaves: if opt in self.slaves:
# slave # slave
multitype = multitypes.slave multitype = multitypes.slave
@ -54,7 +54,7 @@ class Values(object):
"special case for the multis: they never return None" "special case for the multis: they never return None"
if opt not in self.values: if opt not in self.values:
if opt.is_multi(): if opt.is_multi():
multitype = self._get_multitype() multitype = self._get_multitype(opt)
return Multi(opt.getdefault(), self.context, opt, multitype) return Multi(opt.getdefault(), self.context, opt, multitype)
else: else:
return opt.getdefault() return opt.getdefault()
@ -103,7 +103,7 @@ class Values(object):
_result = [result] _result = [result]
else: else:
_result = result _result = result
multitype = self._get_multitype() multitype = self._get_multitype(opt)
return Multi(_result, self.context, opt, multitype) return Multi(_result, self.context, opt, multitype)
def __getitem__(self, opt): def __getitem__(self, opt):