webmcp

view framework/env/execute/_add_filters_by_path.lua @ 7:f7413a1a872c

Tags for v1.0.0 to v1.0.6 added
author jbe
date Sat Jan 30 12:41:37 2010 +0100 (2010-01-30)
parents 9fdfb27f8e67
children a54cc7dcabf1
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 = os.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