summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-19 19:01:56 +0000
committerDavid Robillard <d@drobilla.net>2014-11-19 19:01:56 +0000
commite89a43a5f8f513610e9a1fd9aa3221c7a0e1ae2b (patch)
tree85fb5267aaf68c1e6d4a96e0777213909a2cfaff
parent27e81cf8f9a46c8080cac554f8a72afc4ad7963f (diff)
downloadingen-e89a43a5f8f513610e9a1fd9aa3221c7a0e1ae2b.tar.gz
ingen-e89a43a5f8f513610e9a1fd9aa3221c7a0e1ae2b.tar.bz2
ingen-e89a43a5f8f513610e9a1fd9aa3221c7a0e1ae2b.zip
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
-rw-r--r--scripts/ingen.py10
-rwxr-xr-xscripts/ingenams3
2 files changed, 7 insertions, 6 deletions
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'