summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorAlexander Poslavsky <alexander.poslavsky@gmail.com>2007-11-02 11:51:24 +0000
committerAlexander Poslavsky <alexander.poslavsky@gmail.com>2007-11-02 11:51:24 +0000
commitc54a2aafc967f0e599f6dbb6e4eef0ea1cd50bd4 (patch)
treebf4c439869027cc8f579c99372fa4204e16dde51 /app
parentae123823b4940f2145439256f4df4f408ca1486b (diff)
downloadacf-core-c54a2aafc967f0e599f6dbb6e4eef0ea1cd50bd4.tar.bz2
acf-core-c54a2aafc967f0e599f6dbb6e4eef0ea1cd50bd4.tar.xz
general cfg parser
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@257 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'app')
-rw-r--r--app/cfgfile-model.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/cfgfile-model.lua b/app/cfgfile-model.lua
index e5423d8..281ee2c 100644
--- a/app/cfgfile-model.lua
+++ b/app/cfgfile-model.lua
@@ -47,12 +47,15 @@ local function getLbuStatus()
return ret
end
-function list(self, app)
+--TODO this 'filter' breaks model isolation by requring caller to know
+--keys in files[] items. But this way the breakage is at least very obvious,
+--unlike passing these values as an argument to this function.
+function list(self, filter)
loadCfg()
local ret = {}
local lbuStatus = getLbuStatus()
for k,v in pairs(files) do
- if v.app == app then
+ if not filter or filter(v) then
ret[#ret+1] = {
id=k,
app=v.app,