You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like the "go" command pauses script execution to wait for a download and then resumes it afterwards, make the download command work the same way, and maybe even change it into a url "foo:///bar/baz" function.
The command's instruction would start the download, call LEOPauseContext(), and from the download completion block call LEOResumeContext(). When it is then called again, it would see that from the kLEOContextResuming flag and instead of starting another download would return the file contents and/or set the result to any error information.
The text was updated successfully, but these errors were encountered:
Open questions: What do we do with headers, progress reporting etc.? Do we keep the download command for that? Do we save the headers & status codes in a local variable the downloads that can be accessed after the url function finishes? Do we call a downloadProgress handler so another part of the script can at least display progress?
Progress reporting could probably done by calling an optional closure, syntax maybe:
put url "http://example.com"for progress take percentage thenput"Downloading:"&& percentage
if status ofthe download is not200then
answer "Error downloading: "&&the statusMessage ofthe download
end if
That way we don't duplicate stuff and can get rid of the download command.
Like the "go" command pauses script execution to wait for a download and then resumes it afterwards, make the
download
command work the same way, and maybe even change it into aurl "foo:///bar/baz"
function.The command's instruction would start the download, call
LEOPauseContext()
, and from the download completion block callLEOResumeContext()
. When it is then called again, it would see that from thekLEOContextResuming
flag and instead of starting another download would return the file contents and/or setthe result
to any error information.The text was updated successfully, but these errors were encountered: