From 15c17d97328fcc50c40a5551341403919d1687f1 Mon Sep 17 00:00:00 2001 From: garret Date: Thu, 16 Feb 2023 23:33:54 +0000 Subject: add fake aegisub --- make-feed.lua | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/make-feed.lua b/make-feed.lua index be4cde7..bf286d2 100755 --- a/make-feed.lua +++ b/make-feed.lua @@ -148,7 +148,10 @@ local function deepcopy(orig, copies) -- copied and pasted from https://lua-user return copy end +-- fake libraries so scripts don't throw a fit about not having stuff + local noop = function() end +local return_input = function(i) return i end local function fake_depctrl(i) __feedmaker_version = i @@ -175,6 +178,43 @@ local function fake_depctrl(i) } end +local function fake_aegisub() + local aegisub = {} + + aegisub.register_macro = noop + aegisub.register_filter = noop + + aegisub.progress = {} + aegisub.progress.set = noop + aegisub.progress.task = noop + aegisub.progress.title = noop + aegisub.progress.is_cancelled = noop + + aegisub.debug = {} + + aegisub.debug.out = noop + aegisub.log = noop + + aegisub.dialog = {} + + aegisub.dialog.display = noop + aegisub.dialog.open = noop + aegisub.dialog.save = noop + + aegisub.cancel = noop + aegisub.text_extents = noop + aegisub.gettext = return_input + + aegisub.frame_from_ms = noop + aegisub.ms_from_frame = noop + aegisub.video_size = noop + aegisub.keyframes = noop + aegisub.decode_path = noop + aegisub.project_properties = noop + + return aegisub +end + local function sandbox_require(obj) if obj == "l0.DependencyControl" then return fake_depctrl -- cgit v1.2.3-70-g09d2