From 664496b430ffbed166a26d647bf40e603e520782 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Tue, 2 Jan 2018 19:51:14 -0500 Subject: [PATCH] Updated to api 5.0.0 and tested. include_all.lua changed to load official/yield and ignore the lib and tools directories. --- include_all.lua | 13 ++++++++++--- tools/get_lib_manpages.lua | 2 +- tools/get_libdoc.lua | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include_all.lua b/include_all.lua index cbe3b2b..c25dd54 100644 --- a/include_all.lua +++ b/include_all.lua @@ -1,6 +1,7 @@ --[[ This file is part of darktable, copyright (c) 2014 Jérémy Rosen + copyright (c) 2018 Bill Ferguson darktable is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,14 +34,20 @@ Note that you need to restart DT for your changes to enabled scripts to take eff ]] local dt = require "darktable" local io = require "io" -dt.configuration.check_version(...,{3,0,0}) -local output = io.popen("cd "..dt.configuration.config_dir.."/lua ;find . -name \\*.lua -print") +-- must be loaded for scripts using darktable.control_execute to work +require "official/yield" + +dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0}) + +-- find all scripts, but skip the lib and tools directories +local output = io.popen("cd "..dt.configuration.config_dir.."/lua ;find . -name lib -prune -o -name tools -prune -o -name \\*.lua -print") + local my_name={...} my_name = my_name[1] for line in output:lines() do local req_name = line:sub(3,-5) - if req_name ~= my_name then + if req_name ~= my_name and not string.match(req_name, "yield") then dt.preferences.register(my_name,req_name,"bool","enable "..req_name, "Should the script "..req_name.." be enabled at next startup",false) diff --git a/tools/get_lib_manpages.lua b/tools/get_lib_manpages.lua index 23400aa..cea3bbc 100644 --- a/tools/get_lib_manpages.lua +++ b/tools/get_lib_manpages.lua @@ -10,7 +10,7 @@ local df = require "lib/dtutils.file" local log = require "lib/dtutils.log" local libname = nil -dt.configuration.check_version(...,{3,0,0}) +dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0}) local keys = {"Name", "Synopsis", "Usage", "Description", "Return_Value", "Limitations", "Example", "See_Also", "Reference", "License", "Copyright"} diff --git a/tools/get_libdoc.lua b/tools/get_libdoc.lua index de6615d..42b19e4 100644 --- a/tools/get_libdoc.lua +++ b/tools/get_libdoc.lua @@ -6,7 +6,7 @@ local dt = require "darktable" -dt.configuration.check_version(...,{3,0,0}) +dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0}) local keys = {"Name", "Synopsis", "Usage", "Description", "Return_Value", "Limitations", "Example", "See_Also", "Reference", "License", "Copyright"}