is not config in other, __neq__ should return True
authorEmmanuel Garette <egarette@cadoles.com>
Sat, 24 Aug 2013 16:04:11 +0000 (18:04 +0200)
committerEmmanuel Garette <egarette@cadoles.com>
Sat, 24 Aug 2013 16:04:11 +0000 (18:04 +0200)
tiramisu/config.py

index dd0b0f9..ccb806e 100644 (file)
@@ -48,8 +48,8 @@ class SubConfig(BaseInformation):
         """
         # main option description
         if not isinstance(descr, OptionDescription):
-            raise ValueError(_('descr must be an optiondescription, not {0}'
-                               ).format(type(descr)))
+            raise TypeError(_('descr must be an optiondescription, not {0}'
+                              ).format(type(descr)))
         self._impl_descr = descr
         # sub option descriptions
         if not isinstance(context, SubConfig):
@@ -84,7 +84,7 @@ class SubConfig(BaseInformation):
     def __ne__(self, other):
         "Config's comparison"
         if not isinstance(other, Config):
-            return False
+            return True
         return not self == other
 
     # ______________________________________________________________________
@@ -120,9 +120,9 @@ class SubConfig(BaseInformation):
                            or `groups.MasterGroupType` that lives in
                            `setting.groups`
         """
-        if group_type is not None:
-            if not isinstance(group_type, groups.GroupType):
-                raise TypeError(_("unknown group_type: {0}").format(group_type))
+        if group_type is not None and not isinstance(group_type,
+                                                     groups.GroupType):
+            raise TypeError(_("unknown group_type: {0}").format(group_type))
         for child in self.cfgimpl_get_description().impl_getchildren():
             if isinstance(child, OptionDescription):
                 try:
@@ -669,8 +669,6 @@ def mandatory_warnings(config):
             include_groups=True):
         try:
             config._getattr(path, force_properties=frozenset(('mandatory',)))
-            # XXX raise Exception("ca passe ici")
-            # XXX depuis l'exterieur on donne un paht maintenant ! perturbant !
         except PropertiesOptionError, err:
             if err.proptype == ['mandatory']:
                 yield path