When creating a product for the first time, it seems like a standard way of doing that is to specify a source like:
prod = client.new_product(..., sources={'map': {'path': path_as_str, 'description': 'the simulated map'}})
and then the source information is somehow further processed so that path_as_str is promoted to an actual pathlib.Path instance.
But I tried making a revision and revising the path like so:
rev = remote.creat_revision(...)
rev[my_slug] = my_slug_name
rev[my_slug].path = path_as_str
and somehow this bypasses where path_as_str becomes a pathlib.Path instance. This creates an error here because a str does not have an exists method.
The workaround of course was too do:
rev[my_slug] = Path(path_as_str)
instead, but I think it would more user-friendly if the same stuff under-the-hood that converted this from a str to a Path happened automatically.
Actually, perhaps an even nicer thing would be a way to edit/set the sources of the revision by passing a dictionary just like to new_product?
When creating a product for the first time, it seems like a standard way of doing that is to specify a source like:
and then the source information is somehow further processed so that
path_as_stris promoted to an actualpathlib.Pathinstance.But I tried making a revision and revising the path like so:
and somehow this bypasses where
path_as_strbecomes apathlib.Pathinstance. This creates an error here because astrdoes not have anexistsmethod.The workaround of course was too do:
instead, but I think it would more user-friendly if the same stuff under-the-hood that converted this from a
strto aPathhappened automatically.Actually, perhaps an even nicer thing would be a way to edit/set the
sourcesof the revision by passing a dictionary just like tonew_product?