diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-15 15:11:57 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-15 15:11:57 +0100 |
commit | 9780ee382e72f8a5fb69e337a3fcc51fc0914883 (patch) | |
tree | ddf4bf749d9a04743dd2027095594166b8aba555 /modules/luci-mod-freifunk | |
parent | 921df0f3fc47720f280c5b758154d69acabb87d1 (diff) |
luci-mod-freifunk: switch to nixio.fs
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules/luci-mod-freifunk')
-rw-r--r-- | modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua | 13 | ||||
-rw-r--r-- | modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua index 8987b1cb4..28f86b623 100644 --- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua +++ b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua @@ -11,7 +11,7 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ]] -local fs = require "luci.fs" +local fs = require "nixio.fs" local util = require "luci.util" local uci = require "luci.model.uci".cursor() local profiles = "/etc/config/profile_" @@ -22,13 +22,10 @@ c = m:section(NamedSection, "community", "public", nil, translate("These are the community = c:option(ListValue, "name", translate ("Community")) community.rmempty = false -local list = { } -local list = fs.glob(profiles .. "*") - -for k,v in ipairs(list) do - local name = uci:get_first(v, "community", "name") or "?" - local n = string.gsub(v, profiles, "") - community:value(n, name) +local profile +for profile in fs.dir(profiles) do + local name = uci:get_first(profile, "community", "name") or "?" + community:value(profile, name) end diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm index 0fcec4597..110a2f09f 100644 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm +++ b/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm @@ -16,7 +16,7 @@ $Id$ <% local uci = require "luci.model.uci".cursor() local tpl = require "luci.template" -local fs = require "luci.fs" +local fs = require "nixio.fs" local ff = {} local ff = uci:get_all("freifunk") |