# Path: studio/storage/storage_type.py
# class StorageType(Enum):
#     storageHTTP = 1
#     storageS3 = 2
#     storageLocal = 3
#     storageFirebase = 4
#     storageDockerHub = 5
#     storageSHub = 6
# 
#     storageInvalid = 99
# 
# Path: studio/util/util.py
# def get_temp_filename() -> str:
#     return os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))
# 
# def check_for_kb_interrupt():
#     current_exc = sys.exc_info()[1]
#     if current_exc is None:
#         return
#     if isinstance(current_exc, KeyboardInterrupt):
#         raise current_exc
#     return


import os
import uuid
import time
from typing import Dict
from studio.storage.storage_type import StorageType
from studio.util.util import get_temp_filename, check_for_kb_interrupt


# StorageHandler encapsulates the logic of basic storage operations
# for specific storage endpoint (S3, http, local etc.)
# together with access credentials for this endpoint.
class StorageHandler:
    def __init__(self, storage_type: StorageType,
                 logger,
                 measure_timestamp_diff=False,
                 compression=None):
        self.type = storage_type
        self.logger = logger
        self.compression = compression

# Path: studio/storage/storage_type.py
# class StorageType(Enum):
#     storageHTTP = 1
#     storageS3 = 2
#     storageLocal = 3
#     storageFirebase = 4
#     storageDockerHub = 5
#     storageSHub = 6
# 
#     storageInvalid = 99
# 
# Path: studio/util/util.py
# def get_temp_filename() -> str:
#     return os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))
# 
# def check_for_kb_interrupt():
#     current_exc = sys.exc_info()[1]
#     if current_exc is None:
#         return
#     if isinstance(current_exc, KeyboardInterrupt):
#         raise current_exc
#     return


# Path: studio/storage/storage_handler.py
import os
import uuid
import time
from typing import Dict
from studio.storage.storage_type import StorageType
from studio.util.util import get_temp_filename, check_for_kb_interrupt



# StorageHandler encapsulates the logic of basic storage operations
# for specific storage endpoint (S3, http, local etc.)
# together with access credentials for this endpoint.
class StorageHandler:
    def __init__(self, storage_type: StorageType,
                 logger,
                 measure_timestamp_diff=False,
                 compression=None):
        self.type = storage_type
        self.logger = logger
        self.compression = compression

        self._timestamp_shift = 0