Fix parts of bridge.lua where `t` is used instead of `k` or `v`
This commit is contained in:
parent
4710ea3949
commit
68685698a4
|
@ -415,7 +415,7 @@ return function(_python, _bridged)
|
||||||
function KoboldWorldInfoFolder_mt.__newindex(t, k, v)
|
function KoboldWorldInfoFolder_mt.__newindex(t, k, v)
|
||||||
if not check_validity(t) then
|
if not check_validity(t) then
|
||||||
return
|
return
|
||||||
elseif type(t) == "number" and math.tointeger(t) ~= nil then
|
elseif type(k) == "number" and math.tointeger(k) ~= nil then
|
||||||
error("Cannot write to integer indices of `"..rawget(t, "_name").."`")
|
error("Cannot write to integer indices of `"..rawget(t, "_name").."`")
|
||||||
elseif rawget(t, "_name") == "KoboldWorldInfoFolder" and k == "uid" then
|
elseif rawget(t, "_name") == "KoboldWorldInfoFolder" and k == "uid" then
|
||||||
error("`"..rawget(t, "_name").."."..k.."` is a read-only attribute")
|
error("`"..rawget(t, "_name").."."..k.."` is a read-only attribute")
|
||||||
|
@ -480,7 +480,7 @@ return function(_python, _bridged)
|
||||||
---@param t KoboldWorldInfoFolderSelector
|
---@param t KoboldWorldInfoFolderSelector
|
||||||
---@return KoboldWorldInfoFolder|nil
|
---@return KoboldWorldInfoFolder|nil
|
||||||
function KoboldWorldInfoFolderSelector_mt.__index(t, k)
|
function KoboldWorldInfoFolderSelector_mt.__index(t, k)
|
||||||
if not check_validity(t) or type(t) ~= "number" or math.tointeger(t) == nil or t < 1 or t > _python.builtins.len(bridged.wifolders_l) then
|
if not check_validity(t) or type(k) ~= "number" or math.tointeger(k) == nil or k < 1 or k > _python.builtins.len(bridged.wifolders_l) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local folder = deepcopy(KoboldWorldInfoFolder)
|
local folder = deepcopy(KoboldWorldInfoFolder)
|
||||||
|
@ -491,7 +491,7 @@ return function(_python, _bridged)
|
||||||
---@param t KoboldWorldInfoFolderSelector
|
---@param t KoboldWorldInfoFolderSelector
|
||||||
---@return KoboldWorldInfoFolderSelector
|
---@return KoboldWorldInfoFolderSelector
|
||||||
function KoboldWorldInfoFolderSelector_mt.__newindex(t, k, v)
|
function KoboldWorldInfoFolderSelector_mt.__newindex(t, k, v)
|
||||||
if check_validity(t) or (type(t) == "number" and math.tointeger(t) ~= nil) then
|
if check_validity(t) or (type(k) == "number" and math.tointeger(k) ~= nil) then
|
||||||
error("Cannot write to integer indices of `"..rawget(t, "_name").."`")
|
error("Cannot write to integer indices of `"..rawget(t, "_name").."`")
|
||||||
end
|
end
|
||||||
return rawset(t, k, v)
|
return rawset(t, k, v)
|
||||||
|
@ -611,7 +611,7 @@ return function(_python, _bridged)
|
||||||
---@param v string
|
---@param v string
|
||||||
---@return KoboldLib
|
---@return KoboldLib
|
||||||
function KoboldLib_setters.memory(t, v)
|
function KoboldLib_setters.memory(t, v)
|
||||||
if type(t) ~= "string" then
|
if type(v) ~= "string" then
|
||||||
error("`KoboldLib.memory` must be a string; you attempted to set it to a "..type(v))
|
error("`KoboldLib.memory` must be a string; you attempted to set it to a "..type(v))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue