correction in fullpath option

This commit is contained in:
Emmanuel Garette 2017-01-09 20:16:33 +01:00
parent 66f24bd1c0
commit 7fe47396ee
3 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,6 @@
Mon Jan 9 20:12:02 2017 +0200 Emmanuel Garette <egarette@cadoles.com>
* make_dict has new fullpath option
Wed Nov 16 22:30:12 2016 +0200 Emmanuel Garette <egarette@cadoles.com>
* consistency "not_equal" works now with multi and submulti
* a multi or submulti could be "unique" (same value one time)

View File

@ -149,6 +149,7 @@ def test_make_dict_fullpath():
config.read_only()
assert config.make_dict() == {"opt.s1.a": False, "opt.int": 42, "introot": 42}
assert config.opt.make_dict() == {"s1.a": False, "int": 42}
assert config.make_dict(fullpath=True) == {"opt.s1.a": False, "opt.int": 42, "introot": 42}
assert config.opt.make_dict(fullpath=True) == {"opt.s1.a": False, "opt.int": 42}

View File

@ -545,7 +545,11 @@ class SubConfig(object):
name = opt.impl_getname()
else:
if fullpath:
name = '.'.join([self._impl_path, opt.impl_getname()])
root_path = self.cfgimpl_get_path()
if root_path is None:
name = opt.impl_getname()
else:
name = '.'.join([root_path, opt.impl_getname()])
else:
name = '.'.join(_currpath + [opt.impl_getname()])
pathsvalues.append((name, value))