only catch PropertiesOptionError
This commit is contained in:
parent
16801ad1b2
commit
6097f3af84
@ -203,7 +203,7 @@ class SubConfig(object):
|
||||
yield child._name, getattr(self, child._name)
|
||||
except GeneratorExit:
|
||||
raise StopIteration
|
||||
except:
|
||||
except PropertiesOptionError:
|
||||
pass # option with properties
|
||||
|
||||
def iter_all(self):
|
||||
@ -214,7 +214,7 @@ class SubConfig(object):
|
||||
yield child._name, getattr(self, child._name)
|
||||
except GeneratorExit:
|
||||
raise StopIteration
|
||||
except:
|
||||
except PropertiesOptionError:
|
||||
pass # option with properties
|
||||
|
||||
def iter_groups(self, group_type=None):
|
||||
@ -240,7 +240,7 @@ class SubConfig(object):
|
||||
yield child._name, getattr(self, child._name)
|
||||
except GeneratorExit:
|
||||
raise StopIteration
|
||||
except:
|
||||
except PropertiesOptionError:
|
||||
pass
|
||||
# ______________________________________________________________________
|
||||
|
||||
@ -252,7 +252,7 @@ class SubConfig(object):
|
||||
for name, value in self:
|
||||
try:
|
||||
lines.append("%s = %s" % (name, value))
|
||||
except:
|
||||
except PropertiesOptionError:
|
||||
pass
|
||||
return '\n'.join(lines)
|
||||
|
||||
@ -425,8 +425,7 @@ class Config(SubConfig):
|
||||
getattr(homeconfig, name)
|
||||
except MandatoryError:
|
||||
pass
|
||||
except Exception, e:
|
||||
#FIXME hu? should have Exception ?
|
||||
except PropertiesOptionError, e:
|
||||
raise e # HiddenOptionError or DisabledOptionError
|
||||
child = getattr(homeconfig._cfgimpl_descr, name)
|
||||
homeconfig.setoption(name, child, value)
|
||||
@ -464,7 +463,7 @@ class Config(SubConfig):
|
||||
value = getattr(self, path)
|
||||
if value == byvalue:
|
||||
return True
|
||||
except: # a property restricts the access of the value
|
||||
except PropertiesOptionError: # a property restricts the access of the value
|
||||
pass
|
||||
return False
|
||||
|
||||
@ -504,7 +503,7 @@ class Config(SubConfig):
|
||||
#remove option with propertyerror, ...
|
||||
try:
|
||||
value = getattr(self, path)
|
||||
except: # a property restricts the access of the value
|
||||
except PropertiesOptionError: # a property restricts the access of the value
|
||||
continue
|
||||
if not _filter_by_type():
|
||||
continue
|
||||
|
@ -108,7 +108,7 @@ class Values(object):
|
||||
return Multi(_result, self.context, opt) # , multitype)
|
||||
|
||||
def _getcallback_value(self, opt):
|
||||
callback, callback_params = opt.callback
|
||||
callback, callback_params = opt._callback
|
||||
if callback_params is None:
|
||||
callback_params = {}
|
||||
return carry_out_calculation(opt._name, config=self.context,
|
||||
|
Loading…
Reference in New Issue
Block a user