|
33 | 33 | ]]
|
34 | 34 |
|
35 | 35 | local dt = require "darktable"
|
| 36 | +local df = require "lib/dtutils.file" |
36 | 37 | require "official/yield"
|
37 |
| - |
38 | 38 | local gettext = dt.gettext
|
| 39 | + |
39 | 40 | dt.configuration.check_version(...,{3,0,0},{4,0,0})
|
40 | 41 |
|
41 | 42 | -- Tell gettext where to find the .mo file translating messages for a particular domain
|
@@ -73,31 +74,21 @@ local function show_status(storage, image, format, filename, number, total, high
|
73 | 74 | dt.print(string.format(_("Export Image %i/%i"), number, total))
|
74 | 75 | end
|
75 | 76 |
|
76 |
| -local function checkIfBinExists(bin) |
77 |
| - local handle = io.popen("which "..bin) |
78 |
| - local result = handle:read() |
79 |
| - local ret |
80 |
| - handle:close() |
81 |
| - if (not result) then |
82 |
| - dt.print_error(bin.." not found") |
83 |
| - ret = false |
84 |
| - end |
85 |
| - ret = true |
86 |
| - return ret |
87 |
| -end |
88 |
| - |
89 | 77 | local function create_geoJSON_file(storage, image_table, extra_data)
|
90 |
| - |
91 |
| - if not checkIfBinExists("mkdir") then |
| 78 | + if not df.check_if_bin_exists("mkdir") then |
| 79 | + dt.print_error(_("mkdir not found")) |
92 | 80 | return
|
93 | 81 | end
|
94 |
| - if not checkIfBinExists("convert") then |
| 82 | + if not df.check_if_bin_exists("convert") then |
| 83 | + dt.print_error(_("convert not found")) |
95 | 84 | return
|
96 | 85 | end
|
97 |
| - if not checkIfBinExists("xdg-open") then |
| 86 | + if not df.check_if_bin_exists("xdg-open") then |
| 87 | + dt.print_error(_("xdg-open not found")) |
98 | 88 | return
|
99 | 89 | end
|
100 |
| - if not checkIfBinExists("xdg-user-dir") then |
| 90 | + if not df.check_if_bin_exists("xdg-user-dir") then |
| 91 | + dt.print_error(_("xdg-user-dir not found")) |
101 | 92 | return
|
102 | 93 | end
|
103 | 94 |
|
|
0 commit comments