Skip to content
Snippets Groups Projects
Commit fa7a3b42 authored by edupin's avatar edupin
Browse files

correct maap-s3.py and fix Gdal version

parent bc4adbd2
No related branches found
No related tags found
No related merge requests found
Pipeline #1114 failed with stages
in 9 minutes and 5 seconds
#zip -r Project_template.zip Project_template #zip -r Project_template.zip Project_template
export VERSION=0.4 export VERSION=0.5
docker build -t kosted/bmap-stack:$VERSION . docker build -t kosted/bmap-stack:$VERSION .
docker run --rm kosted/bmap-stack:$VERSION pip freeze docker run --rm kosted/bmap-stack:$VERSION pip freeze
docker push kosted/bmap-stack:$VERSION docker push kosted/bmap-stack:$VERSION
......
...@@ -34,6 +34,7 @@ def display_help(): ...@@ -34,6 +34,7 @@ def display_help():
print('delete path/in/S3/file.tiff Delete an existing data on S3') print('delete path/in/S3/file.tiff Delete an existing data on S3')
print('refresh Refresh credentials and password') print('refresh Refresh credentials and password')
print('token email password Return a bearer token') print('token email password Return a bearer token')
print('login email password Login the user')
print('resume Resume last interrupted multipart upload') print('resume Resume last interrupted multipart upload')
sys.exit(2) sys.exit(2)
...@@ -78,6 +79,17 @@ def refresh(): ...@@ -78,6 +79,17 @@ def refresh():
generate_token(email, password) generate_token(email, password)
###################################
# Login using email dans password #
###################################
def login(email, password):
if email and password:
print("[INFO] Get an existing or fresh token")
#Function to generate a new token
generate_token(email, password)
else:
print("[ERROR] Please check your email or password")
########################### ###########################
# Generate token and save # # Generate token and save #
########################### ###########################
...@@ -524,7 +536,13 @@ try: ...@@ -524,7 +536,13 @@ try:
if len(argv) != 3: if len(argv) != 3:
display_help() display_help()
else: else:
get_token(argv[1], argv[2]) get_token(argv[1], argv[2])
elif argv[0] == 'login':
# Delete a data
if len(argv) != 3:
display_help()
else:
login(argv[1], argv[2])
elif argv[0] == 'download': elif argv[0] == 'download':
# Download a data # Download a data
if len(argv) != 3: if len(argv) != 3:
...@@ -550,4 +568,4 @@ except getopt.GetoptError: ...@@ -550,4 +568,4 @@ except getopt.GetoptError:
print('The wrong option is provided. Please run -h') print('The wrong option is provided. Please run -h')
# Terminate the script # Terminate the script
sys.exit(2) sys.exit(2)
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment