(self)
| 2016 | return content_exists and (skip_version_check or self.is_installed_version()) |
| 2017 | |
| 2018 | def is_active(self): |
| 2019 | if not self.is_installed(): |
| 2020 | return False |
| 2021 | |
| 2022 | # All dependencies of this tool must be active as well. |
| 2023 | deps = self.dependencies() |
| 2024 | for tool in deps: |
| 2025 | if not tool.is_active(): |
| 2026 | return False |
| 2027 | |
| 2028 | activated_cfg = self.activated_config() |
| 2029 | if not activated_cfg: |
| 2030 | return len(deps) > 0 |
| 2031 | |
| 2032 | for key, value in activated_cfg.items(): |
| 2033 | if key not in EM_CONFIG_DICT: |
| 2034 | debug_print(f'{self} is not active, because key="{key}" does not exist in .emscripten') |
| 2035 | return False |
| 2036 | |
| 2037 | # all paths are stored dynamically relative to the emsdk root, so |
| 2038 | # normalize those first. |
| 2039 | config_value = EM_CONFIG_DICT[key].replace("emsdk_path + '", "'" + EMSDK_PATH) |
| 2040 | config_value = config_value.strip("'") |
| 2041 | if config_value != value: |
| 2042 | debug_print(f'{self} is not active, because key="{key}" has value "{config_value}" but should have value "{value}"') |
| 2043 | return False |
| 2044 | return True |
| 2045 | |
| 2046 | # Returns true if the system environment variables requires by this tool are currently active. |
| 2047 | def is_env_active(self): |
no test coverage detected