summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-06-29 11:40:31 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-06-29 11:40:31 +0200
commitb4c585ab2acc1b2a9c3f0bf63d8e6c365ad773b0 (patch)
tree7f75ef30217685ad5a202993a9f972823d072419
parent79245cf15ceba1b4d98bd849f42a0fdac925cb42 (diff)
downloadxdd2esi-b4c585ab2acc1b2a9c3f0bf63d8e6c365ad773b0.tar.gz
xdd2esi-b4c585ab2acc1b2a9c3f0bf63d8e6c365ad773b0.zip
Raise a proper warning for ignored attributes
-rw-r--r--esilib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/esilib.py b/esilib.py
index cc718d9..c890790 100644
--- a/esilib.py
+++ b/esilib.py
@@ -41,6 +41,10 @@ class InvalidESIWarning(ESIWarning):
""" Gets raised when the ESI validation fails """
pass
+class IgnoredAttributeWarning(ESIWarning):
+ """ Gets raised when an attribute gets ignored """
+ pass
+
class ESIFile:
""" Represents the device profile part of an ESI XML file """
def __init__(self, versioninfo=None):
@@ -409,7 +413,7 @@ def _add_to_xml(xmlparent, xmlnodename, properties, ignored):
_append_comment(obj, "ignored: {} (value: {})".format(elem[0],
elem[1]))
warnings.warn("Ignored attribute '{}' (value: {})".format(
- elem[0], elem[1]))
+ elem[0], elem[1]), IgnoredAttributeWarning)
return obj
def _get_info_tree(canobj):