Skip to content
Snippets Groups Projects
Commit f7882dab authored by marina.kiweler01's avatar marina.kiweler01
Browse files

logging, get_session, download_file

parent 59f0aee3
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
"""
Class containing non s3 related, basic functions for Loosolab_s3
"""
import random
class Utils:
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
#--------------------------------------------------------------------------------------------------------#
def waiting_points(self, message):
""" loading bar
Parameter:
----------
message : string
"""
time.sleep(0.25)
print(message + ' {0}'.format('. '), end='\r')
time.sleep(0.25)
print(message + ' {0}'.format('.. '), end='\r')
time.sleep(0.25)
print(message + ' {0}'.format('... '), end='\r')
time.sleep(0.25)
print(message + ' {0}'.format('....'), end='\r')
#--------------------------------------------------------------------------------------------------------#
def create_random(charamount):
""" create random string
Parameter:
----------
charamount : int
lenght of random string
Returns:
--------
string
"""
empty_string = ''
random_str = empty_string.join(random.choice(string.ascii_lowercase + string.digits) for char in range(charamount))
return(random_str)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment