コード例 #1
0
    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)
コード例 #2
0
ファイル: manager.py プロジェクト: Alwnikrotikz/pysiriproxy
    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)
コード例 #3
0
    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)
コード例 #4
0
ファイル: manager.py プロジェクト: Alwnikrotikz/pysiriproxy
    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()
コード例 #5
0
    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()
コード例 #6
0
ファイル: manager.py プロジェクト: Alwnikrotikz/pysiriproxy
    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)
コード例 #7
0
ファイル: manager.py プロジェクト: Alwnikrotikz/pysiriproxy
    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)
コード例 #8
0
    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)