Mercurial > piecrust2
comparison piecrust/data/builder.py @ 847:71c4f43d8fc1
data: Don't add route functions or data providers that happen to be null.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 27 Apr 2017 20:53:18 -0700 |
parents | a12ad254176e |
children | 4850f8c21b6e |
comparison
equal
deleted
inserted
replaced
846:148ce9bf8664 | 847:71c4f43d8fc1 |
---|---|
49 'family': linker | 49 'family': linker |
50 } | 50 } |
51 | 51 |
52 for route in app.routes: | 52 for route in app.routes: |
53 name = route.func_name | 53 name = route.func_name |
54 if not name: | |
55 continue | |
56 | |
54 func = data.get(name) | 57 func = data.get(name) |
55 if func is None: | 58 if func is None: |
56 func = CompositeRouteFunction() | 59 func = CompositeRouteFunction() |
57 func.addFunc(route) | 60 func.addFunc(route) |
58 data[name] = func | 61 data[name] = func |