Initialize the instance
(self, config_file="", log_level=None)
| 69 | self._s3_resource = self._aws_session.resource("s3") |
| 70 | |
| 71 | def __init__(self, config_file="", log_level=None) -> None: |
| 72 | """ |
| 73 | Initialize the instance |
| 74 | """ |
| 75 | |
| 76 | self._logger = self._log() |
| 77 | if log_level is not None: |
| 78 | self._logger.setLevel(log_level) |
| 79 | |
| 80 | if config_file != "": |
| 81 | self._storage_config_file = config_file |
| 82 | |
| 83 | config = configparser.ConfigParser() |
| 84 | list = config.read(self._storage_config_file) |
| 85 | if len(list) == 0: |
| 86 | self._logger.error("Error: Could not find the config file") |
| 87 | exit(1) |
| 88 | |
| 89 | self._auth_to_amazon(config) |
| 90 | |
| 91 | def write_file(self, folder: str, filename: str, data: bytes) -> bool: |
| 92 | """ |
nothing calls this directly
no test coverage detected