Browse Source

[Project] Move rspamadm libraries to a standard place

tags/1.7.6
Vsevolod Stakhov 6 years ago
parent
commit
bb638f7c7d

lualib/rspamadm/ansicolors.lua → lualib/ansicolors.lua View File


lualib/rspamadm/getopt.lua → lualib/getopt.lua View File


lualib/rspamadm/plugins_stats.lua → lualib/plugins_stats.lua View File


lualib/rspamadm/rescore_utility.lua → lualib/rescore_utility.lua View File


+ 2
- 2
lualib/rspamadm/confighelp.lua View File

@@ -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

+ 2
- 2
lualib/rspamadm/configwizard.lua View File

@@ -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 = [[
____ _

+ 1
- 1
lualib/rspamadm/corpus_test.lua View File

@@ -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"

+ 5
- 5
lualib/rspamadm/rescore.lua View File

@@ -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
)
)

Loading…
Cancel
Save