Skip to content

Commit 3654d37

Browse files
committed
[fileio] Add show warnings flag on load
Closes #305
1 parent 3f11ff9 commit 3654d37

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

odml/fileio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
from .tools.odmlparser import ODMLReader, ODMLWriter
33

44

5-
def load(filename, backend="xml"):
5+
def load(filename, backend="xml", show_warnings=True):
66
"""
77
Load an odML document from file.
88
:param filename: Path and filename from where the odML document
99
is to be loaded and parsed.
1010
:param backend: File format of the file containing the odML document.
1111
The default format is XML.
12+
:param show_warnings: Toggle whether to print warnings to the command line.
1213
:return: The parsed odML document.
1314
"""
1415
if not os.path.exists(filename):
1516
msg = "File \'%s\' was not found!" % \
1617
(filename if len(filename) < 20 else "...%s" % filename[19:])
1718
raise FileNotFoundError(msg)
1819

19-
reader = ODMLReader(backend)
20+
reader = ODMLReader(backend, show_warnings)
2021
return reader.from_file(filename)
2122

2223

0 commit comments

Comments
 (0)