예제 #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()