diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-15 15:03:18 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-15 15:03:18 +0100 |
commit | 7298099b0263b03ab69871da7b7e32c16a54f60a (patch) | |
tree | 99b6593ae4c602e5f1ee39055b404a3cbd0c4989 /applications/luci-app-freifunk-widgets/luasrc/model | |
parent | 2af6fac809e73e57097572fa6a759156fa0d24eb (diff) |
luci-app-freifunk-widgets: switch to nixio.fs
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'applications/luci-app-freifunk-widgets/luasrc/model')
-rw-r--r-- | applications/luci-app-freifunk-widgets/luasrc/model/cbi/freifunk/widgets/widgets_overview.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/applications/luci-app-freifunk-widgets/luasrc/model/cbi/freifunk/widgets/widgets_overview.lua b/applications/luci-app-freifunk-widgets/luasrc/model/cbi/freifunk/widgets/widgets_overview.lua index 50771d7e0d..7256ba1ff2 100644 --- a/applications/luci-app-freifunk-widgets/luasrc/model/cbi/freifunk/widgets/widgets_overview.lua +++ b/applications/luci-app-freifunk-widgets/luasrc/model/cbi/freifunk/widgets/widgets_overview.lua @@ -11,7 +11,7 @@ You may obtain a copy of the License at ]]-- local uci = require "luci.model.uci".cursor() -local fs = require "luci.fs" +local fs = require "nixio.fs" local utl = require "luci.util" m = Map("freifunk-widgets", translate("Widgets"), translate("Configure installed widgets.")) @@ -37,9 +37,10 @@ function en.cfgvalue(self, section) end local tmpl = wdg:option(ListValue, "template", translate("Template")) -for k, v in ipairs(fs.dir('/usr/lib/lua/luci/view/freifunk/widgets/')) do - if v ~= "." and v ~= ".." then - tmpl:value(v) +local file +for file in fs.dir("/usr/lib/lua/luci/view/freifunk/widgets/") do + if file ~= "." and file ~= ".." then + tmpl:value(file) end end @@ -64,10 +65,11 @@ function m.on_commit(self) table.insert(active, s[".name"]) end end ) - for k, v in ipairs(fs.dir(dir)) do - filename = string.gsub(v, ".html", "") + local file + for file in fs.dir(dir) do + local filename = string.gsub(file, ".html", "") if not utl.contains(active, filename) then - fs.unlink(dir .. v) + fs.unlink(dir .. file) end end end |