mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 06:04:21 +01:00
Removes Logger dependency from setup_data_folder
Logger was only used to log when a new folder was created, and was making that the setup needed to be done on the main of pisad and cli instead of __init__, which seems a better fit
This commit is contained in:
@@ -42,17 +42,15 @@ def compute_locator(tx_id):
|
||||
return tx_id[:LOCATOR_LEN_HEX]
|
||||
|
||||
|
||||
def setup_data_folder(data_folder, logger):
|
||||
def setup_data_folder(data_folder):
|
||||
"""
|
||||
Create a data folder for either the client or the server side if the folder does not exists.
|
||||
|
||||
Args:
|
||||
data_folder (:obj:`str`): the path of the folder
|
||||
logger (:obj: `Logger <common.logger.Logger>`): a logger instance to notify about the folder creation.
|
||||
"""
|
||||
|
||||
if not os.path.isdir(data_folder):
|
||||
logger.info("Data folder not found. Creating it")
|
||||
os.makedirs(data_folder, exist_ok=True)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user