is not config in other, __neq__ should return True

This commit is contained in:
Emmanuel Garette 2013-08-24 18:04:11 +02:00
parent 196d270cc9
commit a7d784ba3e

View file

@ -48,8 +48,8 @@ class SubConfig(BaseInformation):
""" """
# main option description # main option description
if not isinstance(descr, OptionDescription): if not isinstance(descr, OptionDescription):
raise ValueError(_('descr must be an optiondescription, not {0}' raise TypeError(_('descr must be an optiondescription, not {0}'
).format(type(descr))) ).format(type(descr)))
self._impl_descr = descr self._impl_descr = descr
# sub option descriptions # sub option descriptions
if not isinstance(context, SubConfig): if not isinstance(context, SubConfig):
@ -84,7 +84,7 @@ class SubConfig(BaseInformation):
def __ne__(self, other): def __ne__(self, other):
"Config's comparison" "Config's comparison"
if not isinstance(other, Config): if not isinstance(other, Config):
return False return True
return not self == other return not self == other
# ______________________________________________________________________ # ______________________________________________________________________
@ -120,9 +120,9 @@ class SubConfig(BaseInformation):
or `groups.MasterGroupType` that lives in or `groups.MasterGroupType` that lives in
`setting.groups` `setting.groups`
""" """
if group_type is not None: if group_type is not None and not isinstance(group_type,
if not isinstance(group_type, groups.GroupType): groups.GroupType):
raise TypeError(_("unknown group_type: {0}").format(group_type)) raise TypeError(_("unknown group_type: {0}").format(group_type))
for child in self.cfgimpl_get_description().impl_getchildren(): for child in self.cfgimpl_get_description().impl_getchildren():
if isinstance(child, OptionDescription): if isinstance(child, OptionDescription):
try: try:
@ -669,8 +669,6 @@ def mandatory_warnings(config):
include_groups=True): include_groups=True):
try: try:
config._getattr(path, force_properties=frozenset(('mandatory',))) 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: except PropertiesOptionError, err:
if err.proptype == ['mandatory']: if err.proptype == ['mandatory']:
yield path yield path