diff options
Diffstat (limited to '')
| -rw-r--r-- | apt-panopticommon.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index cfea728..53bd674 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua | |||
| @@ -182,8 +182,6 @@ APT.parseArgs = function(args) | |||
| 182 | return arg, sendArgs | 182 | return arg, sendArgs |
| 183 | end | 183 | end |
| 184 | 184 | ||
| 185 | --print(APT.dumpTable(APT.options, "", "options")) | ||
| 186 | |||
| 187 | 185 | ||
| 188 | 186 | ||
| 189 | --[[ Ordered table iterator, allow to iterate on the natural order of the keys of a table. | 187 | --[[ Ordered table iterator, allow to iterate on the natural order of the keys of a table. |
| @@ -232,7 +230,8 @@ function APT.orderedPairs(t) | |||
| 232 | end | 230 | end |
| 233 | 231 | ||
| 234 | -- Use this to dump a table to a string, with HTML. | 232 | -- Use this to dump a table to a string, with HTML. |
| 235 | APT.dumpTableHTML = function (table, space, name) | 233 | APT.dumpTableHTML = function (table, name, space) |
| 234 | if nil == space then space = '' end | ||
| 236 | local r = name .. "\n" | 235 | local r = name .. "\n" |
| 237 | r = r .. dumpTableHTMLSub(table, space .. " ") | 236 | r = r .. dumpTableHTMLSub(table, space .. " ") |
| 238 | r = r .. space .. "" | 237 | r = r .. space .. "" |
| @@ -243,9 +242,9 @@ dumpTableHTMLSub = function (table, space) | |||
| 243 | for k, v in APT.orderedPairs(table) do | 242 | for k, v in APT.orderedPairs(table) do |
| 244 | if type(v) == "table" then | 243 | if type(v) == "table" then |
| 245 | if " " == space then | 244 | if " " == space then |
| 246 | r = r .. space .. APT.dumpTableHTML(v, space, k .. "<ul>") .. "</ul>\n" | 245 | r = r .. space .. APT.dumpTableHTML(v, k .. "<ul>", space) .. "</ul>\n" |
| 247 | else | 246 | else |
| 248 | r = r .. "<li>" .. space .. APT.dumpTableHTML(v, space, k .. "<ul>") .. "</ul></li>\n" | 247 | r = r .. "<li>" .. space .. APT.dumpTableHTML(v, k .. "<ul>", space) .. "</ul></li>\n" |
| 249 | end | 248 | end |
| 250 | else | 249 | else |
| 251 | r = r .. space .. "<li>" .. k .. "</li>\n" | 250 | r = r .. space .. "<li>" .. k .. "</li>\n" |
| @@ -255,7 +254,8 @@ dumpTableHTMLSub = function (table, space) | |||
| 255 | end | 254 | end |
| 256 | 255 | ||
| 257 | -- Use this to dump a table to a string. | 256 | -- Use this to dump a table to a string. |
| 258 | APT.dumpTable = function (table, space, name) | 257 | APT.dumpTable = function (table, name, space) |
| 258 | if nil == space then space = '' end | ||
| 259 | local r = "" | 259 | local r = "" |
| 260 | if "" == space then r = r .. space .. name .. " =\n" else r = r .. space .. "[" .. name .. "] =\n" end | 260 | if "" == space then r = r .. space .. name .. " =\n" else r = r .. space .. "[" .. name .. "] =\n" end |
| 261 | r = r .. space .. "{\n" | 261 | r = r .. space .. "{\n" |
| @@ -268,7 +268,7 @@ dumpTableSub = function (table, space) | |||
| 268 | for k, v in pairs(table) do | 268 | for k, v in pairs(table) do |
| 269 | if type(k) == "string" then k = '"' .. k .. '"' end | 269 | if type(k) == "string" then k = '"' .. k .. '"' end |
| 270 | if type(v) == "table" then | 270 | if type(v) == "table" then |
| 271 | r = r .. APT.dumpTable(v, space, k) | 271 | r = r .. APT.dumpTable(v, k, space) |
| 272 | elseif type(v) == "string" then | 272 | elseif type(v) == "string" then |
| 273 | local bq = '"' | 273 | local bq = '"' |
| 274 | local eq = '"' | 274 | local eq = '"' |
| @@ -331,7 +331,7 @@ APT.logOpen = function(host, a2, a3) | |||
| 331 | APT.logFile:write("<html><head>\n") | 331 | APT.logFile:write("<html><head>\n") |
| 332 | APT.logFile:write("</head><body bgcolor='black' text='white' alink='red' link='blue' vlink='purple'>\n") | 332 | APT.logFile:write("</head><body bgcolor='black' text='white' alink='red' link='blue' vlink='purple'>\n") |
| 333 | APT.logFile:write("<pre>\n") | 333 | APT.logFile:write("<pre>\n") |
| 334 | APT.logFile:write(APT.dumpTable(APT.args, '', 'Arguments')) | 334 | APT.logFile:write(APT.dumpTable(APT.args, 'Arguments')) |
| 335 | APT.logFile:write("</pre>\n") | 335 | APT.logFile:write("</pre>\n") |
| 336 | else | 336 | else |
| 337 | return false | 337 | return false |
