]]--
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."))
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
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
local sys = require "luci.sys"
local utl = require "luci.util"
-local fs = require "luci.fs"
+local fs = require "nixio.fs"
local i18n = require "luci.i18n"
local url = data.url
local title = data.title or i18n.translate("RSS")
<% if not url then %>
<%:No url found in config%>
<% else
- local mtime = luci.fs.mtime(cachefile) or 0
+ local mtime = fs.stat(cachefile, "mtime") or 0
local now = os.time()
expire = mtime + cachetime