Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (20 sloc) 0.646 kb
import os
import string
from flask_frozen import Freezer
from examples import app
freezer = Freezer(app)
@freezer.register_generator
def example_url_generator():
out = []
for dirname, dirnames, filenames in os.walk(os.path.join('examples', 'templates')):
if dirnames == []:
parts = string.split(dirname, os.sep)
for f in filenames:
try:
out.append(('example', {'chapter': parts[2], 'name': parts[3], 'file': f}))
except IndexError:
# Ignore
pass
return out
if __name__ == '__main__':
freezer.freeze()
Jump to Line
Something went wrong with that request. Please try again.