remove unicity by name commented code

This commit is contained in:
gwen 2012-09-19 10:25:39 +02:00
parent b2e97573bd
commit 9b419a488d

View File

@ -38,8 +38,6 @@ class Config(object):
_cfgimpl_frozen = True
_cfgimpl_owner = default_owner
_cfgimpl_toplevel = None
# TODO implement unicity by name
# _cfgimpl_unique_names = True
def __init__(self, descr, parent=None, **overrides):
self._cfgimpl_descr = descr
@ -63,26 +61,6 @@ class Config(object):
else:
raise ConflictConfigError('duplicate option name: '
'{0}'.format(dup._name))
# TODO implement unicity by name
# def _validate_duplicates_for_names(self, children):
# "validates duplicates names agains the whole config"
# rootconfig = self._cfgimpl_get_toplevel()
# if self._cfgimpl_unique_names:
# for dup in children:
# try:
# print dup._name
# try:
# print rootconfig.get(dup._name)
# except AttributeError:
# pass
# raise NotFoundError
# #rootconfig.get(dup._name)
# except NotFoundError:
# pass # no identical names, it's fine
# else:
# raise ConflictConfigError('duplicate option name: '
# '{0}'.format(dup._name))
def _cfgimpl_build(self, overrides):
self._validate_duplicates(self._cfgimpl_descr._children)