annotate 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 |
|
rev |
line source |
jbe/bsw@0
|
1 function execute._add_filters_by_path(filter_list, ...)
|
jbe/bsw@0
|
2 local full_path = encode.file_path(request.get_app_basepath(), "app", ...)
|
jbe/bsw@0
|
3 local relative_path = encode.file_path("", ...)
|
jbe@65
|
4 local filter_names = extos.listdir(full_path)
|
jbe/bsw@0
|
5 if filter_names then
|
jbe/bsw@0
|
6 table.sort(filter_names) -- not really neccessary, due to sorting afterwards
|
jbe/bsw@0
|
7 for i, filter_name in ipairs(filter_names) do
|
jbe/bsw@0
|
8 if string.find(filter_name, "%.lua$") then
|
jbe/bsw@0
|
9 if filter_list[filter_name] then
|
jbe/bsw@0
|
10 error('More than one filter is named "' .. filter_name .. '".')
|
jbe/bsw@0
|
11 end
|
jbe/bsw@0
|
12 table.insert(filter_list, filter_name)
|
jbe/bsw@0
|
13 filter_list[filter_name] = function()
|
jbe/bsw@0
|
14 trace.enter_filter{
|
jbe/bsw@0
|
15 path = encode.file_path(relative_path, filter_name)
|
jbe/bsw@0
|
16 }
|
jbe/bsw@0
|
17 execute.file_path{
|
jbe/bsw@0
|
18 file_path = encode.file_path(full_path, filter_name)
|
jbe/bsw@0
|
19 }
|
jbe/bsw@0
|
20 trace.execution_return()
|
jbe/bsw@0
|
21 end
|
jbe/bsw@0
|
22 end
|
jbe/bsw@0
|
23 end
|
jbe/bsw@0
|
24 end
|
jbe/bsw@0
|
25 end
|