示例#1
0
 def load_module(self, module):
     """Load a child module"""
     value = self._value()
     if value == NOTSET:
         raise SettingNotSet("%s.%s", self.group.key, self.key)
     else:
         return load_module("%s.%s" % (value, module))
 def load_module(self, module):
     """Load a child module"""
     value = self._value()
     if value == NOTSET:
         raise SettingNotSet(f"{self.group.key}.{self.key}")
     else:
         return load_module("%s.%s" % (value, module))
示例#3
0
 def to_python(self, value):
     if value in (NOTSET, ''):
         v = {}  # TODO this was probably not a good idea
     else:
         try:
             v = load_module(value)
         except ImportError:
             v = ''
     return v
 def to_python(self, value):
     if value in (NOTSET, ''):
         v = {}  # TODO this was probably not a good idea
     else:
         try:
             v = load_module(value)
         except ImportError:
             v = ''
     return v
示例#5
0
 def to_python(self, value):
     if value == NOTSET:
         v = {}
     else:
         try:
             v = load_module(value)
         except ImportError:
             v = ''
     return v
示例#6
0
 def to_python(self, value):
     if value == NOTSET:
         v = {}
     else:
         try:
             v = load_module(value)
         except ImportError:
             v = ''
     return v
示例#7
0
 def load_module(self, module):
     """Load a child module"""
     value = self._value()
     if value == NOTSET:
         raise SettingNotSet("{}.{}".format(
             self.group.key,
             self.key,
         ))
     else:
         return load_module("%s.%s" % (value, module))
示例#8
0
 def to_python(self, value):
     if value == NOTSET:
         v = {}
     else:
         v = load_module(value)
     return v
示例#9
0
文件: values.py 项目: CARocha/ADDAC
 def to_python(self, value):
     if value == NOTSET:
         v = {}
     else:
         v = load_module(value)
     return v