コード例 #1
0
ファイル: __init__.py プロジェクト: acwagen/alexa-md
import logging
import flask
import flask_ask

# app is a single object used by all the code modules in this package
app = flask.Flask(__name__)
ask = flask_ask.Ask(app, "/")
app.secret_key = 'super secret key'

logging.getLogger("flask_ask").setLevel(logging.DEBUG)

# Tell our app about views.  This is dangerously close to a
# circular import, which is naughty, but Flask was designed that way.
import alexamd.ask
コード例 #2
0
import logging
from functools import wraps
from urllib.parse import urlparse

import flask_ask as ask
import requests

from app import app

from tables.users_table import UsersTable

TUTORIAL_LINK = 'https://www.hackster.io/exp0nge/alexa-doorman-who-is-at-my-door-22b251'

logger = logging.getLogger()

ask_routes = ask.Ask(app, '/alexa/')


@ask_routes.default_intent
def default_intent():
    logger.info('intent not routed')
    logger.info(ask.request)


def link_account_response():
    return ask.statement('Please use the Alexa app to link your Doorman account').link_account_card()


def has_access_token(f):
    # Adapted from [johnwheeler/flask-ask] Decorators for ask.intent (#176)
    @wraps(f)