Moved luci.sys.libpath to luci.util
This commit is contained in:
parent
76982655fa
commit
50093ed3d9
7 changed files with 18 additions and 16 deletions
|
@ -3,9 +3,9 @@
|
||||||
START=05
|
START=05
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
cat <<' EOF' | lua -l luci.fs -l luci.sys -
|
cat <<' EOF' | lua -l luci.fs -l luci.util -
|
||||||
if (os.time() < 1000000000) then
|
if (os.time() < 1000000000) then
|
||||||
os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.sys.libpath())))
|
os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.util.libpath())))
|
||||||
end
|
end
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,9 +41,9 @@ function load(cbimap)
|
||||||
require("luci.fs")
|
require("luci.fs")
|
||||||
require("luci.i18n")
|
require("luci.i18n")
|
||||||
require("luci.config")
|
require("luci.config")
|
||||||
require("luci.sys")
|
require("luci.util")
|
||||||
|
|
||||||
local cbidir = luci.sys.libpath() .. "/model/cbi/"
|
local cbidir = luci.util.libpath() .. "/model/cbi/"
|
||||||
local func, err = loadfile(cbidir..cbimap..".lua")
|
local func, err = loadfile(cbidir..cbimap..".lua")
|
||||||
|
|
||||||
if not func then
|
if not func then
|
||||||
|
|
|
@ -24,7 +24,7 @@ limitations under the License.
|
||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
--- LuCI system utilities.
|
--- LuCI Linux and POSIX system utilities.
|
||||||
module("luci.sys", package.seeall)
|
module("luci.sys", package.seeall)
|
||||||
require("posix")
|
require("posix")
|
||||||
require("luci.bits")
|
require("luci.bits")
|
||||||
|
@ -70,12 +70,6 @@ function httpget(url, stream)
|
||||||
return source("wget -qO- '"..url:gsub("'", "").."'")
|
return source("wget -qO- '"..url:gsub("'", "").."'")
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the absolute path to LuCI base directory.
|
|
||||||
-- @return String containing the directory path
|
|
||||||
function libpath()
|
|
||||||
return luci.fs.dirname(require("luci.debug").__file__)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Returns the system load average values.
|
--- Returns the system load average values.
|
||||||
-- @return String containing the average load value 1 minute ago
|
-- @return String containing the average load value 1 minute ago
|
||||||
-- @return String containing the average load value 5 minutes ago
|
-- @return String containing the average load value 5 minutes ago
|
||||||
|
|
|
@ -612,6 +612,13 @@ function execl(command)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Returns the absolute path to LuCI base directory.
|
||||||
|
-- @return String containing the directory path
|
||||||
|
function libpath()
|
||||||
|
return luci.fs.dirname(require("luci.debug").__file__)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Coroutine safe xpcall and pcall versions modified for Luci
|
-- Coroutine safe xpcall and pcall versions modified for Luci
|
||||||
-- original version:
|
-- original version:
|
||||||
|
|
|
@ -201,7 +201,7 @@ end
|
||||||
|
|
||||||
--- Generate the dispatching index using the best possible strategy.
|
--- Generate the dispatching index using the best possible strategy.
|
||||||
function createindex()
|
function createindex()
|
||||||
local path = luci.sys.libpath() .. "/controller/"
|
local path = luci.util.libpath() .. "/controller/"
|
||||||
local suff = ".lua"
|
local suff = ".lua"
|
||||||
|
|
||||||
if luci.util.copcall(require, "luci.fastindex") then
|
if luci.util.copcall(require, "luci.fastindex") then
|
||||||
|
|
|
@ -26,10 +26,10 @@ limitations under the License.
|
||||||
|
|
||||||
--- LuCI translation library.
|
--- LuCI translation library.
|
||||||
module("luci.i18n", package.seeall)
|
module("luci.i18n", package.seeall)
|
||||||
require("luci.sys")
|
require("luci.util")
|
||||||
|
|
||||||
table = {}
|
table = {}
|
||||||
i18ndir = luci.sys.libpath() .. "/i18n/"
|
i18ndir = luci.util.libpath() .. "/i18n/"
|
||||||
loaded = {}
|
loaded = {}
|
||||||
context = luci.util.threadlocal()
|
context = luci.util.threadlocal()
|
||||||
default = "en"
|
default = "en"
|
||||||
|
|
|
@ -30,12 +30,13 @@ module("luci.template", package.seeall)
|
||||||
require("luci.config")
|
require("luci.config")
|
||||||
require("luci.util")
|
require("luci.util")
|
||||||
require("luci.fs")
|
require("luci.fs")
|
||||||
|
require("luci.sys")
|
||||||
require("luci.http")
|
require("luci.http")
|
||||||
|
|
||||||
luci.config.template = luci.config.template or {}
|
luci.config.template = luci.config.template or {}
|
||||||
|
|
||||||
viewdir = luci.config.template.viewdir or luci.sys.libpath() .. "/view"
|
viewdir = luci.config.template.viewdir or luci.util.libpath() .. "/view"
|
||||||
compiledir = luci.config.template.compiledir or luci.sys.libpath() .. "/view"
|
compiledir = luci.config.template.compiledir or luci.util.libpath() .. "/view"
|
||||||
|
|
||||||
|
|
||||||
-- Compile modes:
|
-- Compile modes:
|
||||||
|
|
Loading…
Reference in a new issue