From 809f5ae5999901be62f9d0cc1eb8a2d0f4806780 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 28 Apr 2011 21:56:29 +0000 Subject: Rename slv2 to lilv. API breakage was proving too much of a hassle, and would be even further of a mess after release and packaging. Best to make a clean break now, and fix installation to support parallel installs and prevent this kind of problem in the future. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3217 a436a847-0d15-0410-975c-d299462d15a1 --- swig/lilv.i | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ swig/slv2.i | 48 ------------------------------------------------ 2 files changed, 48 insertions(+), 48 deletions(-) create mode 100644 swig/lilv.i delete mode 100644 swig/slv2.i (limited to 'swig') diff --git a/swig/lilv.i b/swig/lilv.i new file mode 100644 index 0000000..c3943dd --- /dev/null +++ b/swig/lilv.i @@ -0,0 +1,48 @@ +%module lilv +%{ +#include "lilv/lilv.h" +#include "lilv/lilvmm.hpp" +%} + +%include "lilv/lilv.h" +%include "lilv/lilvmm.hpp" + +namespace Lilv { + +%extend Plugins { +%pythoncode %{ + def __iter__(self): + class Iterator(object): + def __init__(self, plugins): + self.plugins = plugins + self.index = 0 + + 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)) + else: + raise StopIteration + + return Iterator(self) +%} +}; + +%extend Value { +%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)) +%} +}; + +} /* namespace Lilv */ diff --git a/swig/slv2.i b/swig/slv2.i deleted file mode 100644 index bff9f70..0000000 --- a/swig/slv2.i +++ /dev/null @@ -1,48 +0,0 @@ -%module slv2 -%{ -#include "slv2/slv2.h" -#include "slv2/slv2mm.hpp" -%} - -%include "slv2/slv2.h" -%include "slv2/slv2mm.hpp" - -namespace SLV2 { - -%extend Plugins { -%pythoncode %{ - def __iter__(self): - class Iterator(object): - def __init__(self, plugins): - self.plugins = plugins - self.index = 0 - - def __iter__(self): - return self - - def next(self): - self.index += 1 - if self.index < slv2_plugins_size(self.plugins.me): - return Plugin(slv2_plugins_get_at(self.plugins.me, self.index)) - else: - raise StopIteration - - return Iterator(self) -%} -}; - -%extend Value { -%pythoncode %{ - def __str__(self): - return slv2_value_get_turtle_token(self.me) -%} -}; - -%extend World { -%pythoncode %{ - def get_plugin(self, uri_str): - return Plugin(slv2_world_get_plugin_by_uri_string(self.me, uri_str)) -%} -}; - -} /* namespace SLV2 */ -- cgit v1.2.1