def populate_apps(intent, session): """Populate DB with already installed apps""" session_attributes = {} card_title = intent['name'] speech_output = "" # do we need this? reprompt_text = "" should_end_session = False app = App() try: app.populate() except: speech_output = "Failure occured while connecting, please try again." return build_response( session_attributes, build_speechlet_response(card_title, speech_output, reprompt_text, should_end_session))
def add_app(intent, session): """Searches for a folder """ session_attributes = {} card_title = intent['name'] speech_output = "Success" # do we need this? reprompt_text = "" should_end_session = False app = App() try: app.add("Open AppStore :)") except: speech_output = "Failure occured while connecting, please try again." return build_response( session_attributes, build_speechlet_response(card_title, speech_output, reprompt_text, should_end_session))
def search_app(intent, session): """Searches for a folder """ session_attributes = {} card_title = intent['name'] speech_output = "" # do we need this? reprompt_text = "" should_end_session = False app_name = intent["slots"]["appName"]["value"] app = App() try: app.search(app_name) except: speech_output = "Failure occured while connecting, please try again." return build_response( session_attributes, build_speechlet_response(card_title, speech_output, reprompt_text, should_end_session))