Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Coscine Python SDK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
community features
Coscine Python SDK
Commits
a001af29
Commit
a001af29
authored
1 year ago
by
Nicole Parks
Browse files
Options
Downloads
Patches
Plain Diff
another way to do overwrite True/False
parent
f567587b
No related branches found
No related tags found
1 merge request
!20
Add uption to create (POST) metadata in update_metadata function in the resource class
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/coscine/resource.py
+2
-9
2 additions, 9 deletions
src/coscine/resource.py
with
2 additions
and
9 deletions
src/coscine/resource.py
+
2
−
9
View file @
a001af29
...
...
@@ -625,20 +625,13 @@ class Resource:
self
.
put_metadata
(
metadata
)
assert
isinstance
(
handle
,
IOBase
)
if
overwrite
:
if
overwrite
or
path
not
in
[
f
.
name
for
f
in
self
.
files
()]
:
if
self
.
type
.
general_type
==
"
rdss3
"
:
self
.
_upload_blob_s3
(
path
,
handle
)
else
:
self
.
_upload_blob
(
path
,
handle
,
progress
)
else
:
try
:
self
.
file
(
path
)
print
(
'
File already exists and overwrite is set to False!
'
)
except
NotFoundError
:
if
self
.
type
.
general_type
==
"
rdss3
"
:
self
.
_upload_blob_s3
(
path
,
handle
)
else
:
self
.
_upload_blob
(
path
,
handle
,
progress
)
print
(
'
File already exists and overwrite is set to False!
'
)
def
post_metadata
(
self
,
metadata
:
dict
)
->
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment