projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
80a2dd2
)
libs/web: use new parser in non-caching mode
author
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 23 Jul 2009 01:41:06 +0000
(
01:41
+0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 23 Jul 2009 01:41:06 +0000
(
01:41
+0000)
libs/web/luasrc/template.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/template.lua
b/libs/web/luasrc/template.lua
index
4971033
..
7cc6e11
100644
(file)
--- a/
libs/web/luasrc/template.lua
+++ b/
libs/web/luasrc/template.lua
@@
-32,6
+32,7
@@
local string = require "string"
local config = require "luci.config"
local coroutine = require "coroutine"
local nixio = require "nixio", require "nixio.util"
local config = require "luci.config"
local coroutine = require "coroutine"
local nixio = require "nixio", require "nixio.util"
+local tparser = require "luci.template.parser"
local tostring, pairs, loadstring = tostring, pairs, loadstring
local setmetatable, loadfile = setmetatable, loadfile
local tostring, pairs, loadstring = tostring, pairs, loadstring
local setmetatable, loadfile = setmetatable, loadfile
@@
-206,12
+207,7
@@
function Template.__init__(self, name)
end
elseif compiler_mode == "memory" then
end
elseif compiler_mode == "memory" then
- local source
- source, err = fs.readfile(sourcefile) or fs.readfile(sourcefile .. ".htm")
- if source then
- self.template, err = compile(source)
- end
-
+ self.template, _, err = tparser.parse(sourcefile .. ".htm")
end
-- If we have no valid template throw error, otherwise cache the template
end
-- If we have no valid template throw error, otherwise cache the template