diff --git a/contrib/autostyle.lua b/contrib/autostyle.lua index 319b8f3..336e6f7 100644 --- a/contrib/autostyle.lua +++ b/contrib/autostyle.lua @@ -69,7 +69,7 @@ script_data.show = nil -- only required for libs since the destroy_method only h -- run command and retrieve stdout local function get_stdout(cmd) -- Open the command, for reading - local fd = assert(syslib.io_popen(cmd, 'r')) + local fd = assert(io.popen(cmd, 'r')) darktable.control.read(fd) -- slurp the whole file local data = assert(fd:read('*a')) @@ -188,4 +188,4 @@ darktable.register_event("autostyle", "post-import-image", script_data.destroy = destroy -return script_data \ No newline at end of file +return script_data diff --git a/contrib/color_profile_manager.lua b/contrib/color_profile_manager.lua index d87d9a6..52fc38c 100644 --- a/contrib/color_profile_manager.lua +++ b/contrib/color_profile_manager.lua @@ -107,7 +107,7 @@ end local function list_profiles(dir) local files = {} - local p = dtsys.io_popen(DIR_CMD .. " " .. dir) + local p = io.popen(DIR_CMD .. " " .. dir) if p then for line in p:lines() do table.insert(files, line) diff --git a/contrib/fujifilm_dynamic_range.lua b/contrib/fujifilm_dynamic_range.lua index ad7b2bb..6116d35 100644 --- a/contrib/fujifilm_dynamic_range.lua +++ b/contrib/fujifilm_dynamic_range.lua @@ -106,7 +106,7 @@ local function detect_dynamic_range(event, image) -- without -n flag, exiftool will round to the nearest tenth command = command .. " -RawExposureBias -n -t " .. RAF_filename dt.print_log(command) - output = dtsys.io_popen(command) + output = io.popen(command) local raf_result = output:read("*all") output:close() if #raf_result == 0 then diff --git a/contrib/fujifilm_ratings.lua b/contrib/fujifilm_ratings.lua index b2f11fe..049e3c2 100644 --- a/contrib/fujifilm_ratings.lua +++ b/contrib/fujifilm_ratings.lua @@ -65,7 +65,7 @@ local function detect_rating(event, image) local JPEG_filename = string.gsub(RAF_filename, "%.RAF$", ".JPG") local command = "exiftool -Rating " .. JPEG_filename dt.print_log(command) - local output = dtsys.io_popen(command) + local output = io.popen(command) local jpeg_result = output:read("*all") output:close() if string.len(jpeg_result) > 0 then @@ -76,7 +76,7 @@ local function detect_rating(event, image) end command = "exiftool -Rating " .. RAF_filename dt.print_log(command) - output = dtsys.io_popen(command) + output = io.popen(command) local raf_result = output:read("*all") output:close() if string.len(raf_result) > 0 then diff --git a/contrib/geoJSON_export.lua b/contrib/geoJSON_export.lua index 406c37c..2ff3080 100644 --- a/contrib/geoJSON_export.lua +++ b/contrib/geoJSON_export.lua @@ -331,7 +331,7 @@ dt.preferences.register("geoJSON_export", _("opens the geoJSON file after the export with the standard program for geoJSON files"), false ) -local handle = dtsys.io_popen("xdg-user-dir DESKTOP") +local handle = io.popen("xdg-user-dir DESKTOP") local result = handle:read() handle:close() if (result == nil) then diff --git a/contrib/geoToolbox.lua b/contrib/geoToolbox.lua index d654eeb..68fdc3c 100644 --- a/contrib/geoToolbox.lua +++ b/contrib/geoToolbox.lua @@ -412,7 +412,7 @@ local function reverse_geocode() -- jq could be replaced with a Lua JSON parser startCommand = string.format("curl --silent \"https://api.mapbox.com/geocoding/v5/mapbox.places/%s,%s.json?types=%s&access_token=%s\" | jq '.features | .[0] | '.text''", lon1, lat1, types, tokan) - local handle = dtsys.io_popen(startCommand) + local handle = io.popen(startCommand) local result = trim12(handle:read("*a")) handle:close() diff --git a/contrib/image_stack.lua b/contrib/image_stack.lua index ba0909b..c63ff16 100644 --- a/contrib/image_stack.lua +++ b/contrib/image_stack.lua @@ -348,7 +348,7 @@ local function list_files(search_string) search_string = string.gsub(search_string, "/", "\\\\") end - local f = dtsys.io_popen(ls .. search_string) + local f = io.popen(ls .. search_string) if f then local found_file = f:read() while found_file do diff --git a/contrib/image_time.lua b/contrib/image_time.lua index fa00b57..a35f751 100644 --- a/contrib/image_time.lua +++ b/contrib/image_time.lua @@ -226,7 +226,7 @@ local function get_image_taken_time(image) local exiv2 = df.check_if_bin_exists("exiv2") if exiv2 then - p = dtsys.io_popen(exiv2 .. " -K Exif.Image.DateTime " .. image.path .. PS .. image.filename) + p = io.popen(exiv2 .. " -K Exif.Image.DateTime " .. image.path .. PS .. image.filename) if p then for line in p:lines() do if string.match(line, "Exif.Image.DateTime") then @@ -244,7 +244,7 @@ end local function _get_windows_image_file_creation_time(image) local datetime = nil - local p = dtsys.io_popen("dir " .. image.path .. PS .. image.filename) + local p = io.popen("dir " .. image.path .. PS .. image.filename) if p then for line in p:lines() do if string.match(line, ds.sanitize_lua(image.filename)) then @@ -265,7 +265,7 @@ end local function _get_nix_image_file_creation_time(image) local datetime = nil - local p = dtsys.io_popen("ls -lL --time-style=full-iso " .. image.path .. PS .. image.filename) + local p = io.popen("ls -lL --time-style=full-iso " .. image.path .. PS .. image.filename) if p then for line in p:lines() do if string.match(line, ds.sanitize_lua(image.filename)) then diff --git a/contrib/kml_export.lua b/contrib/kml_export.lua index ec7218c..ec1aa04 100644 --- a/contrib/kml_export.lua +++ b/contrib/kml_export.lua @@ -343,7 +343,7 @@ if dt.configuration.running_os == "windows" then elseif dt.configuration.running_os == "macos" then defaultDir = os.getenv("HOME") else - local handle = dsys.io_popen("xdg-user-dir DESKTOP") + local handle = io.popen("xdg-user-dir DESKTOP") defaultDir = handle:read() handle:close() end diff --git a/official/enfuse.lua b/official/enfuse.lua index c193c35..c8df51b 100644 --- a/official/enfuse.lua +++ b/official/enfuse.lua @@ -116,7 +116,7 @@ if enfuse_installed then local version = nil - local p = dtsys.io_popen(enfuse_installed .. " --version") + local p = io.popen(enfuse_installed .. " --version") local f = p:read("all") p:close() version = string.match(f, "enfuse (%d.%d)") diff --git a/tools/executable_manager.lua b/tools/executable_manager.lua index 0e28668..ffdf532 100644 --- a/tools/executable_manager.lua +++ b/tools/executable_manager.lua @@ -76,7 +76,7 @@ local function grep(file, pattern) if dt.configuration.running_os == "windows" then -- use find to get the matches local command = "\\windows\\system32\\find.exe " .. "\"" .. pattern .. "\"" .. " " .. file - local f = dtsys.io_popen(command) + local f = io.popen(command) local output = f:read("all") f:close() -- strip out the first line @@ -85,7 +85,7 @@ local function grep(file, pattern) else -- use grep and just return the answers local command = "grep " .. pattern .. " " .. file - local f = dtsys.io_popen(command) + local f = io.popen(command) local output = f:read("all") f:close() result = du.split(output, "\n") diff --git a/tools/get_lib_manpages.lua b/tools/get_lib_manpages.lua index 91d5dbb..a5a7ab9 100644 --- a/tools/get_lib_manpages.lua +++ b/tools/get_lib_manpages.lua @@ -46,7 +46,7 @@ local function output_man(d) mf:close() if df.check_if_bin_exists("groff") then if df.check_if_bin_exists("ps2pdf") then - dtsys.os_execute("groff -man " .. fname .. " | ps2pdf - " .. fname .. ".pdf") + os.execute("groff -man " .. fname .. " | ps2pdf - " .. fname .. ".pdf") else log.msg(log.error, "Missing ps2pdf. Can't generate pdf man pages.") end @@ -60,7 +60,7 @@ end -- find the libraries -local output = dtsys.io_popen("cd "..dt.configuration.config_dir.."/lua/lib ;find . -name \\*.lua -print | sort") +local output = io.popen("cd "..dt.configuration.config_dir.."/lua/lib ;find . -name \\*.lua -print | sort") -- loop through the libraries diff --git a/tools/get_libdoc.lua b/tools/get_libdoc.lua index 2328014..3749a68 100644 --- a/tools/get_libdoc.lua +++ b/tools/get_libdoc.lua @@ -37,7 +37,7 @@ end -- find the libraries -local output = dtsys.io_popen("cd "..dt.configuration.config_dir.."/lua/lib ;find . -name \\*.lua -print | sort") +local output = io.popen("cd "..dt.configuration.config_dir.."/lua/lib ;find . -name \\*.lua -print | sort") -- loop through the libraries diff --git a/tools/script_manager.lua b/tools/script_manager.lua index 40a6962..b39f9e4 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -89,7 +89,7 @@ local MIN_BUTTONS_PER_PAGE = 5 local MAX_BUTTONS_PER_PAGE = 20 local DEFAULT_BUTTONS_PER_PAGE = 10 -local DEFAULT_LOG_LEVEL = log.error +local DEFAULT_LOG_LEVEL = log.debug local LUA_DIR = dt.configuration.config_dir .. PS .. "lua" local LUA_SCRIPT_REPO = "https://github.com/darktable-org/lua-scripts.git" @@ -244,7 +244,7 @@ end local function get_repo_status(repo) local old_log_level = set_log_level(sm.log_level) - local p = dtsys.io_popen("cd " .. repo .. CS .. "git status") + local p = io.popen("cd " .. repo .. CS .. "git status") if p then local data = p:read("*a") @@ -262,7 +262,7 @@ local function get_current_repo_branch(repo) local branch = nil - local p = dtsys.io_popen("cd " .. repo .. CS .. "git branch --all") + local p = io.popen("cd " .. repo .. CS .. "git branch --all") if p then local data = p:read("*a") @@ -292,7 +292,7 @@ local function get_repo_branches(repo) local old_log_level = set_log_level(sm.log_level) local branches = {} - local p = dtsys.io_popen("cd " .. repo .. CS .. "git pull --all" .. CS .. "git branch --all") + local p = io.popen("cd " .. repo .. CS .. "git pull --all" .. CS .. "git branch --all") if p then local data = p:read("*a") @@ -332,7 +332,7 @@ local function checkout_repo_branch(repo, branch) log.msg(log.info, "checkout out branch " .. branch .. " from repository " .. repo) - dtsys.os_execute("cd " .. repo .. CS .. "git checkout " .. branch) + os.execute("cd " .. repo .. CS .. "git checkout " .. branch) restore_log_level(old_log_level) end @@ -668,7 +668,7 @@ local function scan_scripts(script_dir) log.msg(log.debug, "find command is " .. find_cmd) -- scan the scripts - local output = dtsys.io_popen(find_cmd) + local output = io.popen(find_cmd) for line in output:lines() do log.msg(log.debug, "line is " .. line) local l = string.gsub(line, ds.sanitize_lua(LUA_DIR) .. PS, "") -- strip the lua dir off @@ -754,7 +754,7 @@ local function scan_repositories() log.msg(log.debug, "find command is " .. find_cmd) - local output = dtsys.io_popen(find_cmd) + local output = io.popen(find_cmd) for line in output:lines() do local l = string.gsub(line, ds.sanitize_lua(LUA_DIR) .. PS, "") -- strip the lua dir off