I am trying to make "dropbox" provider work. The retrieved storages have the following attributes (see #5):
2-element Vector{Dict{Symbol, Any}}:
Dict(:kind => "folder", :provider => "osfstorage", :node => "qsabn", :path => "/", :name => "osfstorage")
Dict(:kind => "folder", :provider => "dropbox", :node => "qsabn", :path => "/")
To get the directory reference one would use OSF.directory(proj, "/", storage = "dropbox"), but it would fail due to #5. To overcome the problem I added manually the :name key: storage.attributes[:name] = "dropbox". However, trying to execute API.find_by_path directly the following assertion error is triggered:
|
function find_by_path(osf::Client, root::Entity{:files}, path::String) |
|
if root.attributes[:path] == "/" |
|
@assert root.attributes[:name] == "osfstorage" |
Working code:
import OpenScienceFramework as OSF
client = OSF.Client(view_only = "2a03b6c78ef14922a3e244f3d549de78")
proj = OSF.project(client, "qsabn")
storages = OSF.API.relationship(client, proj.entity, :files).data
storage = only(filter(s -> s.attributes[:provider] == "dropbox", storages))
storage.attributes[:name] = "dropbox"
directory = OSF.Directory(proj, storage, storage)
OSF.readdir(directory)
I am trying to make "dropbox" provider work. The retrieved storages have the following attributes (see #5):
To get the directory reference one would use
OSF.directory(proj, "/", storage = "dropbox"), but it would fail due to #5. To overcome the problem I added manually the:namekey:storage.attributes[:name] = "dropbox". However, trying to executeAPI.find_by_pathdirectly the following assertion error is triggered:OpenScienceFramework.jl/src/helpers.jl
Lines 10 to 12 in 0000000
Working code: