|
def load(self, f): |
|
""" |
|
Load data from a file. |
|
|
|
:param f: file-like object or path to file |
|
:type f: file or str |
|
""" |
|
with open_file_obj(f) as f: |
|
parser = self.parse_file(f) |
|
self.deserialize(parser) |
|
|
|
def loads(self, s): |
|
""" |
|
Load data from a string. |
|
|
|
:param s: input data |
|
:type s: str |
|
""" |
|
io = six.StringIO() |
|
io.write(s) |
|
io.seek(0) |
|
self.load(io) |
|
self.validate() |
Why does MetadataBase.loads() call self.validate() but MetadataBase.load() does not?
I would kind of expect self.validate() to be called from MetadataBase.load() so that it would be inherited by MetadataBase.loads()`
productmd/productmd/common.py
Lines 254 to 276 in 534a9d4
Why does
MetadataBase.loads()callself.validate()butMetadataBase.load()does not?I would kind of expect
self.validate()to be called fromMetadataBase.load()so that it would be inherited by MetadataBase.loads()`