From e89a43a5f8f513610e9a1fd9aa3221c7a0e1ae2b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 19 Nov 2014 19:01:56 +0000 Subject: Make ingenams work with Python3 and other versions of rdflib. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5490 a436a847-0d15-0410-975c-d299462d15a1 --- scripts/ingen.py | 10 +++++----- scripts/ingenams | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/ingen.py b/scripts/ingen.py index e0a71a47..8eb67d9d 100644 --- a/scripts/ingen.py +++ b/scripts/ingen.py @@ -20,9 +20,9 @@ import socket import sys try: - import StringIO + import StringIO.StringIO as StringIO except ImportError: - from io import StringIO + from io import StringIO as StringIO class NS: ingen = rdflib.Namespace('http://drobilla.net/ns/ingen#') @@ -134,9 +134,9 @@ class Remote(Interface): def recv(self): 'Read from socket until a NULL terminator is received' - msg = '' + msg = u'' while True: - c = self.sock.recv(1, 0) + c = self.sock.recv(1, 0).decode('utf-8') if not c or ord(c[0]) == 0: # End of transmission break else: @@ -178,7 +178,7 @@ class Remote(Interface): response_str = self.recv() response_model = rdflib.Graph() response_model.namespace_manager = self.ns_manager - response_model.parse(StringIO.StringIO(response_str), self.server_base, format='n3') + response_model.parse(StringIO(response_str), self.server_base, format='n3') # Handle response (though there should be only one) blanks = [] diff --git a/scripts/ingenams b/scripts/ingenams index 090db76b..27990a2c 100755 --- a/scripts/ingenams +++ b/scripts/ingenams @@ -16,6 +16,7 @@ import ingen import rdflib +import rdflib.namespace import sys ams_prefix = 'http://github.com/blablack/ams-lv2/' @@ -201,7 +202,7 @@ def scala_module(world, mod_id, scala_name): def standard_module(world, mod_id, x, y, name, arg): if name == 'vca': - if arg > 0: + if int(arg) > 0: name += 'exp' else: name += 'lin' -- cgit v1.2.1