def showDirections(self, directionsType, source, destination, utterance=None): '''Show the given type of directions between the two locations to the user. * directionsType -- The type of directions * source -- The source location * destination -- The destination location * utterance -- The utterance to speak ''' server = Directions.From_Server connection = self._connectionManager.getConnection(server) if connection is not None: self.log.debug("Making directions [%s]" % directionsType, level=3) refId = connection.getRefId() directions = ResponseFactory.directions(refId, directionsType, source, destination, utterance=utterance) connection.injectObjectToOutputStream(directions)
def makeView(self, views): """Create a view and send it to the iPhone. * views -- The list of views to create """ server = Directions.From_Server connection = self._connectionManager.getConnection(server) if connection is not None: self.log.debug("Making view", level=3) refId = connection.getRefId() view = ResponseFactory.view(refId, views) connection.injectObjectToOutputStream(view)
def makeView(self, views): '''Create a view and send it to the iPhone. * views -- The list of views to create ''' server = Directions.From_Server connection = self._connectionManager.getConnection(server) if connection is not None: self.log.debug("Making view", level=3) refId = connection.getRefId() view = ResponseFactory.view(refId, views) connection.injectObjectToOutputStream(view)
def completeRequest(self, refId=None, resetContext=True): """Complete a request to Siri. * refId -- The reference ID """ server = Directions.From_Server connection = self._connectionManager.getConnection(server) if connection is not None: self.log.debug("Sending Request Completed", level=3) refId = connection.getRefId() if refId is None else refId completed = ResponseFactory.requestCompleted(refId) connection.injectObjectToOutputStream(completed) # Reset the connection context if resetContext: self._connectionManager.resetConnections()
def completeRequest(self, refId=None, resetContext=True): '''Complete a request to Siri. * refId -- The reference ID ''' server = Directions.From_Server connection = self._connectionManager.getConnection(server) if connection is not None: self.log.debug("Sending Request Completed", level=3) refId = connection.getRefId() if refId is None else refId completed = ResponseFactory.requestCompleted(refId) connection.injectObjectToOutputStream(completed) # Reset the connection context if resetContext: self._connectionManager.resetConnections()
def showDirections(self, directionsType, source, destination, utterance=None): """Show the given type of directions between the two locations to the user. * directionsType -- The type of directions * source -- The source location * destination -- The destination location * utterance -- The utterance to speak """ server = Directions.From_Server connection = self._connectionManager.getConnection(server) if connection is not None: self.log.debug("Making directions [%s]" % directionsType, level=3) refId = connection.getRefId() directions = ResponseFactory.directions(refId, directionsType, source, destination, utterance=utterance) connection.injectObjectToOutputStream(directions)
def say(self, text, spoken=None, prompt=False, refId=None): """Command Siri to speak a piece of text. * text -- The text that Siri will display * spoken -- The text that Siri will speak * prompt -- True to have Siri prompt for a response """ server = Directions.From_Server connection = self._connectionManager.getConnection(server) if connection is not None: self.log.debug("Saying:", level=3, text=text, spoken=spoken, prompt=prompt) refId = connection.getRefId() if refId is None else refId # Create the utterance utterance = ResponseFactory.utterance(refId, text, spoken, prompt) connection.injectObjectToOutputStream(utterance)
def say(self, text, spoken=None, prompt=False, refId=None): '''Command Siri to speak a piece of text. * text -- The text that Siri will display * spoken -- The text that Siri will speak * prompt -- True to have Siri prompt for a response ''' server = Directions.From_Server connection = self._connectionManager.getConnection(server) if connection is not None: self.log.debug("Saying:", level=3, text=text, spoken=spoken, prompt=prompt) refId = connection.getRefId() if refId is None else refId # Create the utterance utterance = ResponseFactory.utterance(refId, text, spoken, prompt) connection.injectObjectToOutputStream(utterance)