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
Hi, when adding format and specifying a package that supports the reader and writer for a format, if the reader and writer are in some submodule do I have to qualify the submodule or is the package name adequate? e.g. which of these two possibilities is the correct one?
using FileIO
module ManyLoadersSavers
import FileIO
using FileIO:@format_strfunction load end"""implement loader for a fictional filetype, .FileType"""module FileTypeIO
using Test:@testusing..ManyLoadersSavers
using..ManyLoadersSavers: load
import FileIO
using FileIO:@format_strfunction ManyLoadersSavers.load(f::FileIO.File{format"filetype"})
@test"MagicString"==read(f.filename, String)
endfunction__init__()
FileIO.add_format(format"filetype", (), [".FileType"])
FileIO.add_loader(format"filetype", :ManyLoadersSavers)
endend# artifically pass a module check in FileIOabstract type DummyTypeWithAnyName endload(f::DummyTypeWithAnyName) =error("never gets called")
end# this is what the current check uses
mods =map(m -> m.module, methods(ManyLoadersSavers.load))
@info"here are the modules detected" mods
mktempdir() do dir
# generate test file
fn =joinpath(dir, "asdf.FileType")
open(fn, "w") do fh
write(fh, "MagicString")
end# attempt to load using FileIO@info"Loaded"load(fn)
end
Hi, when adding format and specifying a package that supports the reader and writer for a format, if the reader and writer are in some submodule do I have to qualify the submodule or is the package name adequate? e.g. which of these two possibilities is the correct one?
or
Thanks!
The text was updated successfully, but these errors were encountered: