diff options
author | Kevin Rocard <kevinx.rocard@intel.com> | 2013-06-10 15:15:56 +0200 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:03:59 +0100 |
commit | 97dbd35c75ee252a674aff3d66293d55fc0b35a5 (patch) | |
tree | 4f066f8d550244d743fb9c9d7e077c0056b0f7eb /tools | |
parent | 33a4e33c51ce396851db36f07b869d6786c6e858 (diff) | |
download | external_parameter-framework-97dbd35c75ee252a674aff3d66293d55fc0b35a5.zip external_parameter-framework-97dbd35c75ee252a674aff3d66293d55fc0b35a5.tar.gz external_parameter-framework-97dbd35c75ee252a674aff3d66293d55fc0b35a5.tar.bz2 |
[Coverage] Move exception class in the relevant class
BZ: 115218
Some exceptions were raised only by a particular class. As a result they
were polluting the global namespace.
Nested the exception class.
Change-Id: Icde35d8d2f551a638b97d94bc0a770f70787c723
Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com>
Reviewed-on: http://android.intel.com:8080/112710
Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com>
Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/coverage.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/tools/coverage.py b/tools/coverage.py index 6c4345c..f62fd9a 100755 --- a/tools/coverage.py +++ b/tools/coverage.py @@ -468,24 +468,28 @@ class CriteronStates(Element): currentcriteria.parentUsed() -class IneligibleConfigurationAppliedError(CustomError): - - def __init__(self, configuration, criteria): - self.configuration = configuration - self.criteria = criteria - - def __str__(self): - - return ("Applying ineligible %s, " - "rule:\n%s\n" - "Criteria current state:\n%s" % - (self.configuration, self.configuration.rootRule.dump(), self.criteria.dump())) class Configuration(FromDomElement, DomPopulatedElement): tag = "Configuration" childClasses = [] + class IneligibleConfigurationAppliedError(CustomError): + + def __init__(self, configuration, criteria): + self.configuration = configuration + self.criteria = criteria + + def __str__(self): + + return ("Applying ineligible %s, " + "rule:\n%s\n" + "Criteria current state:\n%s" % ( + self.configuration, + self.configuration.rootRule.dump(withCoverage=False, withNbUse=False), + self.criteria.dump(withCoverage=False, withNbUse=False) + )) + def __init__(self, DomElement): super().__init__(DomElement) @@ -520,7 +524,7 @@ class Configuration(FromDomElement, DomPopulatedElement): "criteria (parent: %s) " % self.parent.name, logging.FATAL) - raise IneligibleConfigurationAppliedError(self, criteria.export()) + raise self.IneligibleConfigurationAppliedError(self, criteria.export()) def _dumpPropagate(self, withCoverage, withNbUse): self.debug("Going to ask %s for description" % self.rootRule) |