mirror of
https://github.com/AR2000AR/openComputers_codes.git
synced 2025-09-09 07:01:14 +02:00
lua diagnostic fix
fixed issue raise by lua diagnostic in vscode
This commit is contained in:
@@ -164,13 +164,15 @@ local function buttonEventHandler(buttonName)
|
||||
end
|
||||
end
|
||||
|
||||
local function diskEventHandler(eName, eAddr, ...)
|
||||
local function diskEventHandler(eName, cAddr, cType)
|
||||
if (cType == "drive") then
|
||||
if (mode == MODE_VIEW_ACCOUNT) then
|
||||
printStatus("Card inserted")
|
||||
voirCompte(nil, component.proxy(eAddr))
|
||||
voirCompte(nil, component.proxy(cAddr))
|
||||
elseif (mode == MODE_CREATE_ACCOUNT_2) then
|
||||
closePopup(diskWaitPopup)
|
||||
creerCompte(component.drive)
|
||||
creerCompte(component.proxy(cAddr))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -297,7 +299,7 @@ local function init()
|
||||
|
||||
intListenerId = event.listen("interrupted", closeClient)
|
||||
touchListenerId = event.listen("touch", function(...) screen:trigger(...) end)
|
||||
driveListenerId = event.listen("component_added", diskEventHandler, nil, "drive")
|
||||
driveListenerId = event.listen("component_added", diskEventHandler)
|
||||
magDataListenerId = event.listen("magData", magDataEventHandler)
|
||||
end
|
||||
|
||||
|
@@ -55,6 +55,7 @@ local function parseFolders(pack, repo, info)
|
||||
error(reason, 2)
|
||||
end
|
||||
repeat
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
os.sleep(0)
|
||||
local s, c, reason = pcall(result.finishConnect)
|
||||
if (not s) then
|
||||
@@ -76,6 +77,7 @@ local function parseFolders(pack, repo, info)
|
||||
elseif (#data > 0) then
|
||||
sContent = sContent .. data
|
||||
end
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
os.sleep(0)
|
||||
until data == nil --eof
|
||||
return sContent, status, headers
|
||||
@@ -91,6 +93,7 @@ local function parseFolders(pack, repo, info)
|
||||
if (tonumber(headers["X-RateLimit-Remaining"][1]) == 0) then
|
||||
print(string.format("No more API request available. More call will be possible at %s", os.date("%H:%M:%S", headers["X-RateLimit-Reset"])))
|
||||
print("Waiting 1 minute")
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
os.sleep(60)
|
||||
end
|
||||
until tonumber(headers["X-RateLimit-Remaining"][1]) > 0
|
||||
@@ -111,7 +114,7 @@ local function parseFolders(pack, repo, info)
|
||||
return nil
|
||||
end
|
||||
assert(filestring)
|
||||
return serial.unserialize(filestring:gsub("%[", "{"):gsub("%]", "}"):gsub("(\"[^%s,]-\")%s?:", "[%1] = "), nil)
|
||||
return serial.unserialize(filestring:gsub("%[", "{"):gsub("%]", "}"):gsub("(\"[^%s,]-\")%s?:", "[%1] = "))
|
||||
end
|
||||
|
||||
local function nonSpecial(text)
|
||||
|
Reference in New Issue
Block a user