webmcp

view framework/env/execute/_add_filters_by_path.lua @ 148:5354d836e6fb

Minor bugfix in json_newindex function of JSON library (should return nothing)
author jbe
date Wed Jul 30 22:32:33 2014 +0200 (2014-07-30)
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