webmcp

view framework/env/execute/_add_filters_by_path.lua @ 65:a54cc7dcabf1

"extos" library calls via "extos." instead of "os."
author jbe
date Tue Apr 17 15:20:42 2012 +0200 (2012-04-17)
parents 9fdfb27f8e67
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