Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
eossr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ESCAPE2020
WP3
eossr
Merge requests
!57
eossr upload unique function
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
eossr upload unique function
eossr_upload
into
master
Overview
18
Commits
63
Pipelines
41
Changes
3
Merged
Vuillaume
requested to merge
eossr_upload
into
master
3 years ago
Overview
17
Commits
63
Pipelines
41
Changes
3
Expand
unique function to upload to the ossr regardless of new record or new version
unit test
update doc and snippets
check if the record does not already exist in case record id not passed
remove previous scripts and snippets
Edited
3 years ago
by
Enrique Garcia
0
0
Merge request reports
Viewing commit
0a62ae30
Prev
Next
Show latest version
3 files
+
22
−
30
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
0a62ae30
common function to upload directory content
· 0a62ae30
vuillaut
authored
3 years ago
eossr/api/zenodo/__init__.py
+
13
−
0
Options
@@ -138,6 +138,19 @@ class ZenodoAPI:
return
upload
def
upload_dir_content
(
self
,
directory
,
record_id
):
for
full_path_file
in
Path
(
directory
).
iterdir
():
new_upload
=
self
.
upload_file_entry
(
record_id
,
name_file
=
full_path_file
.
name
,
path_file
=
full_path_file
)
http_status
.
ZenodoHTTPStatus
(
new_upload
.
status_code
,
new_upload
.
json
())
print
(
f
"
* File
{
full_path_file
.
name
}
correctly uploaded
"
)
# TODO: add logging for each file
def
update_metadata_entry
(
self
,
entry_id
,
json_metadata
):
"""
Update an entry resource. Data should be the entry information that will be shown when a deposition is visited
Loading