From 96e19464f98b868bd93b76ac842ec5b32a17cfb6 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 26 May 2018 15:58:21 +0200 Subject: means to run remote commands and get output --- rpc/rpc.py | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'rpc/rpc.py') diff --git a/rpc/rpc.py b/rpc/rpc.py index 4df4a5b..a00fd2c 100644 --- a/rpc/rpc.py +++ b/rpc/rpc.py @@ -15,7 +15,6 @@ class CortexRPC(object): self._get_fn = get_fn self._set_fn = set_fn self._cmd_fn = cmd_fn - self.working = False self.connect(ready_fn) def connect(self, ready_fn): @@ -38,34 +37,6 @@ class CortexRPC(object): except zerorpc.TimeoutExpired: print('RPC timeout :(') return val - # print('defer sending a file...') - # gevent.sleep(1) - # return self.get_last_frame() - - """ - def get_last_frame(self): - if self.working: - self.working = False - return 'working' - path = os.getenv('TEST_FRAMES_PATH') - onlyfiles = sorted([f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))]) - self.working = True - - for f in onlyfiles: - gevent.sleep(1/10) - if not self.working: - return - output = BytesIO() - im = Image.open(os.path.join(path, f)) - # im = im.convert('RGB') - im.save(output, format='JPEG') - frame = output.getvalue() - output.close() - self.send_frame(f.replace('png', 'jpg'), frame) - - self.working = False - return 'ok' - """ def send_command(self, cmd, payload): print('your command, {}: {}'.format(cmd, payload)) -- cgit v1.2.3-70-g09d2