multi-action available now in requires
[tiramisu.git] / tiramisu / config.py
index d268787..5d5c0f2 100644 (file)
@@ -38,6 +38,8 @@ 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
@@ -61,6 +63,26 @@ 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)
@@ -424,7 +446,7 @@ class Config(object):
         self.cfgimpl_unfreeze()
         rootconfig = self._cfgimpl_get_toplevel()
         rootconfig.cfgimpl_enable_property('hidden')
-        rootconfig.cfgimpl_disable_property('disabled')
+        rootconfig.cfgimpl_enable_property('disabled')
         rootconfig._cfgimpl_mandatory = False
     # ____________________________________________________________
     def getkey(self):