Added metadata fields to scripts that script_manager can access and

display as a tooltip.

Added script_manager integration to those scripts that didn't have it.
This commit is contained in:
Bill Ferguson
2024-05-15 21:23:13 -04:00
parent ac945b9843
commit 55e68f8cd0
70 changed files with 2311 additions and 1610 deletions

View File

@@ -34,10 +34,25 @@ local df = require "lib/dtutils.file"
du.check_min_api_version("7.0.0", "executable_manager")
local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("executable_manager", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end
-- return data structure for script_manager
local script_data = {}
script_data.metadata = {
name = "executable_manager",
purpose = _("manage the list of external executables used by the lua scripts"),
author = "Bill Ferguson <wpferguson@gmail.com>",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/tools/executable_manager"
}
script_data.destroy = nil -- function to destory the script
script_data.destroy_method = nil -- set to hide for libs since we can't destroy them commpletely yet
script_data.restart = nil -- how to restart the (lib) script after it's been hidden - i.e. make it visible again
@@ -45,8 +60,6 @@ script_data.show = nil -- only required for libs since the destroy_method only h
local PS = dt.configuration.running_os == "windows" and "\\" or "/"
local gettext = dt.gettext.gettext
local exec_man = {} -- our own namespace
exec_man.module_installed = false
exec_man.event_registered = false
@@ -55,12 +68,6 @@ exec_man.event_registered = false
-- F U N C T I O N S
-- - - - - - - - - - - - - - - - - - - - - - - - - - - -
gettext.bindtextdomain("executable_manager", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end
local function grep(file, pattern)
local result = {}

View File

@@ -12,6 +12,14 @@ local libname = nil
du.check_min_api_version("3.0.0", "get_lib_manpages")
local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("get_lib_manpages", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end
local function destroy()
-- nothing to destroy
end
@@ -79,6 +87,14 @@ for line in output:lines() do
end
local script_data = {}
script_data.metadata = {
name = "get_lib_manpages",
purpose = _("output the internal library documentation as man pages"),
author = "Bill Ferguson <wpferguson@gmail.com>",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/tools/get_lib_manpages"
}
script_data.destroy = destroy
return script_data

View File

@@ -9,6 +9,14 @@ local du = require "lib/dtutils"
du.check_min_api_version("3.0.0", "get_libdoc")
local gettext = dt.gettext.gettext
dt.gettext.bindtextdomain("get_libdoc", dt.configuration.config_dir .."/lua/locale/")
local function _(msg)
return gettext(msg)
end
local function destroy()
-- nothing to destroy
end
@@ -53,6 +61,14 @@ for line in output:lines() do
end
local script_data = {}
script_data.metadata = {
name = "get_libdoc",
purpose = _("retrieve and print the documentation to the console"),
author = "Bill Ferguson <wpferguson@gmail.com>",
help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/tools/get_libdoc"
}
script_data.destroy = destroy
return script_data