Compare commits

...

10 Commits

16 changed files with 794 additions and 386 deletions

View File

@ -1,3 +1,12 @@
Tue Mar 5 08:22:12 2018 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc2
* simplifying netmaskoption
* multiple option call (fixes #1)
* doesn't check follower requirement with an other follower or a leader if idx is None (fixes #3)
Mon Feb 25 10:12:35 2018 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc1
Sat Sep 8 22:54:12 2018 +0200 Emmanuel Garette <egarette@cadoles.com> Sat Sep 8 22:54:12 2018 +0200 Emmanuel Garette <egarette@cadoles.com>
* propose a new API to access to Tiramisu Option * propose a new API to access to Tiramisu Option
This new API is totally incompatible with older's one This new API is totally incompatible with older's one

View File

@ -83,30 +83,34 @@ def _autocheck_default_value(cfg, path, conf, **kwargs):
# test default value (should be empty) # test default value (should be empty)
# cannot test for follower (we cannot get all values for a follower) # cannot test for follower (we cannot get all values for a follower)
if conf is not None:
cfg_ = cfg.config(conf)
else:
cfg_ = cfg
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
if not isfollower: if not isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(path).value.get() == empty_value assert cfg_.option(path).value.get() == empty_value
assert cfg.config(conf).forcepermissive.option(path).value.get() == empty_value assert cfg_.forcepermissive.option(path).value.get() == empty_value
elif not kwargs.get('propertyerror', False): elif not kwargs.get('propertyerror', False):
raises(PropertiesOptionError, "cfg.config(conf).option(path).value.get()") raises(PropertiesOptionError, "cfg_.option(path).value.get()")
assert cfg.config(conf).forcepermissive.option(path).value.get() == empty_value assert cfg_.forcepermissive.option(path).value.get() == empty_value
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(path).value.get()") raises(PropertiesOptionError, "cfg_.option(path).value.get()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(path).value.get()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(path).value.get()")
else: else:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(path, 0).value.get() == empty_value assert cfg_.option(path, 0).value.get() == empty_value
assert cfg.config(conf).option(path, 1).value.get() == empty_value assert cfg_.option(path, 1).value.get() == empty_value
assert cfg.config(conf).forcepermissive.option(path, 0).value.get() == empty_value assert cfg_.forcepermissive.option(path, 0).value.get() == empty_value
assert cfg.config(conf).forcepermissive.option(path, 1).value.get() == empty_value assert cfg_.forcepermissive.option(path, 1).value.get() == empty_value
elif not kwargs.get('propertyerror', False): elif not kwargs.get('propertyerror', False):
raises(PropertiesOptionError, "cfg.config(conf).option(path, 0).value.get()") raises(PropertiesOptionError, "cfg_.option(path, 0).value.get()")
assert cfg.config(conf).forcepermissive.option(path, 0).value.get() == empty_value assert cfg_.forcepermissive.option(path, 0).value.get() == empty_value
assert cfg.config(conf).forcepermissive.option(path, 1).value.get() == empty_value assert cfg_.forcepermissive.option(path, 1).value.get() == empty_value
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(path, 0).value.get()") raises(PropertiesOptionError, "cfg_.option(path, 0).value.get()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(path, 0).value.get()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(path, 0).value.get()")
def _set_value(cfg, pathwrite, conf, **kwargs): def _set_value(cfg, pathwrite, conf, **kwargs):
@ -131,52 +135,56 @@ def _set_value(cfg, pathwrite, conf, **kwargs):
# for follower should have an index and good length # for follower should have an index and good length
# for leader must append, not set # for leader must append, not set
if conf is not None:
cfg_ = cfg.config(conf)
else:
cfg_ = cfg
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
if isleader: if isleader:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
raises(APIError, "cfg.config(conf).option(pathwrite, 0).value.set(first_value[0])") raises(APIError, "cfg_.option(pathwrite, 0).value.set(first_value[0])")
if not set_permissive: if not set_permissive:
cfg.config(conf).option(pathwrite).value.set([first_value[0]]) cfg_.option(pathwrite).value.set([first_value[0]])
else: else:
cfg.config(conf).forcepermissive.option(pathwrite).value.set([first_value[0]]) cfg_.forcepermissive.option(pathwrite).value.set([first_value[0]])
elif not kwargs.get('propertyerror', False): elif not kwargs.get('propertyerror', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathwrite).value.set([first_value[0]])") raises(PropertiesOptionError, "cfg_.option(pathwrite).value.set([first_value[0]])")
if set_permissive: if set_permissive:
cfg.config(conf).forcepermissive.option(pathwrite).value.set([first_value[0]]) cfg_.forcepermissive.option(pathwrite).value.set([first_value[0]])
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathwrite).value.set([first_value[0]])") raises(PropertiesOptionError, "cfg_.option(pathwrite).value.set([first_value[0]])")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathwrite).value.set([first_value[0]])") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathwrite).value.set([first_value[0]])")
if len(first_value) > 1: if len(first_value) > 1:
raises(APIError, "cfg.config(conf).unrestraint.option(pathwrite).value.set(first_value[1])") raises(APIError, "cfg_.unrestraint.option(pathwrite).value.set(first_value[1])")
elif isfollower: elif isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
if not set_permissive: if not set_permissive:
cfg.config(conf).option(pathwrite, 1).value.set(second_value) cfg_.option(pathwrite, 1).value.set(second_value)
else: else:
cfg.config(conf).forcepermissive.option(pathwrite, 1).value.set(second_value) cfg_.forcepermissive.option(pathwrite, 1).value.set(second_value)
elif not kwargs.get('propertyerror', False): elif not kwargs.get('propertyerror', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathwrite, 1).value.set(second_value)") raises(PropertiesOptionError, "cfg_.option(pathwrite, 1).value.set(second_value)")
if set_permissive: if set_permissive:
cfg.config(conf).forcepermissive.option(pathwrite, 1).value.set(second_value) cfg_.forcepermissive.option(pathwrite, 1).value.set(second_value)
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathwrite, 1).value.set(second_value)") raises(PropertiesOptionError, "cfg_.option(pathwrite, 1).value.set(second_value)")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathwrite, 1).value.set(second_value)") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathwrite, 1).value.set(second_value)")
raises(APIError, "cfg.config(conf).unrestraint.option(pathwrite).value.set([second_value, second_value])") raises(APIError, "cfg_.unrestraint.option(pathwrite).value.set([second_value, second_value])")
else: else:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
if not set_permissive: if not set_permissive:
cfg.config(conf).option(pathwrite).value.set(first_value) cfg_.option(pathwrite).value.set(first_value)
else: else:
cfg.config(conf).forcepermissive.option(pathwrite).value.set(first_value) cfg_.forcepermissive.option(pathwrite).value.set(first_value)
elif not kwargs.get('propertyerror', False): elif not kwargs.get('propertyerror', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathwrite).value.set(first_value)") raises(PropertiesOptionError, "cfg_.option(pathwrite).value.set(first_value)")
if set_permissive: if set_permissive:
cfg.config(conf).forcepermissive.option(pathwrite).value.set(first_value) cfg_.forcepermissive.option(pathwrite).value.set(first_value)
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathwrite).value.set(first_value)") raises(PropertiesOptionError, "cfg_.option(pathwrite).value.set(first_value)")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathwrite).value.set(first_value)") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathwrite).value.set(first_value)")
#FIXME raises(APIError, "cfg.config(conf).unrestraint.option(pathwrite).value.set(first_value)") #FIXME raises(APIError, "cfg_.unrestraint.option(pathwrite).value.set(first_value)")
def _getproperties(multi, isfollower, kwargs): def _getproperties(multi, isfollower, kwargs):
@ -195,37 +203,41 @@ def _getproperties(multi, isfollower, kwargs):
def _check_properties(cfg, mcfg, pathread, conf, kwargs, props_permissive, props): def _check_properties(cfg, mcfg, pathread, conf, kwargs, props_permissive, props):
if conf is not None:
cfg_ = cfg.config(conf)
else:
cfg_ = cfg
if not cfg.unrestraint.option(pathread).option.isfollower(): if not cfg.unrestraint.option(pathread).option.isfollower():
if not kwargs.get('permissive_od', False): if not kwargs.get('permissive_od', False):
assert set(cfg.config(conf).option(pathread).property.get()) == set(props_permissive) assert set(cfg_.option(pathread).property.get()) == set(props_permissive)
assert set(cfg.config(conf).option(pathread).property.get()) == set(props) assert set(cfg_.option(pathread).property.get()) == set(props)
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).property.get()") raises(PropertiesOptionError, "cfg_.option(pathread).property.get()")
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).property.get()") raises(PropertiesOptionError, "cfg_.option(pathread).property.get()")
assert set(cfg.config(conf).forcepermissive.option(pathread).property.get()) == set(props_permissive) assert set(cfg_.forcepermissive.option(pathread).property.get()) == set(props_permissive)
assert set(cfg.config(conf).forcepermissive.option(pathread).property.get()) == set(props) assert set(cfg_.forcepermissive.option(pathread).property.get()) == set(props)
assert set(cfg.config(conf).unrestraint.option(pathread).property.get()) == set(props_permissive) assert set(cfg_.unrestraint.option(pathread).property.get()) == set(props_permissive)
assert set(cfg.config(conf).unrestraint.option(pathread).property.get()) == set(props) assert set(cfg_.unrestraint.option(pathread).property.get()) == set(props)
else: else:
if not kwargs.get('permissive_od', False): if not kwargs.get('permissive_od', False):
assert set(cfg.config(conf).option(pathread, 0).property.get()) == set(props_permissive) assert set(cfg_.option(pathread, 0).property.get()) == set(props_permissive)
assert set(cfg.config(conf).option(pathread, 0).property.get()) == set(props) assert set(cfg_.option(pathread, 0).property.get()) == set(props)
# #
assert set(cfg.config(conf).option(pathread, 1).property.get()) == set(props_permissive) assert set(cfg_.option(pathread, 1).property.get()) == set(props_permissive)
assert set(cfg.config(conf).option(pathread, 1).property.get()) == set(props) assert set(cfg_.option(pathread, 1).property.get()) == set(props)
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).property.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).property.get()")
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).property.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).property.get()")
# #
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 1).property.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 1).property.get()")
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 1).property.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 1).property.get()")
assert set(cfg.config(conf).forcepermissive.option(pathread, 0).property.get()) == set(props_permissive) assert set(cfg_.forcepermissive.option(pathread, 0).property.get()) == set(props_permissive)
assert set(cfg.config(conf).forcepermissive.option(pathread, 0).property.get()) == set(props) assert set(cfg_.forcepermissive.option(pathread, 0).property.get()) == set(props)
# #
assert set(cfg.config(conf).forcepermissive.option(pathread, 1).property.get()) == set(props_permissive) assert set(cfg_.forcepermissive.option(pathread, 1).property.get()) == set(props_permissive)
assert set(cfg.config(conf).forcepermissive.option(pathread, 1).property.get()) == set(props) assert set(cfg_.forcepermissive.option(pathread, 1).property.get()) == set(props)
assert set(cfg.config(conf).unrestraint.option(pathread, 1).property.get()) == set(props_permissive) assert set(cfg_.unrestraint.option(pathread, 1).property.get()) == set(props_permissive)
assert set(cfg.config(conf).unrestraint.option(pathread, 1).property.get()) == set(props) assert set(cfg_.unrestraint.option(pathread, 1).property.get()) == set(props)
def _property_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kwargs): def _property_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kwargs):
@ -253,12 +265,16 @@ def _property_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **
# set properties with permissive # set properties with permissive
for prop in properties: for prop in properties:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if confread is not None:
cfg.config(confread).option(pathwrite).property.add(prop) cfg_ = cfg.config(confread)
elif not kwargs.get('propertyerror', False):
cfg.config(confread).forcepermissive.option(pathwrite).property.add(prop)
else: else:
cfg.config(confread).unrestraint.option(pathwrite).property.add(prop) cfg_ = cfg
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
cfg_.option(pathwrite).property.add(prop)
elif not kwargs.get('propertyerror', False):
cfg_.forcepermissive.option(pathwrite).property.add(prop)
else:
cfg_.unrestraint.option(pathwrite).property.add(prop)
if confwrite == confread: if confwrite == confread:
_check_properties(cfg, mcfg, pathread, confwrite, kwargs, properties, properties) _check_properties(cfg, mcfg, pathread, confwrite, kwargs, properties, properties)
else: else:
@ -286,64 +302,72 @@ def _autocheck_get_value(cfg, pathread, conf, **kwargs):
second_value = SUBLIST_SECOND_VALUE[1] second_value = SUBLIST_SECOND_VALUE[1]
# get value after set value without permissive # get value after set value without permissive
if conf is not None:
cfg_ = cfg.config(conf)
else:
cfg_ = cfg
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
if isfollower: if isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(pathread, 0).value.get() == empty_value assert cfg_.option(pathread, 0).value.get() == empty_value
assert cfg.config(conf).option(pathread, 1).value.get() == second_value assert cfg_.option(pathread, 1).value.get() == second_value
assert cfg.config(conf).forcepermissive.option(pathread, 0).value.get() == empty_value assert cfg_.forcepermissive.option(pathread, 0).value.get() == empty_value
assert cfg.config(conf).forcepermissive.option(pathread, 1).value.get() == second_value assert cfg_.forcepermissive.option(pathread, 1).value.get() == second_value
elif kwargs.get('permissive', False): elif kwargs.get('permissive', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).value.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).value.get()")
assert cfg.config(conf).forcepermissive.option(pathread, 0).value.get() == empty_value assert cfg_.forcepermissive.option(pathread, 0).value.get() == empty_value
if set_permissive: if set_permissive:
assert cfg.config(conf).forcepermissive.option(pathread, 1).value.get() == second_value assert cfg_.forcepermissive.option(pathread, 1).value.get() == second_value
else: else:
assert cfg.config(conf).forcepermissive.option(pathread, 1).value.get() == empty_value assert cfg_.forcepermissive.option(pathread, 1).value.get() == empty_value
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).value.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).value.get()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread, 0).value.get()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathread, 0).value.get()")
else: else:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(pathread).value.get() == first_value assert cfg_.option(pathread).value.get() == first_value
assert cfg.config(conf).forcepermissive.option(pathread).value.get() == first_value assert cfg_.forcepermissive.option(pathread).value.get() == first_value
elif kwargs.get('permissive', False): elif kwargs.get('permissive', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).value.get()") raises(PropertiesOptionError, "cfg_.option(pathread).value.get()")
if set_permissive: if set_permissive:
assert cfg.config(conf).forcepermissive.option(pathread).value.get() == first_value assert cfg_.forcepermissive.option(pathread).value.get() == first_value
else: else:
assert cfg.config(conf).forcepermissive.option(pathread).value.get() == empty_value assert cfg_.forcepermissive.option(pathread).value.get() == empty_value
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).value.get()") raises(PropertiesOptionError, "cfg_.option(pathread).value.get()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread).value.get()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathread).value.get()")
def _check_owner(cfg, pathread, conf, kwargs, owner, permissive_owner): def _check_owner(cfg, pathread, conf, kwargs, owner, permissive_owner):
isfollower = cfg.unrestraint.option(pathread).option.isfollower() isfollower = cfg.unrestraint.option(pathread).option.isfollower()
if conf is not None:
cfg_ = cfg.config(conf)
else:
cfg_ = cfg
if not isfollower: if not isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(pathread).owner.get() == owner assert cfg_.option(pathread).owner.get() == owner
assert cfg.config(conf).forcepermissive.option(pathread).owner.get() == owner assert cfg_.forcepermissive.option(pathread).owner.get() == owner
elif not kwargs.get('propertyerror', False): elif not kwargs.get('propertyerror', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).owner.get()") raises(PropertiesOptionError, "cfg_.option(pathread).owner.get()")
assert cfg.config(conf).forcepermissive.option(pathread).owner.get() == permissive_owner assert cfg_.forcepermissive.option(pathread).owner.get() == permissive_owner
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).owner.get()") raises(PropertiesOptionError, "cfg_.option(pathread).owner.get()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread).owner.get()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathread).owner.get()")
else: else:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(pathread, 0).owner.get() == 'default' assert cfg_.option(pathread, 0).owner.get() == 'default'
assert cfg.config(conf).forcepermissive.option(pathread, 0).owner.get() == 'default' assert cfg_.forcepermissive.option(pathread, 0).owner.get() == 'default'
assert cfg.config(conf).option(pathread, 1).owner.get() == owner assert cfg_.option(pathread, 1).owner.get() == owner
assert cfg.config(conf).forcepermissive.option(pathread, 1).owner.get() == owner assert cfg_.forcepermissive.option(pathread, 1).owner.get() == owner
elif not kwargs.get('propertyerror', False): elif not kwargs.get('propertyerror', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).owner.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).owner.get()")
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 1).owner.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 1).owner.get()")
assert cfg.config(conf).forcepermissive.option(pathread, 0).owner.get() == 'default' assert cfg_.forcepermissive.option(pathread, 0).owner.get() == 'default'
assert cfg.config(conf).forcepermissive.option(pathread, 1).owner.get() == permissive_owner assert cfg_.forcepermissive.option(pathread, 1).owner.get() == permissive_owner
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).owner.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).owner.get()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread, 0).owner.get()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathread, 0).owner.get()")
@autocheck @autocheck
@ -373,49 +397,53 @@ def autocheck_default_owner(cfg, mcfg, pathread, pathwrite, confread, confwrite,
isfollower = cfg.unrestraint.option(pathread).option.isfollower() isfollower = cfg.unrestraint.option(pathread).option.isfollower()
# check if owner is a string "default" and 'isdefault' # check if owner is a string "default" and 'isdefault'
def do(conf): def do(conf):
if conf is not None:
cfg_ = cfg.config(conf)
else:
cfg_ = cfg
if not isfollower: if not isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(pathread).owner.get() == 'default' assert cfg_.option(pathread).owner.get() == 'default'
assert cfg.config(conf).forcepermissive.option(pathread).owner.get() == 'default' assert cfg_.forcepermissive.option(pathread).owner.get() == 'default'
# #
assert cfg.config(conf).option(pathread).owner.isdefault() assert cfg_.option(pathread).owner.isdefault()
assert cfg.config(conf).forcepermissive.option(pathread).owner.isdefault() assert cfg_.forcepermissive.option(pathread).owner.isdefault()
elif not kwargs.get('propertyerror', False): elif not kwargs.get('propertyerror', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).owner.get()") raises(PropertiesOptionError, "cfg_.option(pathread).owner.get()")
assert cfg.config(conf).forcepermissive.option(pathread).owner.get() == 'default' assert cfg_.forcepermissive.option(pathread).owner.get() == 'default'
# #
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).owner.isdefault()") raises(PropertiesOptionError, "cfg_.option(pathread).owner.isdefault()")
assert cfg.config(conf).forcepermissive.option(pathread).owner.isdefault() assert cfg_.forcepermissive.option(pathread).owner.isdefault()
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).owner.get()") raises(PropertiesOptionError, "cfg_.option(pathread).owner.get()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread).owner.get()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathread).owner.get()")
# #
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).owner.isdefault()") raises(PropertiesOptionError, "cfg_.option(pathread).owner.isdefault()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread).owner.isdefault()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathread).owner.isdefault()")
# #
assert cfg.config(conf).unrestraint.option(pathread).owner.get() == 'default' assert cfg_.unrestraint.option(pathread).owner.get() == 'default'
assert cfg.config(conf).unrestraint.option(pathread).owner.isdefault() assert cfg_.unrestraint.option(pathread).owner.isdefault()
else: else:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(pathread, 0).owner.get() == 'default' assert cfg_.option(pathread, 0).owner.get() == 'default'
assert cfg.config(conf).forcepermissive.option(pathread, 0).owner.get() == 'default' assert cfg_.forcepermissive.option(pathread, 0).owner.get() == 'default'
# #
assert cfg.config(conf).option(pathread, 0).owner.isdefault() assert cfg_.option(pathread, 0).owner.isdefault()
assert cfg.config(conf).forcepermissive.option(pathread, 0).owner.isdefault() assert cfg_.forcepermissive.option(pathread, 0).owner.isdefault()
elif not kwargs.get('propertyerror', False): elif not kwargs.get('propertyerror', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).owner.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).owner.get()")
assert cfg.config(conf).forcepermissive.option(pathread, 0).owner.get() == 'default' assert cfg_.forcepermissive.option(pathread, 0).owner.get() == 'default'
# #
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).owner.isdefault()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).owner.isdefault()")
assert cfg.config(conf).forcepermissive.option(pathread, 0).owner.isdefault() assert cfg_.forcepermissive.option(pathread, 0).owner.isdefault()
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).owner.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).owner.get()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread, 0).owner.get()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathread, 0).owner.get()")
# #
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).owner.isdefault()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).owner.isdefault()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread, 0).owner.isdefault()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathread, 0).owner.isdefault()")
assert cfg.config(conf).unrestraint.option(pathread, 0).owner.get() == 'default' assert cfg_.unrestraint.option(pathread, 0).owner.get() == 'default'
assert cfg.config(conf).unrestraint.option(pathread, 0).owner.isdefault() assert cfg_.unrestraint.option(pathread, 0).owner.isdefault()
do(confread) do(confread)
if confread != confwrite: if confread != confwrite:
do(confwrite) do(confwrite)
@ -450,40 +478,44 @@ def autocheck_get_value_permissive(cfg, mcfg, pathread, pathwrite, confread, con
def do(conf): def do(conf):
# get value after set value without permissive # get value after set value without permissive
if conf is not None:
cfg_ = cfg.config(conf)
else:
cfg_ = cfg
if isfollower: if isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(pathread, 0).value.get() == empty_value assert cfg_.option(pathread, 0).value.get() == empty_value
assert cfg.config(conf).forcepermissive.option(pathread, 0).value.get() == empty_value assert cfg_.forcepermissive.option(pathread, 0).value.get() == empty_value
if submulti_: if submulti_:
assert cfg.config(conf).option(pathread, 1).value.get() == SUBLIST_SECOND_VALUE[1] assert cfg_.option(pathread, 1).value.get() == SUBLIST_SECOND_VALUE[1]
assert cfg.config(conf).forcepermissive.option(pathread, 1).value.get() == SUBLIST_SECOND_VALUE[1] assert cfg_.forcepermissive.option(pathread, 1).value.get() == SUBLIST_SECOND_VALUE[1]
else: else:
assert cfg.config(conf).option(pathread, 1).value.get() == LIST_SECOND_VALUE[1] assert cfg_.option(pathread, 1).value.get() == LIST_SECOND_VALUE[1]
assert cfg.config(conf).forcepermissive.option(pathread, 1).value.get() == LIST_SECOND_VALUE[1] assert cfg_.forcepermissive.option(pathread, 1).value.get() == LIST_SECOND_VALUE[1]
elif kwargs.get('permissive', False): elif kwargs.get('permissive', False):
raises(PropertiesOptionError, "assert cfg.config(conf).option(pathread, 0).value.get()") raises(PropertiesOptionError, "assert cfg_.option(pathread, 0).value.get()")
raises(PropertiesOptionError, "assert cfg.config(conf).option(pathread, 1).value.get()") raises(PropertiesOptionError, "assert cfg_.option(pathread, 1).value.get()")
assert cfg.config(conf).forcepermissive.option(pathread, 0).value.get() == empty_value assert cfg_.forcepermissive.option(pathread, 0).value.get() == empty_value
if submulti_: if submulti_:
assert cfg.config(conf).forcepermissive.option(pathread, 1).value.get() == SUBLIST_SECOND_VALUE[1] assert cfg_.forcepermissive.option(pathread, 1).value.get() == SUBLIST_SECOND_VALUE[1]
else: else:
assert cfg.config(conf).forcepermissive.option(pathread, 1).value.get() == LIST_SECOND_VALUE[1] assert cfg_.forcepermissive.option(pathread, 1).value.get() == LIST_SECOND_VALUE[1]
else: else:
raises(PropertiesOptionError, "assert cfg.config(conf).option(pathread, 0).value.get()") raises(PropertiesOptionError, "assert cfg_.option(pathread, 0).value.get()")
raises(PropertiesOptionError, "assert cfg.config(conf).option(pathread, 1).value.get()") raises(PropertiesOptionError, "assert cfg_.option(pathread, 1).value.get()")
raises(PropertiesOptionError, "assert cfg.config(conf).forcepermissive.option(pathread, 0).value.get()") raises(PropertiesOptionError, "assert cfg_.forcepermissive.option(pathread, 0).value.get()")
raises(PropertiesOptionError, "assert cfg.config(conf).forcepermissive.option(pathread, 1).value.get()") raises(PropertiesOptionError, "assert cfg_.forcepermissive.option(pathread, 1).value.get()")
else: else:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
assert cfg.config(conf).option(pathread).value.get() == first_value assert cfg_.option(pathread).value.get() == first_value
assert cfg.config(conf).forcepermissive.option(pathread).value.get() == first_value assert cfg_.forcepermissive.option(pathread).value.get() == first_value
elif kwargs.get('permissive', False): elif kwargs.get('permissive', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).value.get()") raises(PropertiesOptionError, "cfg_.option(pathread).value.get()")
assert cfg.config(conf).forcepermissive.option(pathread).value.get() == first_value assert cfg_.forcepermissive.option(pathread).value.get() == first_value
else: else:
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).value.get()") raises(PropertiesOptionError, "cfg_.option(pathread).value.get()")
raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread).value.get()") raises(PropertiesOptionError, "cfg_.forcepermissive.option(pathread).value.get()")
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
do(confread) do(confread)
if confread != confwrite: if confread != confwrite:
@ -515,8 +547,12 @@ def autocheck_value_follower(cfg, mcfg, pathread, pathwrite, confread, confwrite
empty_value = kwargs['default'] empty_value = kwargs['default']
def do(conf): def do(conf):
length = cfg.config(conf).option(pathread).value.len() if conf is not None:
assert cfg.config(conf).forcepermissive.option(pathread).value.len() == length cfg_ = cfg.config(conf)
else:
cfg_ = cfg
length = cfg_.option(pathread).value.len()
assert cfg_.forcepermissive.option(pathread).value.len() == length
assert length == 2 assert length == 2
do(confread) do(confread)
if confread != confwrite: if confread != confwrite:
@ -567,33 +603,41 @@ def autocheck_reset_value(cfg, mcfg, pathread, pathwrite, confread, confwrite, *
# reset value without permissive # reset value without permissive
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
if confwrite is not None:
cfg_ = cfg.config(confwrite)
else:
cfg_ = cfg
if not isfollower: if not isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
cfg.config(confwrite).option(pathwrite).value.reset() cfg_.option(pathwrite).value.reset()
#else: #else:
#FIXME raises(PropertiesOptionError, "cfg.config(confwrite).option(pathwrite).value.reset()") #FIXME raises(PropertiesOptionError, "cfg.config(confwrite).option(pathwrite).value.reset()")
else: else:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
cfg.config(confwrite).option(pathwrite, 0).value.reset() cfg_.option(pathwrite, 0).value.reset()
#else: #else:
#FIXME raises(PropertiesOptionError, "cfg.config(confwrite).option(pathwrite, 0).value.reset()") #FIXME raises(PropertiesOptionError, "cfg.config(confwrite).option(pathwrite, 0).value.reset()")
# get value after reset value without permissive # get value after reset value without permissive
def do(conf): def do(conf):
if confwrite is not None:
cfg_ = cfg.config(conf)
else:
cfg_ = cfg
if isfollower: if isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(pathread, 0).value.get() == empty_value assert cfg_.option(pathread, 0).value.get() == empty_value
assert cfg.config(conf).option(pathread, 1).value.get() == second_value[1] assert cfg_.option(pathread, 1).value.get() == second_value[1]
elif kwargs.get('permissive', False): elif kwargs.get('permissive', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathread, 0).value.get()") raises(PropertiesOptionError, "cfg_.option(pathread, 0).value.get()")
assert cfg.config(conf).forcepermissive.option(pathread, 0).value.get() == empty_value assert cfg_.forcepermissive.option(pathread, 0).value.get() == empty_value
assert cfg.config(conf).forcepermissive.option(pathread, 1).value.get() == second_value[1] assert cfg_.forcepermissive.option(pathread, 1).value.get() == second_value[1]
else: else:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(conf).option(pathread).value.get() == empty_value assert cfg_.option(pathread).value.get() == empty_value
elif kwargs.get('permissive', False): elif kwargs.get('permissive', False):
raises(PropertiesOptionError, "cfg.config(conf).option(pathread).value.get()") raises(PropertiesOptionError, "cfg_.option(pathread).value.get()")
assert cfg.config(conf).forcepermissive.option(pathread).value.get() == first_value assert cfg_.forcepermissive.option(pathread).value.get() == first_value
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
do(confread) do(confread)
if confread != confwrite: if confread != confwrite:
@ -606,16 +650,24 @@ def autocheck_append_value(cfg, mcfg, pathread, pathwrite, confread, confwrite,
submulti_ = cfg.unrestraint.option(pathread).option.issubmulti() submulti_ = cfg.unrestraint.option(pathread).option.issubmulti()
if not isleader: if not isleader:
return return
if confread is not None:
cfg_ = cfg.config(confread)
else:
cfg_ = cfg
if confwrite is not None:
cfg2_ = cfg.config(confwrite)
else:
cfg2_ = cfg
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
if not kwargs.get('propertyerror', False): if not kwargs.get('propertyerror', False):
leader_value = cfg.config(confread).forcepermissive.option(pathread).value.get() leader_value = cfg_.forcepermissive.option(pathread).value.get()
len_value = len(leader_value) len_value = len(leader_value)
leader_value.append(undefined) leader_value.append(undefined)
assert len(cfg.config(confread).forcepermissive.option(pathread).value.get()) == len_value assert len(cfg_.forcepermissive.option(pathread).value.get()) == len_value
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
cfg.forcepermissive.config(confwrite).option(pathread).value.set(leader_value) cfg2_.forcepermissive.option(pathread).value.set(leader_value)
new_leader_value = cfg.config(confread).forcepermissive.option(pathread).value.get() new_leader_value = cfg_.forcepermissive.option(pathread).value.get()
len_new = len(new_leader_value) len_new = len(new_leader_value)
assert len_value + 1 == len_new assert len_value + 1 == len_new
assert new_leader_value[-1] == kwargs['default_multi'] assert new_leader_value[-1] == kwargs['default_multi']
@ -625,16 +677,16 @@ def autocheck_append_value(cfg, mcfg, pathread, pathwrite, confread, confwrite,
else: else:
follower_path += '.third' follower_path += '.third'
for idx in range(len_new): for idx in range(len_new):
assert cfg.config(confread).forcepermissive.option(follower_path, idx).value.get() == kwargs['default_multi'] assert cfg_.forcepermissive.option(follower_path, idx).value.get() == kwargs['default_multi']
# #
if not submulti_: if not submulti_:
value = 'value' value = 'value'
else: else:
value = ['value'] value = ['value']
leader_value.append(value) leader_value.append(value)
assert len(cfg.config(confread).forcepermissive.option(pathread).value.get()) == len(new_leader_value) assert len(cfg_.forcepermissive.option(pathread).value.get()) == len(new_leader_value)
cfg.forcepermissive.config(confwrite).option(pathread).value.set(leader_value) cfg2_.forcepermissive.option(pathread).value.set(leader_value)
assert cfg.config(confread).forcepermissive.option(pathread).value.get()[-1] == value assert cfg_.forcepermissive.option(pathread).value.get()[-1] == value
@autocheck @autocheck
@ -644,6 +696,14 @@ def autocheck_pop_value(cfg, mcfg, pathread, pathwrite, confread, confwrite, **k
if not isleader: if not isleader:
return return
if confwrite is not None:
cfg_ = cfg.config(confwrite)
else:
cfg_ = cfg
if confread is not None:
cfg2_ = cfg.config(confread)
else:
cfg2_ = cfg
if not kwargs.get('propertyerror', False): if not kwargs.get('propertyerror', False):
if not submulti_: if not submulti_:
values = ['value1', 'value2', 'value3', 'value4'] values = ['value1', 'value2', 'value3', 'value4']
@ -658,34 +718,34 @@ def autocheck_pop_value(cfg, mcfg, pathread, pathwrite, confread, confwrite, **k
else: else:
a_follower += '.third' a_follower += '.third'
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
cfg.forcepermissive.config(confwrite).option(pathread).value.set(values) cfg_.forcepermissive.option(pathread).value.set(values)
cfg.forcepermissive.config(confwrite).option(a_follower, 1).value.set(follower_value) cfg_.forcepermissive.option(a_follower, 1).value.set(follower_value)
cfg.config(confread).forcepermissive.option(a_follower, 0).value.get() == kwargs['default_multi'] cfg2_.forcepermissive.option(a_follower, 0).value.get() == kwargs['default_multi']
assert cfg.config(confread).forcepermissive.option(a_follower, 0).owner.isdefault() is True assert cfg2_.forcepermissive.option(a_follower, 0).owner.isdefault() is True
cfg.config(confread).forcepermissive.option(a_follower, 1).value.get() == follower_value cfg2_.forcepermissive.option(a_follower, 1).value.get() == follower_value
assert cfg.config(confread).forcepermissive.option(a_follower, 1).owner.isdefault() is False assert cfg2_.forcepermissive.option(a_follower, 1).owner.isdefault() is False
cfg.config(confread).forcepermissive.option(a_follower, 2).value.get() == kwargs['default_multi'] cfg2_.forcepermissive.option(a_follower, 2).value.get() == kwargs['default_multi']
assert cfg.config(confread).forcepermissive.option(a_follower, 2).owner.isdefault() is True assert cfg2_.forcepermissive.option(a_follower, 2).owner.isdefault() is True
cfg.config(confread).forcepermissive.option(a_follower, 3).value.get() == kwargs['default_multi'] cfg2_.forcepermissive.option(a_follower, 3).value.get() == kwargs['default_multi']
assert cfg.config(confread).forcepermissive.option(a_follower, 3).owner.isdefault() is True assert cfg2_.forcepermissive.option(a_follower, 3).owner.isdefault() is True
# #
cfg.forcepermissive.config(confwrite).option(pathread).value.pop(3) cfg_.forcepermissive.option(pathread).value.pop(3)
cfg.config(confread).forcepermissive.option(a_follower, 0).value.get() == kwargs['default_multi'] cfg2_.forcepermissive.option(a_follower, 0).value.get() == kwargs['default_multi']
assert cfg.config(confread).forcepermissive.option(a_follower, 0).owner.isdefault() is True assert cfg2_.forcepermissive.option(a_follower, 0).owner.isdefault() is True
cfg.config(confread).forcepermissive.option(a_follower, 1).value.get() == follower_value cfg2_.forcepermissive.option(a_follower, 1).value.get() == follower_value
assert cfg.config(confread).forcepermissive.option(a_follower, 1).owner.isdefault() is False assert cfg2_.forcepermissive.option(a_follower, 1).owner.isdefault() is False
cfg.config(confread).forcepermissive.option(a_follower, 2).value.get() == kwargs['default_multi'] cfg2_.forcepermissive.option(a_follower, 2).value.get() == kwargs['default_multi']
assert cfg.config(confread).forcepermissive.option(a_follower, 2).owner.isdefault() is True assert cfg2_.forcepermissive.option(a_follower, 2).owner.isdefault() is True
# #
cfg.forcepermissive.config(confwrite).option(pathread).value.pop(0) cfg_.forcepermissive.option(pathread).value.pop(0)
cfg.config(confread).forcepermissive.option(a_follower, 0).value.get() == follower_value cfg2_.forcepermissive.option(a_follower, 0).value.get() == follower_value
assert cfg.config(confread).forcepermissive.option(a_follower, 0).owner.isdefault() is False assert cfg2_.forcepermissive.option(a_follower, 0).owner.isdefault() is False
cfg.config(confread).forcepermissive.option(a_follower, 1).value.get() == kwargs['default_multi'] cfg2_.forcepermissive.option(a_follower, 1).value.get() == kwargs['default_multi']
assert cfg.config(confread).forcepermissive.option(a_follower, 1).owner.isdefault() is True assert cfg2_.forcepermissive.option(a_follower, 1).owner.isdefault() is True
# #
cfg.forcepermissive.config(confwrite).option(pathread).value.pop(0) cfg_.forcepermissive.option(pathread).value.pop(0)
cfg.config(confread).forcepermissive.option(a_follower, 0).value.get() == kwargs['default_multi'] cfg2_.forcepermissive.option(a_follower, 0).value.get() == kwargs['default_multi']
assert cfg.config(confread).forcepermissive.option(a_follower, 0).owner.isdefault() is True assert cfg2_.forcepermissive.option(a_follower, 0).owner.isdefault() is True
@autocheck @autocheck
@ -697,12 +757,20 @@ def autocheck_reset_value_permissive(cfg, mcfg, pathread, pathwrite, confread, c
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
if not isfollower: if not isfollower:
cfg.forcepermissive.config(confwrite).option(pathwrite).value.reset() if confwrite is not None:
cfg_ = cfg.forcepermissive.config(confwrite)
else:
cfg_ = cfg.forcepermissive
cfg_.option(pathwrite).value.reset()
else: else:
cfg.forcepermissive.option(pathwrite, 1).value.reset() cfg.forcepermissive.option(pathwrite, 1).value.reset()
elif kwargs.get('permissive', False): elif kwargs.get('permissive', False):
if not isfollower: if not isfollower:
cfg.forcepermissive.config(confwrite).option(pathwrite).value.reset() if confwrite is not None:
cfg_ = cfg.forcepermissive.config(confwrite)
else:
cfg_ = cfg.forcepermissive
cfg_.option(pathwrite).value.reset()
else: else:
cfg.forcepermissive.option(pathwrite, 1).value.reset() cfg.forcepermissive.option(pathwrite, 1).value.reset()
#FIXME else: #FIXME else:
@ -723,13 +791,21 @@ def autocheck_display(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kwa
return return
make_dict = kwargs['make_dict'] make_dict = kwargs['make_dict']
make_dict_value = kwargs['make_dict_value'] make_dict_value = kwargs['make_dict_value']
assert cfg.config(confread).value.dict() == make_dict if confread is not None:
cfg_ = cfg.config(confread)
else:
cfg_ = cfg
if confwrite is not None:
cfg2_ = cfg.config(confwrite)
else:
cfg2_ = cfg
assert cfg_.value.dict() == make_dict
if confread != confwrite: if confread != confwrite:
assert(cfg.config(confwrite).value.dict()) == make_dict assert(cfg2_.value.dict()) == make_dict
_set_value(cfg, pathwrite, confwrite, **kwargs) _set_value(cfg, pathwrite, confwrite, **kwargs)
assert cfg.config(confread).value.dict() == make_dict_value assert cfg_.value.dict() == make_dict_value
if confread != confwrite: if confread != confwrite:
assert(cfg.config(confwrite).value.dict()) == make_dict_value assert(cfg2_.value.dict()) == make_dict_value
@autocheck @autocheck
@ -749,7 +825,11 @@ def autocheck_property(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kw
# set properties without permissive # set properties without permissive
for prop in properties: for prop in properties:
cfg.unrestraint.config(confwrite).option(pathwrite).property.add(prop) if confwrite is not None:
cfg_ = cfg.unrestraint.config(confwrite)
else:
cfg_ = cfg.unrestraint
cfg_.option(pathwrite).property.add(prop)
if confread == confwrite: if confread == confwrite:
_check_properties(cfg, mcfg, pathread, confread, kwargs, properties, properties) _check_properties(cfg, mcfg, pathread, confread, kwargs, properties, properties)
else: else:
@ -774,7 +854,11 @@ def autocheck_reset_property(cfg, mcfg, pathread, pathwrite, confread, confwrite
_property_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kwargs) _property_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kwargs)
# reset properties without permissive # reset properties without permissive
cfg.unrestraint.config(confwrite).option(pathwrite).property.reset() if confwrite is not None:
cfg_ = cfg.unrestraint.config(confwrite)
else:
cfg_ = cfg.unrestraint
cfg_.option(pathwrite).property.reset()
if confread == confwrite: if confread == confwrite:
_check_properties(cfg, mcfg, pathread, confread, kwargs, default_props, default_props) _check_properties(cfg, mcfg, pathread, confread, kwargs, default_props, default_props)
@ -819,22 +903,28 @@ def autocheck_default_owner_with_value(cfg, mcfg, pathread, pathwrite, confread,
isfollower = cfg.unrestraint.option(pathread).option.isfollower() isfollower = cfg.unrestraint.option(pathread).option.isfollower()
_set_value(cfg, pathwrite, confwrite, **kwargs) _set_value(cfg, pathwrite, confwrite, **kwargs)
if confwrite is not None:
cfg_ = cfg.config(confread)
cfg2_ = cfg.config(confwrite)
else:
cfg_ = cfg
cfg2_ = cfg
# test if is default owner without permissive # test if is default owner without permissive
if not isfollower: if not isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(confwrite).option(pathread).owner.isdefault() is False assert cfg_.option(pathread).owner.isdefault() is False
if confwrite != confread: if confwrite != confread:
assert cfg.config(confread).option(pathread).owner.isdefault() is False assert cfg2_.option(pathread).owner.isdefault() is False
#FIXME else: #FIXME else:
# raises(PropertiesOptionError, "cfg.config(confwrite).option(pathread).owner.isdefault()") # raises(PropertiesOptionError, "cfg.config(confwrite).option(pathread).owner.isdefault()")
# raises(PropertiesOptionError, "cfg.config(confread).option(pathread).owner.isdefault()") # raises(PropertiesOptionError, "cfg.config(confread).option(pathread).owner.isdefault()")
else: else:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert cfg.config(confwrite).option(pathread, 0).owner.isdefault() is True assert cfg2_.option(pathread, 0).owner.isdefault() is True
assert cfg.config(confwrite).option(pathread, 1).owner.isdefault() is False assert cfg2_.option(pathread, 1).owner.isdefault() is False
if confwrite != confread: if confwrite != confread:
assert cfg.config(confread).option(pathread, 0).owner.isdefault() is True assert cfg_.option(pathread, 0).owner.isdefault() is True
assert cfg.config(confread).option(pathread, 1).owner.isdefault() is False assert cfg_.option(pathread, 1).owner.isdefault() is False
#FIXME else: #FIXME else:
# raises(PropertiesOptionError, "cfg.config(confwrite).option(pathread, 0).owner.isdefault()") # raises(PropertiesOptionError, "cfg.config(confwrite).option(pathread, 0).owner.isdefault()")
# raises(PropertiesOptionError, "cfg.config(confread).option(pathread, 0).owner.isdefault()") # raises(PropertiesOptionError, "cfg.config(confread).option(pathread, 0).owner.isdefault()")
@ -849,12 +939,16 @@ def autocheck_default_owner_with_value_permissive(cfg, mcfg, pathread, pathwrite
def do(conf): def do(conf):
# test if is default owner with permissive # test if is default owner with permissive
if conf is not None:
cfg_ = cfg.config(conf)
else:
cfg_ = cfg
if not kwargs.get('propertyerror', False): if not kwargs.get('propertyerror', False):
if not isfollower: if not isfollower:
assert cfg.config(conf).forcepermissive.option(pathread).owner.isdefault() is False assert cfg_.forcepermissive.option(pathread).owner.isdefault() is False
else: else:
assert cfg.config(conf).forcepermissive.option(pathread, 0).owner.isdefault() is True assert cfg_.forcepermissive.option(pathread, 0).owner.isdefault() is True
assert cfg.config(conf).forcepermissive.option(pathread, 1).owner.isdefault() is False assert cfg_.forcepermissive.option(pathread, 1).owner.isdefault() is False
#FIXME else: #FIXME else:
# raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread).owner.isdefault()") # raises(PropertiesOptionError, "cfg.config(conf).forcepermissive.option(pathread).owner.isdefault()")
do(confwrite) do(confwrite)
@ -865,11 +959,15 @@ def autocheck_default_owner_with_value_permissive(cfg, mcfg, pathread, pathwrite
@autocheck @autocheck
def autocheck_set_owner_no_value(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kwargs): def autocheck_set_owner_no_value(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kwargs):
isfollower = cfg.unrestraint.option(pathread).option.isfollower() isfollower = cfg.unrestraint.option(pathread).option.isfollower()
if confwrite is not None:
cfg_ = cfg.forcepermissive.config(confwrite)
else:
cfg_ = cfg.forcepermissive
if not kwargs.get('propertyerror', False): if not kwargs.get('propertyerror', False):
if not isfollower: if not isfollower:
raises(ConfigError, "cfg.forcepermissive.config(confwrite).option(pathwrite).owner.set('new_user')") raises(ConfigError, "cfg_.option(pathwrite).owner.set('new_user')")
else: else:
raises(ConfigError, "cfg.forcepermissive.option(pathwrite, 1).owner.set('new_user')") raises(ConfigError, "cfg_.option(pathwrite, 1).owner.set('new_user')")
@autocheck @autocheck
@ -878,13 +976,17 @@ def autocheck_set_owner(cfg, mcfg, pathread, pathwrite, confread, confwrite, **k
isfollower = cfg.unrestraint.option(pathread).option.isfollower() isfollower = cfg.unrestraint.option(pathread).option.isfollower()
_set_value(cfg, pathwrite, confwrite, **kwargs) _set_value(cfg, pathwrite, confwrite, **kwargs)
if confwrite is not None:
cfg_ = cfg.config(confwrite)
else:
cfg_ = cfg
# set owner without permissive # set owner without permissive
if not isfollower: if not isfollower:
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
cfg.config(confwrite).option(pathwrite).owner.set('new_user') cfg_.option(pathwrite).owner.set('new_user')
raises(ValueError, "cfg.config(confwrite).option(pathwrite).owner.set('default')") raises(ValueError, "cfg_.option(pathwrite).owner.set('default')")
raises(ValueError, "cfg.config(confwrite).option(pathwrite).owner.set('forced')") raises(ValueError, "cfg_.option(pathwrite).owner.set('forced')")
#FIXME else: #FIXME else:
# raises(PropertiesOptionError, "cfg.config(confwrite).option(pathwrite).owner.set('new_user')") # raises(PropertiesOptionError, "cfg.config(confwrite).option(pathwrite).owner.set('new_user')")
else: else:
@ -903,11 +1005,15 @@ def autocheck_set_owner_permissive(cfg, mcfg, pathread, pathwrite, confread, con
isfollower = cfg.unrestraint.option(pathread).option.isfollower() isfollower = cfg.unrestraint.option(pathread).option.isfollower()
_set_value(cfg, pathwrite, confwrite, **kwargs) _set_value(cfg, pathwrite, confwrite, **kwargs)
if confwrite is not None:
cfg_ = cfg.forcepermissive.config(confwrite)
else:
cfg_ = cfg.forcepermissive
# set owner with permissive # set owner with permissive
if not kwargs.get('propertyerror', False): if not kwargs.get('propertyerror', False):
if not isfollower: if not isfollower:
cfg.forcepermissive.config(confwrite).option(pathwrite).owner.set('new_user1') cfg_.option(pathwrite).owner.set('new_user1')
else: else:
cfg.forcepermissive.option(pathwrite, 1).owner.set('new_user1') cfg.forcepermissive.option(pathwrite, 1).owner.set('new_user1')
#FIXME else: #FIXME else:
@ -961,9 +1067,17 @@ def autocheck_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **
"""test permissive for hidden and disabled value """test permissive for hidden and disabled value
""" """
# no permissive before # no permissive before
assert cfg.unrestraint.config(confwrite).option(pathread).permissive.get() == frozenset() if confwrite is not None:
cfg_ = cfg.unrestraint.config(confwrite)
else:
cfg_ = cfg.unrestraint
if confread is not None:
cfg2_ = cfg.config(confread).unrestraint
else:
cfg2_ = cfg.unrestraint
assert cfg_.option(pathread).permissive.get() == frozenset()
if kwargs.get('permissive_od', False): if kwargs.get('permissive_od', False):
assert cfg.unrestraint.config(confwrite).option(pathread.rsplit('.', 1)[0]).permissive.get() == frozenset() assert cfg_.option(pathread.rsplit('.', 1)[0]).permissive.get() == frozenset()
# cannot access to hidden value without forcepermissive # cannot access to hidden value without forcepermissive
# and to disabled value (with forcepermissive too) # and to disabled value (with forcepermissive too)
@ -972,17 +1086,17 @@ def autocheck_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **
_autocheck_default_value(cfg, pathread, confread, **kwargs) _autocheck_default_value(cfg, pathread, confread, **kwargs)
# set permissive # set permissive
cfg.unrestraint.config(confwrite).option(pathwrite).permissive.set(frozenset(['disabled'])) cfg_.option(pathwrite).permissive.set(frozenset(['disabled']))
callback = kwargs['callback'] callback = kwargs['callback']
if callback: if callback:
if pathread.endswith('val1') or pathread.endswith('val2'): if pathread.endswith('val1') or pathread.endswith('val2'):
call_path = pathread[:-4] + 'call' + pathread[-4:] call_path = pathread[:-4] + 'call' + pathread[-4:]
else: else:
call_path = pathread + 'call' call_path = pathread + 'call'
cfg.unrestraint.config(confwrite).option(call_path).permissive.set(frozenset(['disabled'])) cfg_.option(call_path).permissive.set(frozenset(['disabled']))
# have permissive? # have permissive?
assert cfg.unrestraint.config(confwrite).option(pathread).permissive.get() == frozenset(['disabled']) assert cfg_.option(pathread).permissive.get() == frozenset(['disabled'])
#if confwrite != confread: #if confwrite != confread:
# assert cfg.config(confread).unrestraint.option(pathread).permissive.get() == frozenset(['disabled']) # assert cfg.config(confread).unrestraint.option(pathread).permissive.get() == frozenset(['disabled'])
@ -991,9 +1105,9 @@ def autocheck_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **
ckwargs['propertyerror'] = False ckwargs['propertyerror'] = False
_autocheck_default_value(cfg, pathread, confwrite, **ckwargs) _autocheck_default_value(cfg, pathread, confwrite, **ckwargs)
cfg.config(confread).unrestraint.option(pathwrite).permissive.set(frozenset(['disabled', 'hidden'])) cfg2_.option(pathwrite).permissive.set(frozenset(['disabled', 'hidden']))
if kwargs['callback']: if kwargs['callback']:
cfg.config(confread).unrestraint.option(call_path).permissive.set(frozenset(['disabled', 'hidden'])) cfg2_.option(call_path).permissive.set(frozenset(['disabled', 'hidden']))
# can access to all value except when optiondescript have hidden # can access to all value except when optiondescript have hidden
if not ckwargs.get('permissive_od', False): if not ckwargs.get('permissive_od', False):
@ -1002,7 +1116,7 @@ def autocheck_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **
if ckwargs.get('permissive_od', False): if ckwargs.get('permissive_od', False):
# set permissive to OptionDescription # set permissive to OptionDescription
cfg.config(confread).unrestraint.option(pathwrite.rsplit('.', 1)[0]).permissive.set(frozenset(['disabled', cfg2_.option(pathwrite.rsplit('.', 1)[0]).permissive.set(frozenset(['disabled',
'hidden'])) 'hidden']))
ckwargs['permissive'] = False ckwargs['permissive'] = False
_autocheck_default_value(cfg, pathread, confread, **ckwargs) _autocheck_default_value(cfg, pathread, confread, **ckwargs)
@ -1010,23 +1124,23 @@ def autocheck_permissive(cfg, mcfg, pathread, pathwrite, confread, confwrite, **
# _autocheck_default_value(cfg, pathread, confwrite, **ckwargs) # _autocheck_default_value(cfg, pathread, confwrite, **ckwargs)
# only hidden # only hidden
cfg.config(confread).unrestraint.option(pathwrite).permissive.set(frozenset(['hidden'])) cfg2_.option(pathwrite).permissive.set(frozenset(['hidden']))
if callback: if callback:
cfg.config(confread).unrestraint.option(call_path).permissive.set(frozenset(['hidden'])) cfg2_.option(call_path).permissive.set(frozenset(['hidden']))
if ckwargs.get('permissive_od', False): if ckwargs.get('permissive_od', False):
_autocheck_default_value(cfg, pathread, confread, **ckwargs) _autocheck_default_value(cfg, pathread, confread, **ckwargs)
cfg.config(confread).unrestraint.option(pathwrite.rsplit('.', 1)[0]).permissive.set(frozenset(['hidden'])) cfg2_.option(pathwrite.rsplit('.', 1)[0]).permissive.set(frozenset(['hidden']))
ckwargs = copy(kwargs) ckwargs = copy(kwargs)
ckwargs['permissive'] = False ckwargs['permissive'] = False
_autocheck_default_value(cfg, pathread, confread, **ckwargs) _autocheck_default_value(cfg, pathread, confread, **ckwargs)
# no permissive # no permissive
cfg.config(confread).unrestraint.option(pathwrite).permissive.set(frozenset()) cfg2_.option(pathwrite).permissive.set(frozenset())
if callback: if callback:
cfg.config(confread).unrestraint.option(call_path).permissive.set(frozenset()) cfg2_.option(call_path).permissive.set(frozenset())
if ckwargs.get('permissive_od', False): if ckwargs.get('permissive_od', False):
_autocheck_default_value(cfg, pathread, confread, **ckwargs) _autocheck_default_value(cfg, pathread, confread, **ckwargs)
cfg.config(confread).unrestraint.option(pathwrite.rsplit('.', 1)[0]).permissive.set(frozenset()) cfg2_.option(pathwrite.rsplit('.', 1)[0]).permissive.set(frozenset())
_autocheck_default_value(cfg, pathread, confread, **kwargs) _autocheck_default_value(cfg, pathread, confread, **kwargs)
@ -1060,17 +1174,21 @@ def autocheck_find(cfg, mcfg, pathread, pathwrite, confread, confwrite, **kwargs
option = _getoption(cfg.unrestraint.option(pathread)) option = _getoption(cfg.unrestraint.option(pathread))
def do(conf): def do(conf):
if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False): if conf is not None:
assert option == _getoption(cfg.config(conf).option.find(name, first=True)) cfg_ = cfg.config(conf)
assert option == _getoption(cfg.config(conf).forcepermissive.option.find(name, first=True))
elif kwargs.get('permissive', False):
raises(AttributeError, "cfg.config(conf).option.find(name, first=True)")
assert option == _getoption(cfg.config(conf).forcepermissive.option.find(name, first=True))
else: else:
raises(AttributeError, "cfg.config(conf).option.find(name, first=True)") cfg_ = cfg
raises(AttributeError, "cfg.config(conf).forcepermissive.option.find(name, first=True)") if not kwargs.get('permissive', False) and not kwargs.get('propertyerror', False):
assert option == _getoption(cfg.config(conf).unrestraint.option.find(name, first=True)) assert option == _getoption(cfg_.option.find(name, first=True))
assert [option] == _getoptions(cfg.config(conf).unrestraint.option.find(name)) assert option == _getoption(cfg_.forcepermissive.option.find(name, first=True))
elif kwargs.get('permissive', False):
raises(AttributeError, "cfg_.option.find(name, first=True)")
assert option == _getoption(cfg_.forcepermissive.option.find(name, first=True))
else:
raises(AttributeError, "cfg_.option.find(name, first=True)")
raises(AttributeError, "cfg_.forcepermissive.option.find(name, first=True)")
assert option == _getoption(cfg_.unrestraint.option.find(name, first=True))
assert [option] == _getoptions(cfg_.unrestraint.option.find(name))
do(confread) do(confread)
if confread != confwrite: if confread != confwrite:
do(confwrite) do(confwrite)

View File

@ -264,6 +264,23 @@ def test_config_multi():
assert config.option('test3').value.get() == [2, 1] assert config.option('test3').value.get() == [2, 1]
def test_prefix_error():
i1 = IntOption('test1', '')
od = OptionDescription('test', '', [i1])
config = Config(od)
config.property.read_write()
config.option('test1').value.set(1)
try:
config.option('test1').value.set('yes')
except Exception as err:
assert str(err) == '"yes" is an invalid integer for "test1"'
try:
config.option('test1').value.set('yes')
except Exception as err:
err.prefix = ''
assert str(err) == 'invalid value'
def test_no_validation(): def test_no_validation():
i1 = IntOption('test1', '') i1 = IntOption('test1', '')
od = OptionDescription('test', '', [i1]) od = OptionDescription('test', '', [i1])

View File

@ -417,6 +417,7 @@ def test_mandatory_leader():
api = Config(descr) api = Config(descr)
api.property.read_only() api.property.read_only()
raises(PropertiesOptionError, "api.option('ip_admin_eth0.ip_admin_eth0').value.get()") raises(PropertiesOptionError, "api.option('ip_admin_eth0.ip_admin_eth0').value.get()")
raises(PropertiesOptionError, "api.value.dict()")
def test_mandatory_warnings_leader(): def test_mandatory_warnings_leader():

View File

@ -63,6 +63,12 @@ def test_unknown_config():
raises(ConfigError, "meta.config('unknown')") raises(ConfigError, "meta.config('unknown')")
def test_error_metaconfig():
od2 = make_description()
conf1 = Config(od2, session_id='conf1')
raises(TypeError, "MetaConfig([GroupConfig([conf1])], session_id='meta')")
def test_path(): def test_path():
meta = make_metaconfig() meta = make_metaconfig()
assert meta.config.path() == 'meta' assert meta.config.path() == 'meta'

View File

@ -98,6 +98,16 @@ def test_option_isoptiondescription():
assert not cfg.option('od.test').option.isoptiondescription() assert not cfg.option('od.test').option.isoptiondescription()
def test_option_double():
i = IntOption('test', '')
od = OptionDescription('od1', '', [i])
od = OptionDescription('od2', '', [od])
od = OptionDescription('od3', '', [od])
cfg = Config(od)
assert cfg.option('od2.od1.test').value.get() is None
assert cfg.option('od2').option('od1').option('test').value.get() is None
def test_option_multi(): def test_option_multi():
IntOption('test', '', multi=True) IntOption('test', '', multi=True)
IntOption('test', '', multi=True, default_multi=1) IntOption('test', '', multi=True, default_multi=1)
@ -227,3 +237,8 @@ def test_intoption():
def test_get_display_type(): def test_get_display_type():
i1 = IntOption('test1', 'description', min_number=3) i1 = IntOption('test1', 'description', min_number=3)
assert i1.get_display_type() == 'integer' assert i1.get_display_type() == 'integer'
def test_option_not_in_config():
i1 = IntOption('test1', 'description', min_number=3)
raises(AttributeError, "i1.impl_getpath()")

View File

@ -88,6 +88,24 @@ def test_consistency_warnings_only_more_option():
assert len(w) == 1 assert len(w) == 1
def test_consistency_error_prefix():
a = IntOption('a', '')
b = IntOption('b', '')
od = OptionDescription('od', '', [a, b])
a.impl_add_consistency('not_equal', b)
api = Config(od)
api.option('a').value.set(1)
try:
api.option('b').value.set(1)
except Exception as err:
assert str(err) == '"1" is an invalid integer for "b", must be different from the value of "a"'
try:
api.option('b').value.set(1)
except Exception as err:
err.prefix = ''
assert str(err) == 'must be different from the value of "a"'
def test_consistency_warnings_only_option(): def test_consistency_warnings_only_option():
a = IntOption('a', '') a = IntOption('a', '')
b = IntOption('b', '', warnings_only=True) b = IntOption('b', '', warnings_only=True)

View File

@ -1123,3 +1123,205 @@ def test_leadership_requires_no_leader():
raises(PropertiesOptionError, "api.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get()") raises(PropertiesOptionError, "api.option('ip_admin_eth0.netmask_admin_eth0', 0).value.get()")
raises(PropertiesOptionError, "api.option('ip_admin_eth0.netmask_admin_eth0', 1).value.get()") raises(PropertiesOptionError, "api.option('ip_admin_eth0.netmask_admin_eth0', 1).value.get()")
assert api.value.dict() == {'ip_admin_eth0.ip_admin_eth0': ['192.168.1.2', '192.168.1.1'], 'activate': False} assert api.value.dict() == {'ip_admin_eth0.ip_admin_eth0': ['192.168.1.2', '192.168.1.1'], 'activate': False}
def test_leadership_requires_complet():
optiontoto = StrOption('unicodetoto', "Unicode leader")
option = StrOption('unicode', "Unicode leader", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Values 'test' must show 'Unicode follower 3'", multi=True)
option3 = StrOption('unicode3', "Unicode follower 3", requires=[{'option': option,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
option4 = StrOption('unicode4', "Unicode follower 4", requires=[{'option': option2,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
option5 = StrOption('unicode5', "Unicode follower 5", requires=[{'option': optiontoto,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
option6 = StrOption('unicode6', "Unicode follower 6", requires=[{'option': optiontoto,
'expected': u'test',
'action': 'hidden',
'inverse': True},
{'option': option2,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
option7 = StrOption('unicode7', "Unicode follower 7", requires=[{'option': option2,
'expected': u'test',
'action': 'hidden',
'inverse': True},
{'option': optiontoto,
'expected': u'test',
'action': 'hidden',
'inverse': True}],
multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3, option4, option5, option6, option7])
descr = OptionDescription("options", "Common configuration 2", [descr1, optiontoto])
descr = OptionDescription("unicode1_leadership_requires", "Leader followers with Unicode follower 3 hidden when Unicode follower 2 is test", [descr])
config = Config(descr)
config.property.read_write()
config.option('options.unicode.unicode').value.set(['test', 'trah'])
config.option('options.unicode.unicode2', 0).value.set('test')
dico = config.value.dict()
assert dico.keys() == set(['options.unicode.unicode', 'options.unicode.unicode1', 'options.unicode.unicode2', 'options.unicode.unicode3', 'options.unicode.unicode4', 'options.unicodetoto'])
assert dico['options.unicode.unicode'] == ['test', 'trah']
assert dico['options.unicode.unicode1'] == [None, None]
assert dico['options.unicode.unicode2'] == ['test', None]
assert dico['options.unicode.unicode3'][0] is None
assert isinstance(dico['options.unicode.unicode3'][1], PropertiesOptionError)
assert dico['options.unicode.unicode4'][0] is None
assert isinstance(dico['options.unicode.unicode4'][1], PropertiesOptionError)
assert dico['options.unicodetoto'] is None
del dico['options.unicode.unicode3'][1]
del dico['options.unicode.unicode3']
del dico['options.unicode.unicode4'][1]
del dico['options.unicode.unicode4']
#
config.option('options.unicodetoto').value.set('test')
dico = config.value.dict()
assert dico.keys() == set(['options.unicode.unicode', 'options.unicode.unicode1', 'options.unicode.unicode2', 'options.unicode.unicode3', 'options.unicode.unicode4', 'options.unicode.unicode5', 'options.unicode.unicode6', 'options.unicode.unicode7', 'options.unicodetoto'])
assert dico['options.unicode.unicode'] == ['test', 'trah']
assert dico['options.unicode.unicode1'] == [None, None]
assert dico['options.unicode.unicode2'] == ['test', None]
assert dico['options.unicode.unicode3'][0] is None
assert isinstance(dico['options.unicode.unicode3'][1], PropertiesOptionError)
assert dico['options.unicode.unicode4'][0] is None
assert isinstance(dico['options.unicode.unicode4'][1], PropertiesOptionError)
assert dico['options.unicode.unicode5'] == [None, None]
assert dico['options.unicode.unicode6'][0] is None
assert isinstance(dico['options.unicode.unicode6'][1], PropertiesOptionError)
assert dico['options.unicode.unicode7'][0] is None
assert isinstance(dico['options.unicode.unicode7'][1], PropertiesOptionError)
assert dico['options.unicodetoto'] == 'test'
del dico['options.unicode.unicode3'][1]
del dico['options.unicode.unicode3']
del dico['options.unicode.unicode4'][1]
del dico['options.unicode.unicode4']
del dico['options.unicode.unicode6'][1]
del dico['options.unicode.unicode6']
del dico['options.unicode.unicode7'][1]
del dico['options.unicode.unicode7']
def test_leadership_requires_transitive():
optiontoto = StrOption('unicodetoto', "Unicode leader")
option = StrOption('unicode', "Unicode leader", multi=True)
option1 = StrOption('unicode1', "Unicode follower 1", multi=True)
option2 = StrOption('unicode2', "Unicode follower 2", requires=[{'option': optiontoto,
'expected': u'test',
'action': 'disabled',
'transitive': True,
'inverse': True}],
multi=True)
option3 = StrOption('unicode3', "Unicode follower 3", requires=[{'option': option2,
'expected': u'test',
'action': 'disabled',
'transitive': True,
'inverse': True}],
multi=True)
option4 = StrOption('unicode4', "Unicode follower 4", requires=[{'option': option3,
'expected': u'test',
'action': 'disabled',
'transitive': True,
'inverse': True}],
multi=True)
descr1 = Leadership("unicode", "Common configuration 1",
[option, option1, option2, option3, option4])
descr = OptionDescription("options", "Common configuration 2", [descr1, optiontoto])
descr = OptionDescription("unicode1", "", [descr])
config = Config(descr)
config.property.read_write()
assert config.value.dict() == {'options.unicode.unicode': [], 'options.unicode.unicode1': [], 'options.unicode.unicode3': [], 'options.unicode.unicode4': [], 'options.unicodetoto': None}
#
config.option('options.unicodetoto').value.set('test')
assert config.value.dict() == {'options.unicode.unicode': [], 'options.unicode.unicode1': [], 'options.unicode.unicode2': [], 'options.unicode.unicode3': [], 'options.unicode.unicode4': [], 'options.unicodetoto': 'test'}
#
config.option('options.unicode.unicode').value.set(['a', 'b', 'c'])
dico = config.value.dict()
assert list(dico.keys()) == ['options.unicode.unicode', 'options.unicode.unicode1', 'options.unicode.unicode2', 'options.unicode.unicode3', 'options.unicode.unicode4', 'options.unicodetoto']
assert dico['options.unicodetoto'] == 'test'
assert dico['options.unicode.unicode'] == ['a', 'b', 'c']
assert dico['options.unicode.unicode1'] == [None, None, None]
assert dico['options.unicode.unicode2'] == [None, None, None]
assert isinstance(dico['options.unicode.unicode3'][0], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode3'][1], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode3'][2], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][0], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][1], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][2], PropertiesOptionError)
del (dico['options.unicode.unicode3'][2])
del (dico['options.unicode.unicode3'][1])
del (dico['options.unicode.unicode3'][0])
del (dico['options.unicode.unicode4'][2])
del (dico['options.unicode.unicode4'][1])
del (dico['options.unicode.unicode4'][0])
#
config.option('options.unicode.unicode2', 1).value.set('test')
config.option('options.unicode.unicode3', 1).value.set('test')
dico = config.value.dict()
assert list(dico.keys()) == ['options.unicode.unicode', 'options.unicode.unicode1', 'options.unicode.unicode2', 'options.unicode.unicode3', 'options.unicode.unicode4', 'options.unicodetoto']
assert dico['options.unicodetoto'] == 'test'
assert dico['options.unicode.unicode'] == ['a', 'b', 'c']
assert dico['options.unicode.unicode1'] == [None, None, None]
assert dico['options.unicode.unicode2'] == [None, 'test', None]
assert isinstance(dico['options.unicode.unicode3'][0], PropertiesOptionError)
assert dico['options.unicode.unicode3'][1] == 'test'
assert isinstance(dico['options.unicode.unicode3'][2], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][0], PropertiesOptionError)
assert dico['options.unicode.unicode4'][1] == None
assert isinstance(dico['options.unicode.unicode4'][2], PropertiesOptionError)
del (dico['options.unicode.unicode3'][2])
del (dico['options.unicode.unicode3'][1])
del (dico['options.unicode.unicode3'][0])
del (dico['options.unicode.unicode4'][2])
del (dico['options.unicode.unicode4'][1])
del (dico['options.unicode.unicode4'][0])
#
config.option('options.unicode.unicode2', 1).value.set('rah')
dico = config.value.dict()
assert list(dico.keys()) == ['options.unicode.unicode', 'options.unicode.unicode1', 'options.unicode.unicode2', 'options.unicode.unicode3', 'options.unicode.unicode4', 'options.unicodetoto']
assert dico['options.unicodetoto'] == 'test'
assert dico['options.unicode.unicode'] == ['a', 'b', 'c']
assert dico['options.unicode.unicode1'] == [None, None, None]
assert dico['options.unicode.unicode2'] == [None, 'rah', None]
assert isinstance(dico['options.unicode.unicode3'][0], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode3'][1], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode3'][2], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][0], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][1], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][2], PropertiesOptionError)
del (dico['options.unicode.unicode3'][2])
del (dico['options.unicode.unicode3'][1])
del (dico['options.unicode.unicode3'][0])
del (dico['options.unicode.unicode4'][2])
del (dico['options.unicode.unicode4'][1])
del (dico['options.unicode.unicode4'][0])
#
config.option('options.unicode.unicode2', 1).value.set('test')
config.option('options.unicodetoto').value.set('rah')
dico = config.value.dict()
assert list(dico.keys()) == ['options.unicode.unicode', 'options.unicode.unicode1', 'options.unicode.unicode3', 'options.unicode.unicode4', 'options.unicodetoto']
assert dico['options.unicodetoto'] == 'rah'
assert dico['options.unicode.unicode'] == ['a', 'b', 'c']
assert dico['options.unicode.unicode1'] == [None, None, None]
assert isinstance(dico['options.unicode.unicode3'][0], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode3'][1], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode3'][2], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][0], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][1], PropertiesOptionError)
assert isinstance(dico['options.unicode.unicode4'][2], PropertiesOptionError)
del (dico['options.unicode.unicode3'][2])
del (dico['options.unicode.unicode3'][1])
del (dico['options.unicode.unicode3'][0])
del (dico['options.unicode.unicode4'][2])
del (dico['options.unicode.unicode4'][1])
del (dico['options.unicode.unicode4'][0])

View File

@ -203,6 +203,20 @@ class _TiramisuOptionOptionDescription(CommonTiramisuOption):
settings.get_context_properties(), settings.get_context_properties(),
settings.get_context_properties()) settings.get_context_properties())
def __call__(self,
path: str,
index: Optional[int]=None) -> 'TiramisuOption':
"""Select an option by path"""
subpath = self._option_bag.option.impl_getname() + '.' + path
subconfig, name = self._subconfig.cfgimpl_get_home_by_path(subpath,
self._option_bag.config_bag)
path = self._option_bag.path + '.' + path
return TiramisuOption(name,
path,
index,
subconfig,
self._option_bag.config_bag)
class _TiramisuOptionOption(_TiramisuOptionOptionDescription): class _TiramisuOptionOption(_TiramisuOptionOptionDescription):
"""Manage option""" """Manage option"""
@ -738,17 +752,9 @@ class TiramisuOption(CommonTiramisuOption):
subconfig=subconfig, subconfig=subconfig,
config_bag=config_bag) config_bag=config_bag)
#__________________________________________________________________________________________________ #__________________________________________________________________________________________________
# #
# First part of API:
# - contexts informations:
# - context owner
# - context information
# - context property
# - context permissive
# - forcepermissive
# - unrestraint
# - manage MetaConfig or GroupConfig
class TiramisuContext(TiramisuHelp): class TiramisuContext(TiramisuHelp):

View File

@ -1198,12 +1198,13 @@ class KernelMetaConfig(KernelMixConfig):
if not isinstance(child, _CommonConfig): if not isinstance(child, _CommonConfig):
try: try:
child = child._config child = child._config
except: except Exception:
raise TypeError(_("{}config's children " raise TypeError(_("{}config's children "
"should be config, not {}" "should be config, not {}"
).format(self.impl_type, ).format(self.impl_type,
type(child))) type(child)))
if not isinstance(child, (KernelConfig, KernelMetaConfig)): if __debug__ and not isinstance(child, (KernelConfig,
KernelMetaConfig)):
raise TypeError(_("child must be a Config or MetaConfig")) raise TypeError(_("child must be a Config or MetaConfig"))
if descr is None: if descr is None:
descr = child.cfgimpl_get_description() descr = child.cfgimpl_get_description()

View File

@ -397,7 +397,10 @@ class BaseOption(Base):
super(BaseOption, self).__setattr__(name, value) super(BaseOption, self).__setattr__(name, value)
def impl_getpath(self) -> str: def impl_getpath(self) -> str:
try:
return self._path return self._path
except AttributeError:
raise AttributeError(_('"{}" not part of any Config').format(self.impl_get_display_name()))
def impl_has_callback(self) -> bool: def impl_has_callback(self) -> bool:
"to know if a callback has been defined or not" "to know if a callback has been defined or not"

View File

@ -19,6 +19,7 @@
# the whole pypy projet is under MIT licence # the whole pypy projet is under MIT licence
# ____________________________________________________________ # ____________________________________________________________
from ipaddress import ip_interface, ip_network from ipaddress import ip_interface, ip_network
from typing import List
from ..error import ConfigError from ..error import ConfigError
from ..setting import undefined, OptionBag, Undefined from ..setting import undefined, OptionBag, Undefined
@ -49,57 +50,56 @@ class NetmaskOption(StrOption):
raise ValueError() raise ValueError()
def _cons_network_netmask(self, def _cons_network_netmask(self,
current_opt, current_opt: Option,
opts, opts: List[Option],
vals, vals: List[str],
warnings_only, warnings_only: bool,
context): context: 'Config'):
#opts must be (netmask, network) options
if context is undefined and len(vals) != 2: if context is undefined and len(vals) != 2:
raise ConfigError(_('network_netmask needs a network and a netmask')) raise ConfigError(_('network_netmask needs a network and a netmask'))
if None in vals or len(vals) != 2: if None in vals or len(vals) != 2:
return return
val_netmask, val_network = vals val_netmask, val_network = vals
opt_netmask, opt_network = opts
try: try:
ip_network('{0}/{1}'.format(val_network, val_netmask)) ip_network('{0}/{1}'.format(val_network, val_netmask))
except ValueError: except ValueError:
if current_opt == opts[1]: if current_opt == opt_network:
raise ValueError(_('with netmask "{0}" ("{1}")').format(val_netmask, raise ValueError(_('with netmask "{0}" ("{1}")').format(val_netmask,
opts[0].impl_get_display_name())) opt_netmask.impl_get_display_name()))
else: else:
raise ValueError(_('with network "{0}" ("{1}")').format(val_network, raise ValueError(_('with network "{0}" ("{1}")').format(val_network,
opts[1].impl_get_display_name())) opt_network.impl_get_display_name()))
def _cons_ip_netmask(self, def _cons_ip_netmask(self,
current_opt, current_opt: Option,
opts, opts: List[Option],
vals, vals: List[str],
warnings_only, warnings_only: bool,
context, context: 'config',
_cidr=False): _cidr: bool=False):
# opts must be (netmask, ip) options
if context is undefined and len(vals) != 2: if context is undefined and len(vals) != 2:
raise ConfigError(_('ip_netmask needs an IP and a netmask')) raise ConfigError(_('ip_netmask needs an IP and a netmask'))
if None in vals or len(vals) != 2: if None in vals or len(vals) != 2:
return return
msg = None
val_netmask, val_ip = vals val_netmask, val_ip = vals
opt_netmask, opt_ip = opts
ip = ip_interface('{0}/{1}'.format(val_ip, val_netmask)) ip = ip_interface('{0}/{1}'.format(val_ip, val_netmask))
network = ip.network if not _cidr and current_opt == opt_ip:
if ip.ip == network.network_address: if ip.ip == ip.network.network_address:
if not _cidr and current_opt == opts[1]: raise ValueError( _('this is a network with netmask "{0}" ("{1}")'
msg = _('this is a network with netmask "{0}" ("{1}")') '').format(val_netmask,
opt_netmask.impl_get_display_name()))
elif ip.ip == ip.network.broadcast_address:
raise ValueError(_('this is a broadcast with netmask "{0}" ("{1}")'
'').format(val_netmask,
opt_netmask.impl_get_display_name()))
else: else:
msg = _('IP "{0}" ("{1}") is the network') if ip.ip == ip.network.network_address:
elif ip.ip == network.broadcast_address: raise ValueError(_('IP "{0}" ("{1}") is the network'
if not _cidr and current_opt == opts[1]: '').format(val_ip,
msg = _('this is a broadcast with netmask "{0}" ("{1}")') opt_ip.impl_get_display_name()))
else: elif ip.ip == ip.network.broadcast_address:
msg = _('IP "{0}" ("{1}") is the broadcast') raise ValueError(_('IP "{0}" ("{1}") is the broadcast'
if msg is not None: '').format(val_ip,
if not _cidr and current_opt == opts[1]: opt_ip.impl_get_display_name()))
raise ValueError(msg.format(val_netmask,
opts[0].impl_get_display_name()))
else:
raise ValueError(msg.format(val_ip,
opts[1].impl_get_display_name()))

View File

@ -388,13 +388,13 @@ class Option(BaseOption):
def impl_is_leader(self): def impl_is_leader(self):
leadership = self.impl_get_leadership() leadership = self.impl_get_leadership()
if leadership is None: if leadership is None:
return leadership return False
return self.impl_get_leadership().is_leader(self) return leadership.is_leader(self)
def impl_is_follower(self): def impl_is_follower(self):
leadership = self.impl_get_leadership() leadership = self.impl_get_leadership()
if leadership is None: if leadership is None:
return leadership return False
return not leadership.is_leader(self) return not leadership.is_leader(self)
def impl_get_leadership(self): def impl_get_leadership(self):

View File

@ -523,6 +523,10 @@ class Settings(object):
is_indexed = False is_indexed = False
if option.impl_is_follower(): if option.impl_is_follower():
idx = option_bag.index idx = option_bag.index
if idx is None:
continue
elif option.impl_is_leader() and option_bag.index is None:
continue
elif option.impl_is_multi() and option_bag.index is not None: elif option.impl_is_multi() and option_bag.index is not None:
is_indexed = True is_indexed = True
config_bag = option_bag.config_bag.copy() config_bag = option_bag.config_bag.copy()

View File

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Tiramisu\n" "Project-Id-Version: Tiramisu\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-25 08:47+CET\n" "POT-Creation-Date: 2019-03-05 08:46+CET\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: Emmanuel Garette <egarette@cadoles.com>\n" "Last-Translator: Emmanuel Garette <egarette@cadoles.com>\n"
"Language-Team: Tiramisu's team <egarette@cadoles.com>\n" "Language-Team: Tiramisu's team <egarette@cadoles.com>\n"
@ -53,35 +53,35 @@ msgstr "l'index est obligatoire pour l'option suiveuse \"{}\""
msgid "unknown method {}" msgid "unknown method {}"
msgstr "méthode {} inconnue" msgstr "méthode {} inconnue"
#: tiramisu/api.py:346 #: tiramisu/api.py:360
msgid "cannot add this property: \"{0}\"" msgid "cannot add this property: \"{0}\""
msgstr "ne peut pas ajouter cette propriété : \"{0}\"" msgstr "ne peut pas ajouter cette propriété : \"{0}\""
#: tiramisu/api.py:489 tiramisu/config.py:252 #: tiramisu/api.py:503 tiramisu/config.py:252
msgid "can't delete a SymLinkOption" msgid "can't delete a SymLinkOption"
msgstr "ne peut supprimer une valeur à une SymLinkOption" msgstr "ne peut supprimer une valeur à une SymLinkOption"
#: tiramisu/api.py:622 tiramisu/api.py:1316 #: tiramisu/api.py:636 tiramisu/api.py:1322
msgid "please specify a valid sub function ({})" msgid "please specify a valid sub function ({})"
msgstr "veuillez spécifier une sous fonction valide ({})" msgstr "veuillez spécifier une sous fonction valide ({})"
#: tiramisu/api.py:685 tiramisu/api.py:1139 #: tiramisu/api.py:699 tiramisu/api.py:1145
msgid "unknown list type {}" msgid "unknown list type {}"
msgstr "type de liste inconnue {}" msgstr "type de liste inconnue {}"
#: tiramisu/api.py:687 tiramisu/api.py:1141 #: tiramisu/api.py:701 tiramisu/api.py:1147
msgid "unknown group_type: {0}" msgid "unknown group_type: {0}"
msgstr "group_type inconnu: {0}" msgstr "group_type inconnu: {0}"
#: tiramisu/api.py:968 #: tiramisu/api.py:974
msgid "properties must be a set" msgid "properties must be a set"
msgstr "une propriété doit être de type set" msgstr "une propriété doit être de type set"
#: tiramisu/api.py:974 tiramisu/api.py:996 #: tiramisu/api.py:980 tiramisu/api.py:1002
msgid "unknown when {} (must be in append or remove)" msgid "unknown when {} (must be in append or remove)"
msgstr "value {} inconsistent (doit être append ou remove)" msgstr "value {} inconsistent (doit être append ou remove)"
#: tiramisu/api.py:986 tiramisu/api.py:1008 tiramisu/config.py:1226 #: tiramisu/api.py:992 tiramisu/api.py:1014 tiramisu/config.py:1227
msgid "unknown type {}" msgid "unknown type {}"
msgstr "type inconnu {}" msgstr "type inconnu {}"
@ -221,20 +221,20 @@ msgid "MetaConfig with optiondescription must have string has child, not {}"
msgstr "" msgstr ""
"MetaConfig avec une optiondescription doit avoir un nom comme enfant, pas {}" "MetaConfig avec une optiondescription doit avoir un nom comme enfant, pas {}"
#: tiramisu/config.py:1207 #: tiramisu/config.py:1208
msgid "child must be a Config or MetaConfig" msgid "child must be a Config or MetaConfig"
msgstr "enfant doit être une une Config ou une MetaConfig" msgstr "enfant doit être une une Config ou une MetaConfig"
#: tiramisu/config.py:1211 #: tiramisu/config.py:1212
msgid "all config in metaconfig must have the same optiondescription" msgid "all config in metaconfig must have the same optiondescription"
msgstr "" msgstr ""
"toutes les configs d'une metaconfig doivent avoir la même optiondescription" "toutes les configs d'une metaconfig doivent avoir la même optiondescription"
#: tiramisu/config.py:1224 #: tiramisu/config.py:1225
msgid "config name must be uniq in groupconfig for {0}" msgid "config name must be uniq in groupconfig for {0}"
msgstr "le nom de la config doit être unique dans un groupconfig pour {0}" msgstr "le nom de la config doit être unique dans un groupconfig pour {0}"
#: tiramisu/config.py:1249 #: tiramisu/config.py:1250
msgid "cannot find the config {}" msgid "cannot find the config {}"
msgstr "ne peut pas trouver la config {0}" msgstr "ne peut pas trouver la config {0}"
@ -250,11 +250,11 @@ msgstr "ou"
msgid " {} " msgid " {} "
msgstr " {} " msgstr " {} "
#: tiramisu/error.py:103 tiramisu/setting.py:559 #: tiramisu/error.py:103 tiramisu/setting.py:563
msgid "property" msgid "property"
msgstr "de la propriété" msgstr "de la propriété"
#: tiramisu/error.py:105 tiramisu/setting.py:561 #: tiramisu/error.py:105 tiramisu/setting.py:565
msgid "properties" msgid "properties"
msgstr "des propriétés" msgstr "des propriétés"
@ -349,11 +349,15 @@ msgstr "l'attribut {2} de l'objet '{0}' ({1}) est en lecture seule"
msgid "\"{}\" ({}) object attribute \"{}\" is read-only" msgid "\"{}\" ({}) object attribute \"{}\" is read-only"
msgstr "\"{}\" ({}) l'attribut de l'objet \"{}\" est en lecture seule" msgstr "\"{}\" ({}) l'attribut de l'objet \"{}\" est en lecture seule"
#: tiramisu/option/baseoption.py:447 #: tiramisu/option/baseoption.py:403
msgid "\"{}\" not part of any Config"
msgstr "\"{}\" ne fait pas parti d'une Config"
#: tiramisu/option/baseoption.py:450
msgid "malformed requirements must be an option in option {0}" msgid "malformed requirements must be an option in option {0}"
msgstr "requirements mal formés doit être une option dans l'option {0}" msgstr "requirements mal formés doit être une option dans l'option {0}"
#: tiramisu/option/baseoption.py:450 #: tiramisu/option/baseoption.py:453
msgid "" msgid ""
"malformed requirements multi option must not set as requires of non multi " "malformed requirements multi option must not set as requires of non multi "
"option {0}" "option {0}"
@ -361,59 +365,59 @@ msgstr ""
"requirements mal formés une option multiple ne doit pas être spécifié comme " "requirements mal formés une option multiple ne doit pas être spécifié comme "
"pré-requis à l'option non multiple {0}" "pré-requis à l'option non multiple {0}"
#: tiramisu/option/baseoption.py:483 #: tiramisu/option/baseoption.py:486
msgid "" msgid ""
"malformed requirements expected must have option and value for option {0}" "malformed requirements expected must have option and value for option {0}"
msgstr "" msgstr ""
"expected mal formés pour le requirements, doit avoir une option et une " "expected mal formés pour le requirements, doit avoir une option et une "
"valeur pour l'option {0}" "valeur pour l'option {0}"
#: tiramisu/option/baseoption.py:490 tiramisu/option/baseoption.py:506 #: tiramisu/option/baseoption.py:493 tiramisu/option/baseoption.py:509
msgid "malformed requirements expected value must be valid for option {0}: {1}" msgid "malformed requirements expected value must be valid for option {0}: {1}"
msgstr "" msgstr ""
"valeur de \"expected\" malformé, doit être valide pour l'option {0} : {1}" "valeur de \"expected\" malformé, doit être valide pour l'option {0} : {1}"
#: tiramisu/option/baseoption.py:520 #: tiramisu/option/baseoption.py:523
msgid "" msgid ""
"malformed requirements for option: {0} action cannot be force_store_value" "malformed requirements for option: {0} action cannot be force_store_value"
msgstr "" msgstr ""
"requirements mal formés pour l'option : {0} action ne peut pas être " "requirements mal formés pour l'option : {0} action ne peut pas être "
"force_store_value" "force_store_value"
#: tiramisu/option/baseoption.py:528 #: tiramisu/option/baseoption.py:531
msgid "malformed requirements for option: {0} inverse must be boolean" msgid "malformed requirements for option: {0} inverse must be boolean"
msgstr "" msgstr ""
"requirements mal formés pour l'option : {0} inverse doit être un booléen" "requirements mal formés pour l'option : {0} inverse doit être un booléen"
#: tiramisu/option/baseoption.py:535 #: tiramisu/option/baseoption.py:538
msgid "malformed requirements for option: {0} transitive must be boolean" msgid "malformed requirements for option: {0} transitive must be boolean"
msgstr "" msgstr ""
"requirements mal formés pour l'option : {0} transitive doit être booléen" "requirements mal formés pour l'option : {0} transitive doit être booléen"
#: tiramisu/option/baseoption.py:542 #: tiramisu/option/baseoption.py:545
msgid "malformed requirements for option: {0} same_action must be boolean" msgid "malformed requirements for option: {0} same_action must be boolean"
msgstr "" msgstr ""
"requirements mal formés pour l'option : {0} same_action doit être un booléen" "requirements mal formés pour l'option : {0} same_action doit être un booléen"
#: tiramisu/option/baseoption.py:549 #: tiramisu/option/baseoption.py:552
msgid "" msgid ""
"malformed requirements for option: \"{0}\" operator must be \"or\" or \"and\"" "malformed requirements for option: \"{0}\" operator must be \"or\" or \"and\""
msgstr "" msgstr ""
"requirements mal formés pour l'option : \"{0}\" l'opérateur doit être \"or\" " "requirements mal formés pour l'option : \"{0}\" l'opérateur doit être \"or\" "
"ou \"and\"" "ou \"and\""
#: tiramisu/option/baseoption.py:561 #: tiramisu/option/baseoption.py:564
msgid "malformed requirements type for option: {0}, must be a dict" msgid "malformed requirements type for option: {0}, must be a dict"
msgstr "" msgstr ""
"type requirements malformé pour l'option : {0}, doit être un dictionnaire" "type requirements malformé pour l'option : {0}, doit être un dictionnaire"
#: tiramisu/option/baseoption.py:567 #: tiramisu/option/baseoption.py:570
msgid "malformed requirements for option: {0} unknown keys {1}, must only {2}" msgid "malformed requirements for option: {0} unknown keys {1}, must only {2}"
msgstr "" msgstr ""
"requirements mal formés pour l'option : {0} clefs inconnues {1}, doit " "requirements mal formés pour l'option : {0} clefs inconnues {1}, doit "
"seulement avoir {2}" "seulement avoir {2}"
#: tiramisu/option/baseoption.py:576 #: tiramisu/option/baseoption.py:579
msgid "" msgid ""
"malformed requirements for option: {0} require must have option, expected " "malformed requirements for option: {0} require must have option, expected "
"and action keys" "and action keys"
@ -431,7 +435,7 @@ msgstr "adresse broadcast"
#: tiramisu/option/broadcastoption.py:38 tiramisu/option/dateoption.py:37 #: tiramisu/option/broadcastoption.py:38 tiramisu/option/dateoption.py:37
#: tiramisu/option/domainnameoption.py:113 tiramisu/option/ipoption.py:77 #: tiramisu/option/domainnameoption.py:113 tiramisu/option/ipoption.py:77
#: tiramisu/option/netmaskoption.py:40 tiramisu/option/networkoption.py:67 #: tiramisu/option/netmaskoption.py:41 tiramisu/option/networkoption.py:67
#: tiramisu/option/passwordoption.py:38 tiramisu/option/portoption.py:106 #: tiramisu/option/passwordoption.py:38 tiramisu/option/portoption.py:106
#: tiramisu/option/urloption.py:40 #: tiramisu/option/urloption.py:40
msgid "invalid string" msgid "invalid string"
@ -653,7 +657,7 @@ msgstr ""
"requirement mal formé pour l'option \"{0}\" ne doit pas être dans une " "requirement mal formé pour l'option \"{0}\" ne doit pas être dans une "
"suiveuse pour \"{1}\"" "suiveuse pour \"{1}\""
#: tiramisu/option/netmaskoption.py:33 #: tiramisu/option/netmaskoption.py:34
msgid "netmask address" msgid "netmask address"
msgstr "adresse netmask" msgstr "adresse netmask"
@ -661,11 +665,11 @@ msgstr "adresse netmask"
msgid "network_netmask needs a network and a netmask" msgid "network_netmask needs a network and a netmask"
msgstr "network_netmask nécessite un réseau et un masque de réseau" msgstr "network_netmask nécessite un réseau et un masque de réseau"
#: tiramisu/option/netmaskoption.py:67 #: tiramisu/option/netmaskoption.py:68
msgid "with netmask \"{0}\" (\"{1}\")" msgid "with netmask \"{0}\" (\"{1}\")"
msgstr "avec le masque \"{0}\" (\"{1}\")" msgstr "avec le masque \"{0}\" (\"{1}\")"
#: tiramisu/option/netmaskoption.py:70 #: tiramisu/option/netmaskoption.py:71
msgid "with network \"{0}\" (\"{1}\")" msgid "with network \"{0}\" (\"{1}\")"
msgstr "avec le réseau \"{0}\" (\"{1}\")" msgstr "avec le réseau \"{0}\" (\"{1}\")"
@ -673,19 +677,19 @@ msgstr "avec le réseau \"{0}\" (\"{1}\")"
msgid "ip_netmask needs an IP and a netmask" msgid "ip_netmask needs an IP and a netmask"
msgstr "ip_netmask nécessite une IP et un masque de réseau" msgstr "ip_netmask nécessite une IP et un masque de réseau"
#: tiramisu/option/netmaskoption.py:91 #: tiramisu/option/netmaskoption.py:90
msgid "this is a network with netmask \"{0}\" (\"{1}\")" msgid "this is a network with netmask \"{0}\" (\"{1}\")"
msgstr "c'est une adresse réseau avec le masque \"{0}\" (\"{1}\")" msgstr "c'est une adresse réseau avec le masque \"{0}\" (\"{1}\")"
#: tiramisu/option/netmaskoption.py:93 #: tiramisu/option/netmaskoption.py:94
msgid "IP \"{0}\" (\"{1}\") is the network"
msgstr "IP \"{0}\" (\"{1}\") est le réseau"
#: tiramisu/option/netmaskoption.py:96
msgid "this is a broadcast with netmask \"{0}\" (\"{1}\")" msgid "this is a broadcast with netmask \"{0}\" (\"{1}\")"
msgstr "c'est une adresse broadcast avec le masque \"{0}\" (\"{1}\")" msgstr "c'est une adresse broadcast avec le masque \"{0}\" (\"{1}\")"
#: tiramisu/option/netmaskoption.py:98 #: tiramisu/option/netmaskoption.py:99
msgid "IP \"{0}\" (\"{1}\") is the network"
msgstr "IP \"{0}\" (\"{1}\") est le réseau"
#: tiramisu/option/netmaskoption.py:103
msgid "IP \"{0}\" (\"{1}\") is the broadcast" msgid "IP \"{0}\" (\"{1}\") is the broadcast"
msgstr "IP \"{0}\" (\"{1}\") est l'adresse de broadcast" msgstr "IP \"{0}\" (\"{1}\") est l'adresse de broadcast"
@ -831,7 +835,7 @@ msgstr ""
msgid "the dynoption \"{0}\" cannot have \"force_store_value\" property" msgid "the dynoption \"{0}\" cannot have \"force_store_value\" property"
msgstr "la dynoption \"{0}\" ne peut avoir la propriété \"force_store_value\"" msgstr "la dynoption \"{0}\" ne peut avoir la propriété \"force_store_value\""
#: tiramisu/option/optiondescription.py:97 tiramisu/setting.py:639 #: tiramisu/option/optiondescription.py:97 tiramisu/setting.py:643
msgid "" msgid ""
"a leader ({0}) cannot have \"force_default_on_freeze\" or " "a leader ({0}) cannot have \"force_default_on_freeze\" or "
"\"force_metaconfig_on_freeze\" property without \"frozen\"" "\"force_metaconfig_on_freeze\" property without \"frozen\""
@ -982,48 +986,48 @@ msgstr ""
"imbrication de requirements mal formés detectée pour l'option : '{0}' avec " "imbrication de requirements mal formés detectée pour l'option : '{0}' avec "
"requirement sur : '{1}'" "requirement sur : '{1}'"
#: tiramisu/setting.py:562 #: tiramisu/setting.py:566
msgid "" msgid ""
"cannot access to option \"{0}\" because required option \"{1}\" has {2} {3}" "cannot access to option \"{0}\" because required option \"{1}\" has {2} {3}"
msgstr "" msgstr ""
"ne peut accéder à l'option \"{0}\" parce que l'option requise \"{1}\" a {2} " "ne peut accéder à l'option \"{0}\" parce que l'option requise \"{1}\" a {2} "
"{3}" "{3}"
#: tiramisu/setting.py:586 #: tiramisu/setting.py:590
msgid "the value of \"{0}\" is {1}" msgid "the value of \"{0}\" is {1}"
msgstr "la valeur de \"{0}\" est {1}" msgstr "la valeur de \"{0}\" est {1}"
#: tiramisu/setting.py:588 #: tiramisu/setting.py:592
msgid "the value of \"{0}\" is not {1}" msgid "the value of \"{0}\" is not {1}"
msgstr "la valeur de \"{0}\" n'est pas {1}" msgstr "la valeur de \"{0}\" n'est pas {1}"
#: tiramisu/setting.py:629 #: tiramisu/setting.py:633
msgid "cannot set property {} for option \"{}\" this property is calculated" msgid "cannot set property {} for option \"{}\" this property is calculated"
msgstr "" msgstr ""
"ne peut ajouter la propriété {} pour l'option \"{}\" cette propriété est " "ne peut ajouter la propriété {} pour l'option \"{}\" cette propriété est "
"calculée" "calculée"
#: tiramisu/setting.py:634 #: tiramisu/setting.py:638
msgid "can't assign property to the symlinkoption \"{}\"" msgid "can't assign property to the symlinkoption \"{}\""
msgstr "ne peut assigner une propriété à une symlinkoption \"{}\"" msgstr "ne peut assigner une propriété à une symlinkoption \"{}\""
#: tiramisu/setting.py:666 #: tiramisu/setting.py:670
msgid "permissive must be a frozenset" msgid "permissive must be a frozenset"
msgstr "une permissive doit être de type frozenset" msgstr "une permissive doit être de type frozenset"
#: tiramisu/setting.py:670 #: tiramisu/setting.py:674
msgid "can't assign permissive to the symlinkoption \"{}\"" msgid "can't assign permissive to the symlinkoption \"{}\""
msgstr "ne peut assigner une permissive à la symlinkoption \"{}\"" msgstr "ne peut assigner une permissive à la symlinkoption \"{}\""
#: tiramisu/setting.py:677 #: tiramisu/setting.py:681
msgid "cannot add those permissives: {0}" msgid "cannot add those permissives: {0}"
msgstr "ne peut ajouter ces permissives : {0}" msgstr "ne peut ajouter ces permissives : {0}"
#: tiramisu/setting.py:694 #: tiramisu/setting.py:698
msgid "can't reset properties to the symlinkoption \"{}\"" msgid "can't reset properties to the symlinkoption \"{}\""
msgstr "ne peut réinitialiser les propriétés de la symlinkoption \"{}\"" msgstr "ne peut réinitialiser les propriétés de la symlinkoption \"{}\""
#: tiramisu/setting.py:709 #: tiramisu/setting.py:713
msgid "can't reset permissives to the symlinkoption \"{}\"" msgid "can't reset permissives to the symlinkoption \"{}\""
msgstr "ne peut réinitialiser les permissive de la symlinkoption \"{}\"" msgstr "ne peut réinitialiser les permissive de la symlinkoption \"{}\""

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-02-25 08:47+CET\n" "POT-Creation-Date: 2019-03-05 08:46+CET\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -51,35 +51,35 @@ msgstr ""
msgid "unknown method {}" msgid "unknown method {}"
msgstr "" msgstr ""
#: tiramisu/api.py:346 #: tiramisu/api.py:360
msgid "cannot add this property: \"{0}\"" msgid "cannot add this property: \"{0}\""
msgstr "" msgstr ""
#: tiramisu/api.py:489 tiramisu/config.py:252 #: tiramisu/api.py:503 tiramisu/config.py:252
msgid "can't delete a SymLinkOption" msgid "can't delete a SymLinkOption"
msgstr "" msgstr ""
#: tiramisu/api.py:622 tiramisu/api.py:1316 #: tiramisu/api.py:636 tiramisu/api.py:1322
msgid "please specify a valid sub function ({})" msgid "please specify a valid sub function ({})"
msgstr "" msgstr ""
#: tiramisu/api.py:685 tiramisu/api.py:1139 #: tiramisu/api.py:699 tiramisu/api.py:1145
msgid "unknown list type {}" msgid "unknown list type {}"
msgstr "" msgstr ""
#: tiramisu/api.py:687 tiramisu/api.py:1141 #: tiramisu/api.py:701 tiramisu/api.py:1147
msgid "unknown group_type: {0}" msgid "unknown group_type: {0}"
msgstr "" msgstr ""
#: tiramisu/api.py:968 #: tiramisu/api.py:974
msgid "properties must be a set" msgid "properties must be a set"
msgstr "" msgstr ""
#: tiramisu/api.py:974 tiramisu/api.py:996 #: tiramisu/api.py:980 tiramisu/api.py:1002
msgid "unknown when {} (must be in append or remove)" msgid "unknown when {} (must be in append or remove)"
msgstr "" msgstr ""
#: tiramisu/api.py:986 tiramisu/api.py:1008 tiramisu/config.py:1226 #: tiramisu/api.py:992 tiramisu/api.py:1014 tiramisu/config.py:1227
msgid "unknown type {}" msgid "unknown type {}"
msgstr "" msgstr ""
@ -195,19 +195,19 @@ msgstr ""
msgid "MetaConfig with optiondescription must have string has child, not {}" msgid "MetaConfig with optiondescription must have string has child, not {}"
msgstr "" msgstr ""
#: tiramisu/config.py:1207 #: tiramisu/config.py:1208
msgid "child must be a Config or MetaConfig" msgid "child must be a Config or MetaConfig"
msgstr "" msgstr ""
#: tiramisu/config.py:1211 #: tiramisu/config.py:1212
msgid "all config in metaconfig must have the same optiondescription" msgid "all config in metaconfig must have the same optiondescription"
msgstr "" msgstr ""
#: tiramisu/config.py:1224 #: tiramisu/config.py:1225
msgid "config name must be uniq in groupconfig for {0}" msgid "config name must be uniq in groupconfig for {0}"
msgstr "" msgstr ""
#: tiramisu/config.py:1249 #: tiramisu/config.py:1250
msgid "cannot find the config {}" msgid "cannot find the config {}"
msgstr "" msgstr ""
@ -223,11 +223,11 @@ msgstr ""
msgid " {} " msgid " {} "
msgstr "" msgstr ""
#: tiramisu/error.py:103 tiramisu/setting.py:559 #: tiramisu/error.py:103 tiramisu/setting.py:563
msgid "property" msgid "property"
msgstr "" msgstr ""
#: tiramisu/error.py:105 tiramisu/setting.py:561 #: tiramisu/error.py:105 tiramisu/setting.py:565
msgid "properties" msgid "properties"
msgstr "" msgstr ""
@ -316,51 +316,55 @@ msgstr ""
msgid "\"{}\" ({}) object attribute \"{}\" is read-only" msgid "\"{}\" ({}) object attribute \"{}\" is read-only"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:447 #: tiramisu/option/baseoption.py:403
msgid "malformed requirements must be an option in option {0}" msgid "\"{}\" not part of any Config"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:450 #: tiramisu/option/baseoption.py:450
msgid "malformed requirements must be an option in option {0}"
msgstr ""
#: tiramisu/option/baseoption.py:453
msgid "malformed requirements multi option must not set as requires of non multi option {0}" msgid "malformed requirements multi option must not set as requires of non multi option {0}"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:483 #: tiramisu/option/baseoption.py:486
msgid "malformed requirements expected must have option and value for option {0}" msgid "malformed requirements expected must have option and value for option {0}"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:490 tiramisu/option/baseoption.py:506 #: tiramisu/option/baseoption.py:493 tiramisu/option/baseoption.py:509
msgid "malformed requirements expected value must be valid for option {0}: {1}" msgid "malformed requirements expected value must be valid for option {0}: {1}"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:520 #: tiramisu/option/baseoption.py:523
msgid "malformed requirements for option: {0} action cannot be force_store_value" msgid "malformed requirements for option: {0} action cannot be force_store_value"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:528 #: tiramisu/option/baseoption.py:531
msgid "malformed requirements for option: {0} inverse must be boolean" msgid "malformed requirements for option: {0} inverse must be boolean"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:535 #: tiramisu/option/baseoption.py:538
msgid "malformed requirements for option: {0} transitive must be boolean" msgid "malformed requirements for option: {0} transitive must be boolean"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:542 #: tiramisu/option/baseoption.py:545
msgid "malformed requirements for option: {0} same_action must be boolean" msgid "malformed requirements for option: {0} same_action must be boolean"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:549 #: tiramisu/option/baseoption.py:552
msgid "malformed requirements for option: \"{0}\" operator must be \"or\" or \"and\"" msgid "malformed requirements for option: \"{0}\" operator must be \"or\" or \"and\""
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:561 #: tiramisu/option/baseoption.py:564
msgid "malformed requirements type for option: {0}, must be a dict" msgid "malformed requirements type for option: {0}, must be a dict"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:567 #: tiramisu/option/baseoption.py:570
msgid "malformed requirements for option: {0} unknown keys {1}, must only {2}" msgid "malformed requirements for option: {0} unknown keys {1}, must only {2}"
msgstr "" msgstr ""
#: tiramisu/option/baseoption.py:576 #: tiramisu/option/baseoption.py:579
msgid "malformed requirements for option: {0} require must have option, expected and action keys" msgid "malformed requirements for option: {0} require must have option, expected and action keys"
msgstr "" msgstr ""
@ -374,7 +378,7 @@ msgstr ""
#: tiramisu/option/broadcastoption.py:38 tiramisu/option/dateoption.py:37 #: tiramisu/option/broadcastoption.py:38 tiramisu/option/dateoption.py:37
#: tiramisu/option/domainnameoption.py:113 tiramisu/option/ipoption.py:77 #: tiramisu/option/domainnameoption.py:113 tiramisu/option/ipoption.py:77
#: tiramisu/option/netmaskoption.py:40 tiramisu/option/networkoption.py:67 #: tiramisu/option/netmaskoption.py:41 tiramisu/option/networkoption.py:67
#: tiramisu/option/passwordoption.py:38 tiramisu/option/portoption.py:106 #: tiramisu/option/passwordoption.py:38 tiramisu/option/portoption.py:106
#: tiramisu/option/urloption.py:40 #: tiramisu/option/urloption.py:40
msgid "invalid string" msgid "invalid string"
@ -576,7 +580,7 @@ msgstr ""
msgid "malformed requirements option \"{0}\" must not be in follower for \"{1}\"" msgid "malformed requirements option \"{0}\" must not be in follower for \"{1}\""
msgstr "" msgstr ""
#: tiramisu/option/netmaskoption.py:33 #: tiramisu/option/netmaskoption.py:34
msgid "netmask address" msgid "netmask address"
msgstr "" msgstr ""
@ -584,11 +588,11 @@ msgstr ""
msgid "network_netmask needs a network and a netmask" msgid "network_netmask needs a network and a netmask"
msgstr "" msgstr ""
#: tiramisu/option/netmaskoption.py:67 #: tiramisu/option/netmaskoption.py:68
msgid "with netmask \"{0}\" (\"{1}\")" msgid "with netmask \"{0}\" (\"{1}\")"
msgstr "" msgstr ""
#: tiramisu/option/netmaskoption.py:70 #: tiramisu/option/netmaskoption.py:71
msgid "with network \"{0}\" (\"{1}\")" msgid "with network \"{0}\" (\"{1}\")"
msgstr "" msgstr ""
@ -596,19 +600,19 @@ msgstr ""
msgid "ip_netmask needs an IP and a netmask" msgid "ip_netmask needs an IP and a netmask"
msgstr "" msgstr ""
#: tiramisu/option/netmaskoption.py:91 #: tiramisu/option/netmaskoption.py:90
msgid "this is a network with netmask \"{0}\" (\"{1}\")" msgid "this is a network with netmask \"{0}\" (\"{1}\")"
msgstr "" msgstr ""
#: tiramisu/option/netmaskoption.py:93 #: tiramisu/option/netmaskoption.py:94
msgid "IP \"{0}\" (\"{1}\") is the network"
msgstr ""
#: tiramisu/option/netmaskoption.py:96
msgid "this is a broadcast with netmask \"{0}\" (\"{1}\")" msgid "this is a broadcast with netmask \"{0}\" (\"{1}\")"
msgstr "" msgstr ""
#: tiramisu/option/netmaskoption.py:98 #: tiramisu/option/netmaskoption.py:99
msgid "IP \"{0}\" (\"{1}\") is the network"
msgstr ""
#: tiramisu/option/netmaskoption.py:103
msgid "IP \"{0}\" (\"{1}\") is the broadcast" msgid "IP \"{0}\" (\"{1}\") is the broadcast"
msgstr "" msgstr ""
@ -737,7 +741,7 @@ msgstr ""
msgid "the dynoption \"{0}\" cannot have \"force_store_value\" property" msgid "the dynoption \"{0}\" cannot have \"force_store_value\" property"
msgstr "" msgstr ""
#: tiramisu/option/optiondescription.py:97 tiramisu/setting.py:639 #: tiramisu/option/optiondescription.py:97 tiramisu/setting.py:643
msgid "a leader ({0}) cannot have \"force_default_on_freeze\" or \"force_metaconfig_on_freeze\" property without \"frozen\"" msgid "a leader ({0}) cannot have \"force_default_on_freeze\" or \"force_metaconfig_on_freeze\" property without \"frozen\""
msgstr "" msgstr ""
@ -865,43 +869,43 @@ msgstr ""
msgid "malformed requirements imbrication detected for option: '{0}' with requirement on: '{1}'" msgid "malformed requirements imbrication detected for option: '{0}' with requirement on: '{1}'"
msgstr "" msgstr ""
#: tiramisu/setting.py:562 #: tiramisu/setting.py:566
msgid "cannot access to option \"{0}\" because required option \"{1}\" has {2} {3}" msgid "cannot access to option \"{0}\" because required option \"{1}\" has {2} {3}"
msgstr "" msgstr ""
#: tiramisu/setting.py:586 #: tiramisu/setting.py:590
msgid "the value of \"{0}\" is {1}" msgid "the value of \"{0}\" is {1}"
msgstr "" msgstr ""
#: tiramisu/setting.py:588 #: tiramisu/setting.py:592
msgid "the value of \"{0}\" is not {1}" msgid "the value of \"{0}\" is not {1}"
msgstr "" msgstr ""
#: tiramisu/setting.py:629 #: tiramisu/setting.py:633
msgid "cannot set property {} for option \"{}\" this property is calculated" msgid "cannot set property {} for option \"{}\" this property is calculated"
msgstr "" msgstr ""
#: tiramisu/setting.py:634 #: tiramisu/setting.py:638
msgid "can't assign property to the symlinkoption \"{}\"" msgid "can't assign property to the symlinkoption \"{}\""
msgstr "" msgstr ""
#: tiramisu/setting.py:666 #: tiramisu/setting.py:670
msgid "permissive must be a frozenset" msgid "permissive must be a frozenset"
msgstr "" msgstr ""
#: tiramisu/setting.py:670 #: tiramisu/setting.py:674
msgid "can't assign permissive to the symlinkoption \"{}\"" msgid "can't assign permissive to the symlinkoption \"{}\""
msgstr "" msgstr ""
#: tiramisu/setting.py:677 #: tiramisu/setting.py:681
msgid "cannot add those permissives: {0}" msgid "cannot add those permissives: {0}"
msgstr "" msgstr ""
#: tiramisu/setting.py:694 #: tiramisu/setting.py:698
msgid "can't reset properties to the symlinkoption \"{}\"" msgid "can't reset properties to the symlinkoption \"{}\""
msgstr "" msgstr ""
#: tiramisu/setting.py:709 #: tiramisu/setting.py:713
msgid "can't reset permissives to the symlinkoption \"{}\"" msgid "can't reset permissives to the symlinkoption \"{}\""
msgstr "" msgstr ""