INNER CODE UNIT · Python
get_cache_dir
arnonym/ha-plugins · ha-sip/src/main.py:74
def get_cache_dir(raw_cache_dir: str) -> Optional[str]:
if not raw_cache_dir:
log(None, 'No cache directory configured.')
return None
if not os.path.isdir(raw_cache_dir):
log(None, 'Error: Cache directory not found.')
return None
log(None, f"Found cache directory '{raw_cache_dir}'")
return raw_cache_dir
def main():
global_options = options_global.parse_global_options(config.GLOBAL_OPTIONS)
name_server = get_name_server(config.NAME_SERVER)
cache_dir = get_cache_dir(config.CACHE_DIR)
endpoint_config = sip.MyEndpointConfig(
port=utils.convert_to_int(config.PORT, 5060),
log_level=utils.convert_to_int(config.LOG_LEVEL, 5),