diff --git a/teeth_agent/agent.py b/teeth_agent/agent.py index 2d598ddf6..595f0e2e6 100644 --- a/teeth_agent/agent.py +++ b/teeth_agent/agent.py @@ -30,6 +30,9 @@ AGENT_VERSION = '0.1-dev' class AgentClientHandler(TeethAgentProtocol): def __init__(self): TeethAgentProtocol.__init__(self, json.JSONEncoder()) + self.handlers['v1'] = { + 'prepare_image': self.prepare_image, + } def connectionMade(self): def _response(result): @@ -37,6 +40,10 @@ class AgentClientHandler(TeethAgentProtocol): self.send_command('handshake', 'a:b:c:d', AGENT_VERSION).addCallback(_response) + def prepare_image(self, image_id): + log.msg(format='Preparing image %(image_id)s', image_id=image_id) + return {'image_id': image_id, 'status': 'PREPARED'} + class AgentClientFactory(ReconnectingClientFactory): protocol = AgentClientHandler