diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-19 00:24:58 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-19 00:24:58 +0000 |
commit | 8fcd841aa9af96c8a4a4d3c1a555d2d1ed42332c (patch) | |
tree | cf6466b373236442e63742cb4f73b22579940784 /libs/cbi/luasrc/cbi.lua | |
parent | 6abba6163290b58cd9ebae98d8459ac38ef52a4b (diff) |
convert luci.fs users to nixio.fs api
Diffstat (limited to 'libs/cbi/luasrc/cbi.lua')
-rw-r--r-- | libs/cbi/luasrc/cbi.lua | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index e513053bab..f3c481cf84 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -30,9 +30,10 @@ require("luci.template") local util = require("luci.util") require("luci.http") require("luci.uvl") -require("luci.fs") + --local event = require "luci.sys.event" +local fs = require("nixio.fs") local uci = require("luci.model.uci") local class = util.class local instanceof = util.instanceof @@ -52,7 +53,7 @@ REMOVE_PREFIX = "cbi.rts." -- Loads a CBI map from given file, creating an environment and returns it function load(cbimap, ...) - require("luci.fs") + local fs = require "nixio.fs" local i18n = require "luci.i18n" require("luci.config") require("luci.util") @@ -60,9 +61,9 @@ function load(cbimap, ...) local upldir = "/lib/uci/upload/" local cbidir = luci.util.libpath() .. "/model/cbi/" - assert(luci.fs.stat(cbimap) or - luci.fs.stat(cbidir..cbimap..".lua") or - luci.fs.stat(cbidir..cbimap..".lua.gz"), + assert(fs.stat(cbimap) or + fs.stat(cbidir..cbimap..".lua") or + fs.stat(cbidir..cbimap..".lua.gz"), "Model not found!") local func, err = loadfile(cbimap) @@ -1703,7 +1704,7 @@ end function FileUpload.cfgvalue(self, section) local val = AbstractValue.cfgvalue(self, section) - if val and luci.fs.access(val) then + if val and fs.access(val) then return val end return nil @@ -1717,7 +1718,7 @@ function FileUpload.formvalue(self, section) then return val end - luci.fs.unlink(val) + fs.unlink(val) self.value = nil end return nil @@ -1725,7 +1726,7 @@ end function FileUpload.remove(self, section) local val = AbstractValue.formvalue(self, section) - if val and luci.fs.access(val) then luci.fs.unlink(val) end + if val and fs.access(val) then fs.unlink(val) end return AbstractValue.remove(self, section) end |