Ejemplo n.º 1
0
    def __init__(self, buttonText, command):
        '''
        * buttonText -- The text displayed on the button
        * command -- The command that is executed when the button is pressed

        '''
        action = Actions.create(Actions.CustomCommand, command)
        _Button.__init__(self, buttonText, [action])
Ejemplo n.º 2
0
    def __init__(self, buttonText, query):
        '''
        * buttonText -- The text displayed on the button
        * query -- The search query to perform

        '''
        action = Actions.create(Actions.WebSearch, query)
        _Button.__init__(self, buttonText, [action])
Ejemplo n.º 3
0
    def action(cls, actionType, *args, **kwargs):
        '''Create a :class:`.SiriObject` :class:`.Action` of the specific type.

        * actionType -- The type of action to create
        * args -- The arguments
        * kwargs -- The keyword arguments

        '''
        return Actions.create(actionType, *args, **kwargs)