[python] Do not parse metadata for find_feature if find mode is not 'm'.

This commit is contained in:
tatiana-yan 2020-02-12 14:49:14 +03:00 committed by Maksim Andrianov
parent a0da74753a
commit 558ebdf259

View file

@ -9,7 +9,9 @@ def find_feature(path, typ, string):
mwm.read_header()
mwm.read_types(os.path.join(os.path.dirname(__file__),
"..", "..", "..", "data", "types.txt"))
for i, feature in enumerate(mwm.iter_features(metadata=True)):
parse_metadata = typ == "m"
for i, feature in enumerate(mwm.iter_features(metadata=parse_metadata)):
found = False
if typ == "n" and "name" in feature["header"]:
for value in feature["header"]["name"].values():