diff options
author | David Robillard <d@drobilla.net> | 2019-12-08 23:27:02 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-08 23:30:12 +0100 |
commit | 36949a845cf79e105445b9bc8656f2560469dc4d (patch) | |
tree | 0a22ae92ca867c645d9850f6591906373d83c9af | |
parent | 681d42a8a8b2fede618bb1073c851d0539fe5c48 (diff) | |
download | ingen-36949a845cf79e105445b9bc8656f2560469dc4d.tar.gz ingen-36949a845cf79e105445b9bc8656f2560469dc4d.tar.bz2 ingen-36949a845cf79e105445b9bc8656f2560469dc4d.zip |
Fix network communication with Python bindings
-rw-r--r-- | scripts/ingen.py | 11 | ||||
-rw-r--r-- | wscript | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/scripts/ingen.py b/scripts/ingen.py index d56d7e0b..a9f2c4ed 100644 --- a/scripts/ingen.py +++ b/scripts/ingen.py @@ -156,11 +156,12 @@ class Remote(Interface): 'Read from socket until a null terminator is received' msg = u'' while True: - c = self.sock.recv(1, 0).decode('utf-8') - if not c or ord(c[0]) == 0: # End of transmission + chunk = self.sock.recv(1, 0) + if not chunk or chunk[0] == 0: # End of transmission break - else: - msg += c[0] + + msg += chunk.decode('utf-8') + return msg def blank_closure(self, graph, node): @@ -192,7 +193,7 @@ class Remote(Interface): msg = '\n'.join(msg) # Send message to server - self.sock.send(self.msgencode(msg)) + self.sock.send(self.msgencode(msg) + b'\0') # Receive response and parse into a model response_str = self._get_prefixes_string() + self.recv() @@ -69,7 +69,7 @@ def configure(conf): conf.check_pkg('suil-0 >= 0.8.7', uselib_store='SUIL') conf.check_pkg('sratom-0 >= 0.4.6', uselib_store='SRATOM') conf.check_pkg('raul-1 >= 1.0.0', uselib_store='RAUL') - conf.check_pkg('serd-0 >= 0.30.0', uselib_store='SERD', mandatory=False) + conf.check_pkg('serd-0 >= 0.30.3', uselib_store='SERD', mandatory=False) conf.check_pkg('sord-0 >= 0.12.0', uselib_store='SORD', mandatory=False) conf.check_pkg('portaudio-2.0', uselib_store='PORTAUDIO', mandatory=False) conf.check_pkg('sigc++-2.0', uselib_store='SIGCPP', mandatory=False) |