diff options
author | David Robillard <d@drobilla.net> | 2020-02-17 14:30:06 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-02-17 14:30:06 +0100 |
commit | abfa2ce02fdd482de5ac21abce101c1327cc7d17 (patch) | |
tree | 89ef9dc2aecf5c7ba8b70a3e8395bec3399987e5 | |
parent | 1381b2790dc90fb9d90e87645b2c38e68d4cff86 (diff) | |
download | lilv-abfa2ce02fdd482de5ac21abce101c1327cc7d17.tar.gz lilv-abfa2ce02fdd482de5ac21abce101c1327cc7d17.tar.bz2 lilv-abfa2ce02fdd482de5ac21abce101c1327cc7d17.zip |
Simplify lv2_list_presets.py
-rwxr-xr-x | bindings/python/lv2_list_presets.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bindings/python/lv2_list_presets.py b/bindings/python/lv2_list_presets.py index 561e3f8..4e0c9b1 100755 --- a/bindings/python/lv2_list_presets.py +++ b/bindings/python/lv2_list_presets.py @@ -21,10 +21,8 @@ def print_presets(uri): preset_list = [] for preset in presets: world.load_resource(preset) - labels = world.find_nodes(preset, world.ns.rdfs.label, None) - label = str(labels[0]) if len(labels) > 0 else "" - - if not label: + label = world.get(preset, world.ns.rdfs.label, None) + if label is None: sys.stderr.write("warning: Preset <%s> has no label\n" % preset) preset_list.append((str(preset), str(label))) |