Files
wtforms-parsleyjs/generate_static_pages.py
T
2016-01-24 07:34:44 +08:00

19 lines
611 B
Python

from wtformsparsleyjs.sample.sample import app
from flask_frozen import Freezer
import shutil
from os.path import join
freezer = Freezer(app)
if __name__ == '__main__':
# rebuild static files using flask_frozen
app.config['FREEZER_BASE_URL']='/wtforms-parsleyjs/'
freezer.freeze()
# copy result to index.html
shutil.copy( join('wtformsparsleyjs', 'sample', 'build', 'parsley_testform'), 'index.html')
try:
shutil.copytree( join('wtforms-parsleyjs', 'sample', 'build', 'static'), 'static')
except OSError:
print("Please delete the root 'static' folder to redo it")