コード例 #1
0
ファイル: cli.py プロジェクト: jaheba/flask-rst
def build(build_destination=None):
    """Create a static version of the site with Frozen-Flask"""
    from flaskext.frozen import Freezer
    if build_destination is not None:
        app.config['FREEZER_DESTINATION'] = build_destination
    else:
        app.config['FREEZER_DESTINATION'] = os.path.join(app.config["SOURCE"],
                                                         "_build")
    freezer = Freezer(app)
    freezer.freeze()
コード例 #2
0
ファイル: cli.py プロジェクト: tony/flask-rst
def build(build_destination=None):
    """Create a static version of the site with Frozen-Flask"""
    try:
        from flaskext.frozen import Freezer
    except ImportError:
        import sys
        sys.exit("To create a static version of the site you need the "
                 "Frozen-Flask package")

    if build_destination is not None:
        current_app.config['FREEZER_DESTINATION'] = build_destination
    else:
        current_app.config['FREEZER_DESTINATION'] = os.path.join(
        current_app.config["SOURCE"], "_build")

    freezer = Freezer(current_app)
    freezer.freeze()