Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loosolab-s3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Show more breadcrumbs
loosolab
software
loosolab-s3
Commits
8a48b4f2
Commit
8a48b4f2
authored
1 year ago
by
Philipp Goymann
Browse files
Options
Downloads
Plain Diff
Merge branch 'unstabel' into 'master'
add cmd function read_form_dict See merge request
!7
parents
4adc253d
3d833cf9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
add cmd function read_form_dict
Pipeline
#369213
passed
1 year ago
Stage: build_prod
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loosolab_s3/cmd.py
+22
-4
22 additions, 4 deletions
loosolab_s3/cmd.py
with
22 additions
and
4 deletions
loosolab_s3/cmd.py
+
22
−
4
View file @
8a48b4f2
...
...
@@ -27,7 +27,17 @@ def run_s3_functions():
s3
=
Loosolab_s3
(
credentials
,
logger
=
False
)
else
:
s3
=
Loosolab_s3
(
credentials
)
if
args
.
read_form_dict
:
bucket_dict
=
args
.
read_form_dict
bucketname
=
bucket_dict
.
split
(
'
:
'
)[
0
]
files
=
[
bucket_dict
.
split
(
'
:
'
)[
1
]]
if
args
.
bucketname
:
bucketname
=
args
.
bucketname
if
args
.
files
:
files
=
args
.
files
#------------------------------------------------actions--------------------------------------------#
#check if bucket exists
...
...
@@ -40,10 +50,16 @@ def run_s3_functions():
print
(
'
Found bucket
'
+
args
.
bucketname
+
'
: no
'
)
if
args
.
upload
:
utils
.
check_argparser
(
args
,
[
'
secret
'
,
"
key
"
,
"
files
"
,
"
bucketname
"
])
s3
.
upload_s3_objects
(
args
.
bucketname
,
args
.
files
)
if
args
.
read_form_dict
:
utils
.
check_argparser
(
args
,
[
'
secret
'
,
"
key
"
,
"
read_form_dict
"
])
else
:
utils
.
check_argparser
(
args
,
[
'
secret
'
,
"
key
"
,
"
files
"
,
"
bucketname
"
])
s3
.
upload_s3_objects
(
bucketname
,
files
)
if
args
.
download
:
utils
.
check_argparser
(
args
,
[
'
secret
'
,
"
key
"
,
"
files
"
,
"
bucketname
"
])
if
args
.
read_form_dict
:
utils
.
check_argparser
(
args
,
[
'
secret
'
,
"
key
"
,
"
read_form_dict
"
])
else
:
utils
.
check_argparser
(
args
,
[
'
secret
'
,
"
key
"
,
"
files
"
,
"
bucketname
"
])
s3
.
download_s3_objects
(
args
.
bucketname
,
args
.
files
,
destination
=
os
.
getcwd
())
#--------------------------------------------------------------------------------------------------------#
...
...
@@ -62,6 +78,8 @@ def argparsefunc():
parser
.
add_argument
(
"
--bucket_exists
"
,
action
=
'
store_true
'
,
help
=
"
check if bucket exists
"
)
#values
#values
parser
.
add_argument
(
"
--read_form_dict
"
,
help
=
"
Read from dict <bucket_name:file_name>
"
)
parser
.
add_argument
(
"
--files
"
,
nargs
=
'
+
'
,
help
=
"
bucket upload files
"
)
parser
.
add_argument
(
"
--bucketname
"
)
parser
.
add_argument
(
"
--no_log
"
,
action
=
'
store_true
'
,
help
=
'
disable logging
'
)
...
...
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