Created
November 6, 2011 14:43
-
-
Save zeekay/1342973 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CACHE_DIR = 'static' | |
def cache_routes(app): | |
for route in app.routes: | |
path = os.path.join(CACHE_DIR, route.rule[1:]) | |
os.mkdir(path) | |
with open(os.path.join(path, 'index.html'), 'w') as html: | |
html.write(route.call()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment