webmcp

view framework/env/execute/_add_filters_by_path.lua @ 205:48ee8826efbe

Correct handling of nil's in return tuples in execute.chunk{...}
author jbe
date Fri Jan 09 21:32:23 2015 +0100 (2015-01-09)
parents a54cc7dcabf1
children
line source
1 function execute._add_filters_by_path(filter_list, ...)
2 local full_path = encode.file_path(request.get_app_basepath(), "app", ...)
3 local relative_path = encode.file_path("", ...)
4 local filter_names = extos.listdir(full_path)
5 if filter_names then
6 table.sort(filter_names) -- not really neccessary, due to sorting afterwards
7 for i, filter_name in ipairs(filter_names) do
8 if string.find(filter_name, "%.lua$") then
9 if filter_list[filter_name] then
10 error('More than one filter is named "' .. filter_name .. '".')
11 end
12 table.insert(filter_list, filter_name)
13 filter_list[filter_name] = function()
14 trace.enter_filter{
15 path = encode.file_path(relative_path, filter_name)
16 }
17 execute.file_path{
18 file_path = encode.file_path(full_path, filter_name)
19 }
20 trace.execution_return()
21 end
22 end
23 end
24 end
25 end

Impressum / About Us