Skip to content

Commit e461fca

Browse files
committed
[tools/dict_parser] Reader: is_valid_attribute err
Adding the error / warning methods call to the DictReader is_valid_attribute handling.
1 parent 8687220 commit e461fca

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

odml/tools/dict_parser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ def is_valid_attribute(self, attr, fmt):
202202
if fmt.revmap(attr):
203203
return attr
204204

205-
msg = "Invalid element <%s> inside <%s> tag" % (attr, fmt.__class__.__name__)
205+
msg = "Invalid element |%s| inside <%s> tag" % (attr, fmt.__class__.__name__)
206+
self.error(msg)
207+
208+
return None
206209

207210
def error(self, msg):
208211
"""
@@ -228,11 +231,10 @@ def warn(self, msg):
228231
msg = "warning: %s\n" % msg
229232

230233
self.warnings.append(msg)
234+
231235
if self.show_warnings:
232236
print(msg)
233237

234-
return None
235-
236238
def to_odml(self, parsed_doc):
237239
"""
238240
Parses a Python dictionary object containing an odML document to an odml.Document.

0 commit comments

Comments
 (0)