aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-05-24 14:13:32 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-05-24 19:56:05 +0100
commitbb638f7c7d851f20071f5f9ee77224c0173e73ae (patch)
tree25e5dd540a9064e1c189ad17e1c76ef2027db05a
parent08e99bfde4713e6253ce705926851c6639f65437 (diff)
downloadrspamd-bb638f7c7d851f20071f5f9ee77224c0173e73ae.tar.gz
rspamd-bb638f7c7d851f20071f5f9ee77224c0173e73ae.zip
[Project] Move rspamadm libraries to a standard place
-rw-r--r--lualib/ansicolors.lua (renamed from lualib/rspamadm/ansicolors.lua)0
-rw-r--r--lualib/getopt.lua (renamed from lualib/rspamadm/getopt.lua)0
-rw-r--r--lualib/plugins_stats.lua (renamed from lualib/rspamadm/plugins_stats.lua)0
-rw-r--r--lualib/rescore_utility.lua (renamed from lualib/rspamadm/rescore_utility.lua)0
-rw-r--r--lualib/rspamadm/confighelp.lua4
-rw-r--r--lualib/rspamadm/configwizard.lua4
-rw-r--r--lualib/rspamadm/corpus_test.lua2
-rw-r--r--lualib/rspamadm/rescore.lua10
8 files changed, 10 insertions, 10 deletions
diff --git a/lualib/rspamadm/ansicolors.lua b/lualib/ansicolors.lua
index 81783f618..81783f618 100644
--- a/lualib/rspamadm/ansicolors.lua
+++ b/lualib/ansicolors.lua
diff --git a/lualib/rspamadm/getopt.lua b/lualib/getopt.lua
index 20715c387..20715c387 100644
--- a/lualib/rspamadm/getopt.lua
+++ b/lualib/getopt.lua
diff --git a/lualib/rspamadm/plugins_stats.lua b/lualib/plugins_stats.lua
index 5c9797a9e..5c9797a9e 100644
--- a/lualib/rspamadm/plugins_stats.lua
+++ b/lualib/plugins_stats.lua
diff --git a/lualib/rspamadm/rescore_utility.lua b/lualib/rescore_utility.lua
index 2a9372d4e..2a9372d4e 100644
--- a/lualib/rspamadm/rescore_utility.lua
+++ b/lualib/rescore_utility.lua
diff --git a/lualib/rspamadm/confighelp.lua b/lualib/rspamadm/confighelp.lua
index a03578b6e..8f0fd2b7d 100644
--- a/lualib/rspamadm/confighelp.lua
+++ b/lualib/rspamadm/confighelp.lua
@@ -7,8 +7,8 @@ local known_attrs = {
default = 1,
}
-local getopt = require "rspamadm/getopt"
-local ansicolors = require "rspamadm/ansicolors"
+local getopt = require "getopt"
+local ansicolors = require "ansicolors"
local function maybe_print_color(key)
if not opts['no-color'] then
diff --git a/lualib/rspamadm/configwizard.lua b/lualib/rspamadm/configwizard.lua
index 1cd275f66..542b61552 100644
--- a/lualib/rspamadm/configwizard.lua
+++ b/lualib/rspamadm/configwizard.lua
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
]]--
-local ansicolors = require "rspamadm/ansicolors"
+local ansicolors = require "ansicolors"
local local_conf = rspamd_paths['CONFDIR']
local rspamd_util = require "rspamd_util"
local rspamd_logger = require "rspamd_logger"
@@ -23,7 +23,7 @@ local lua_stat_tools = require "lua_stat"
local lua_redis = require "lua_redis"
local ucl = require "ucl"
-local plugins_stat = require "rspamadm/plugins_stats"
+local plugins_stat = require "plugins_stats"
local rspamd_logo = [[
____ _
diff --git a/lualib/rspamadm/corpus_test.lua b/lualib/rspamadm/corpus_test.lua
index cd9f66155..71d1eeaf1 100644
--- a/lualib/rspamadm/corpus_test.lua
+++ b/lualib/rspamadm/corpus_test.lua
@@ -1,7 +1,7 @@
local rspamd_logger = require "rspamd_logger"
local ucl = require "ucl"
local lua_util = require "lua_util"
-local getopt = require "rspamadm/getopt"
+local getopt = require "getopt"
local HAM = "HAM"
local SPAM = "SPAM"
diff --git a/lualib/rspamadm/rescore.lua b/lualib/rspamadm/rescore.lua
index 231cf2ea6..e6df3b364 100644
--- a/lualib/rspamadm/rescore.lua
+++ b/lualib/rspamadm/rescore.lua
@@ -3,11 +3,11 @@ local nn = require "nn"
local lua_util = require "lua_util"
local ucl = require "ucl"
local logger = require "rspamd_logger"
-local getopt = require "rspamadm/getopt"
+local getopt = require "getopt"
local optim = require "optim"
local rspamd_util = require "rspamd_util"
-local rescore_utility = require "rspamadm/rescore_utility"
+local rescore_utility = require "rescore_utility"
local opts
local ignore_symbols = {
@@ -473,8 +473,8 @@ return function (args, cfg)
"NAME", "HITS", "HAM", "HAM%", "SPAM", "SPAM%", "S/O", "OVER%"))
for _, symbol_stats in pairs(t) do
logger.message(
- string.format("%-40s %6d %6d %6.2f %6d %6.2f %6.2f %6.2f",
- symbol_stats.name,
+ string.format("%-40s %6d %6d %6.2f %6d %6.2f %6.2f %6.2f",
+ symbol_stats.name,
symbol_stats.no_of_hits,
symbol_stats.ham_hits,
lua_util.round(symbol_stats.ham_percent,2),
@@ -503,7 +503,7 @@ return function (args, cfg)
-- Calculate percentage of rules with no hits
local nhpct = lua_util.round((#symbols_no_hits/total_symbols)*100,2)
logger.message(
- string.format('\nFound %s (%-.2f%%) symbols out of %s with no hits in corpus:',
+ string.format('\nFound %s (%-.2f%%) symbols out of %s with no hits in corpus:',
#symbols_no_hits, nhpct, total_symbols
)
)