@@ -184,15 +184,20 @@ def _create_lookup(app):
184
184
'default_filters' : app .config ['MAKO_DEFAULT_FILTERS' ],
185
185
'preprocessor' : app .config ['MAKO_PREPROCESSOR' ],
186
186
}
187
- path = os .path .join (app .root_path , app .template_folder )
188
- paths = [path ]
187
+ if isinstance (app .template_folder , (list , tuple )):
188
+ paths = [os .path .join (app .root_path , tf ) for tf in app .template_folder ]
189
+ else :
190
+ paths = [os .path .join (app .root_path , app .template_folder )]
189
191
blueprints = getattr (app , 'blueprints' , {})
190
192
for blueprint in itervalues (blueprints ):
191
- if blueprint .template_folder :
192
- blueprint_template_path = os .path .join (blueprint .root_path ,
193
- blueprint .template_folder )
194
- if os .path .isdir (blueprint_template_path ):
195
- paths .append (blueprint_template_path )
193
+ bp_tf = blueprint .template_folder
194
+ if bp_tf :
195
+ if isinstance (bp_tf , (list , tuple )):
196
+ paths .extend ([os .path .join (blueprint .root_path , tf )
197
+ for tf in bp_tf ])
198
+ else :
199
+ paths .append (os .path .join (blueprint .root_path , bp_tf ))
200
+ paths = [path for path in paths if os .path .isdir (path )]
196
201
return TemplateLookup (directories = paths , ** kw )
197
202
198
203
0 commit comments