changeset 152:8d956bd94ad2

Better combine user sources/routes with the default ones.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 04 Dec 2014 12:49:35 -0800
parents fd146f54bdaa
children 1c3d229158ba
files piecrust/app.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/app.py	Mon Dec 01 22:01:43 2014 -0800
+++ b/piecrust/app.py	Thu Dec 04 12:49:35 2014 -0800
@@ -261,13 +261,18 @@
                         'func': 'pccaturl(category)'})
 
             # If the user defined some additional sources/routes/taxonomies,
-            # append them to the default ones.
+            # add them to the default ones. For routes, the order matters,
+            # though, so we make sure to add the user routes at the front
+            # of the list so they're evaluated first.
             if orig_sources:
                 sourcesc.update(orig_sources)
+            sitec['sources'] = sourcesc
             if orig_routes:
-                routesc + orig_routes
+                routesc = orig_routes + routesc
+            sitec['routes'] = routesc
             if orig_taxonomies:
                 taxonomiesc.update(orig_taxonomies)
+            sitec['taxonomies'] = taxonomiesc
 
         # Validate sources/routes.
         sourcesc = sitec.get('sources')
@@ -307,6 +312,7 @@
                 raise ConfigurationError("All sources in 'site/sources' must be dictionaries.")
             sc.setdefault('type', 'default')
             sc.setdefault('fs_endpoint', sn)
+            sc.setdefault('ignore_missing_dir', False)
             sc.setdefault('data_endpoint', sn)
             sc.setdefault('data_type', 'iterator')
             sc.setdefault('item_name', sn)