summaryrefslogtreecommitdiffstats
path: root/swig
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-04 17:36:46 +0000
committerDavid Robillard <d@drobilla.net>2011-05-04 17:36:46 +0000
commite0c959ea40eb1e644b021117de7902b22948fca9 (patch)
tree4bb9e247e0503c19cb0a3905561c392c07f7800e /swig
parent61d680d07e0b777048379f63e2f824c5f3bcebb5 (diff)
downloadlilv-e0c959ea40eb1e644b021117de7902b22948fca9.tar.gz
lilv-e0c959ea40eb1e644b021117de7902b22948fca9.tar.bz2
lilv-e0c959ea40eb1e644b021117de7902b22948fca9.zip
Fix python bindings.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3249 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'swig')
-rw-r--r--swig/lilv.i20
-rwxr-xr-xswig/python/lv2_apply.py2
2 files changed, 6 insertions, 16 deletions
diff --git a/swig/lilv.i b/swig/lilv.i
index 0d7c83c..958f9f0 100644
--- a/swig/lilv.i
+++ b/swig/lilv.i
@@ -15,15 +15,12 @@ namespace Lilv {
class Iterator(object):
def __init__(self, plugins):
self.plugins = plugins
- self.index = 0
+ self.iter = plugins.begin()
- def __iter__(self):
- return self
-
def next(self):
- self.index += 1
- if self.index < lilv_plugins_size(self.plugins.me):
- return Plugin(lilv_plugins_get_at(self.plugins.me, self.index))
+ self.iter = self.plugins.next(self.iter)
+ if not self.plugins.is_end(self.iter):
+ return self.plugins.get(self.iter)
else:
raise StopIteration
@@ -34,14 +31,7 @@ namespace Lilv {
%extend Node {
%pythoncode %{
def __str__(self):
- return lilv_value_get_turtle_token(self.me)
-%}
-};
-
-%extend World {
-%pythoncode %{
- def get_plugin(self, uri_str):
- return Plugin(lilv_world_get_plugin_by_uri_string(self.me, uri_str))
+ return self.get_turtle_token()
%}
};
diff --git a/swig/python/lv2_apply.py b/swig/python/lv2_apply.py
index 736311f..98d6f75 100755
--- a/swig/python/lv2_apply.py
+++ b/swig/python/lv2_apply.py
@@ -21,7 +21,7 @@ world = lilv.World()
world.load_all()
# Find plugin
-plugin = world.get_plugin(plugin_uri)
+plugin = world.get_all_plugins.get_by_uri(plugin_uri)
if not plugin:
print "Unknown plugin `%s'\n" % plugin_uri
sys.exit(1)