From 3654d37540adb28063a96fedca57adb4c4f375b0 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Fri, 16 Nov 2018 11:14:19 +0100 Subject: [PATCH] [fileio] Add show warnings flag on load Closes #305 --- odml/fileio.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/odml/fileio.py b/odml/fileio.py index 2d095bd5..d9e52695 100644 --- a/odml/fileio.py +++ b/odml/fileio.py @@ -2,13 +2,14 @@ from .tools.odmlparser import ODMLReader, ODMLWriter -def load(filename, backend="xml"): +def load(filename, backend="xml", show_warnings=True): """ Load an odML document from file. :param filename: Path and filename from where the odML document is to be loaded and parsed. :param backend: File format of the file containing the odML document. The default format is XML. + :param show_warnings: Toggle whether to print warnings to the command line. :return: The parsed odML document. """ if not os.path.exists(filename): @@ -16,7 +17,7 @@ def load(filename, backend="xml"): (filename if len(filename) < 20 else "...%s" % filename[19:]) raise FileNotFoundError(msg) - reader = ODMLReader(backend) + reader = ODMLReader(backend, show_warnings) return reader.from_file(filename)