Skip to content

Commit 3341745

Browse files
committed
Reverted back to dt.control.execute()
1 parent 6ef0646 commit 3341745

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

contrib/kml_export.lua

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ WARNING
3030
This script is only tested with Linux
3131
3232
USAGE
33+
* require script "official/yield" from your main Lua file in the first line
3334
* require this script from your main Lua file
3435
* when choosing file format, pick JPEG or PNG as Google Earth doesn't support other formats
3536
@@ -202,7 +203,7 @@ local function create_kml_file(storage, image_table, extra_data)
202203
-- Creates dir if not exsists
203204
imageFoldername = "files/"
204205
local mkdirCommand = "mkdir -p "..exportDirectory.."/"..imageFoldername
205-
coroutine.yield("RUN_COMMAND", mkdirCommand)
206+
dt.control.execute(mkdirCommand)
206207
end
207208

208209

@@ -222,8 +223,7 @@ local function create_kml_file(storage, image_table, extra_data)
222223
-- profiles that might be present in the input and aren't needed in the thumbnail.
223224

224225
local convertToThumbCommand = "convert -size 96x96 "..exported_image.." -resize 92x92 -mattecolor \"#FFFFFF\" -frame 2x2 +profile \"*\" "..exportDirectory.."/"..imageFoldername.."thumb_"..filename..".jpg"
225-
-- USE coroutine.yield. It does not block the UI
226-
coroutine.yield("RUN_COMMAND", convertToThumbCommand)
226+
dt.control.execute(convertToThumbCommand)
227227
else
228228
-- Remove exported image if it has no GPS data
229229
os.remove(exported_image)
@@ -341,7 +341,6 @@ local function create_kml_file(storage, image_table, extra_data)
341341
-- Compress the files to create a KMZ file
342342
if ( dt.preferences.read("kml_export","CreateKMZ","bool") == true ) then
343343
exportDirectory = dt.preferences.read("kml_export","ExportDirectory","string")
344-
-- USE coroutine.yield. It does not block the UI
345344

346345
local createKMZCommand = "zip --test --move --junk-paths "
347346
createKMZCommand = createKMZCommand .."\""..exportDirectory.."/"..exportKMZFilename.."\" " -- KMZ filename
@@ -358,7 +357,7 @@ local function create_kml_file(storage, image_table, extra_data)
358357
end
359358
end
360359

361-
coroutine.yield("RUN_COMMAND", createKMZCommand)
360+
dt.control.execute(createKMZCommand)
362361
end
363362

364363
-- Open the file with the standard programm
@@ -370,7 +369,7 @@ local function create_kml_file(storage, image_table, extra_data)
370369
else
371370
kmlFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportKMLFilename.."\""
372371
end
373-
coroutine.yield("RUN_COMMAND", kmlFileOpenCommand)
372+
dt.control.execute(kmlFileOpenCommand)
374373
end
375374

376375

0 commit comments

Comments
 (0)