Resolve a framework shorthand name to comprehensive URL information. Args: framework_name: Framework name like 'arduino', 'espidf', etc. Returns: FrameworkUrlResolution with git_url, zip_url, homepage, etc. or None if resolution fails.
(
self, framework_name: str
)
| 1881 | return url |
| 1882 | |
| 1883 | def resolve_framework_url_enhanced( |
| 1884 | self, framework_name: str |
| 1885 | ) -> Optional[FrameworkUrlResolution]: |
| 1886 | """ |
| 1887 | Resolve a framework shorthand name to comprehensive URL information. |
| 1888 | |
| 1889 | Args: |
| 1890 | framework_name: Framework name like 'arduino', 'espidf', etc. |
| 1891 | |
| 1892 | Returns: |
| 1893 | FrameworkUrlResolution with git_url, zip_url, homepage, etc. or None if resolution fails. |
| 1894 | """ |
| 1895 | if self._is_url(framework_name): |
| 1896 | # If it's already a URL, create a resolution based on URL type |
| 1897 | url_type = self._classify_url_type(framework_name) |
| 1898 | resolution = FrameworkUrlResolution(name=framework_name) |
| 1899 | |
| 1900 | if url_type == "git": |
| 1901 | resolution.git_url = framework_name |
| 1902 | elif url_type == "zip": |
| 1903 | resolution.zip_url = framework_name |
| 1904 | |
| 1905 | return resolution |
| 1906 | |
| 1907 | # Check cache first |
| 1908 | if self._is_framework_cached(framework_name): |
| 1909 | cached = self._framework_cache[framework_name] |
| 1910 | logger.debug( |
| 1911 | f"Using cached enhanced framework resolution for {framework_name}" |
| 1912 | ) |
| 1913 | if cached.enhanced_resolution: |
| 1914 | return cached.enhanced_resolution |
| 1915 | # Fall back to creating resolution from cached data |
| 1916 | return FrameworkUrlResolution( |
| 1917 | name=framework_name, |
| 1918 | git_url=cached.git_url, |
| 1919 | zip_url=cached.zip_url, |
| 1920 | homepage=cached.homepage, |
| 1921 | platforms=cached.platforms, |
| 1922 | url=cached.url, # Include the original URL |
| 1923 | ) |
| 1924 | |
| 1925 | # Resolve via PlatformIO CLI using typed response |
| 1926 | frameworks_list = self._get_frameworks_list_typed() |
| 1927 | |
| 1928 | if not frameworks_list: |
| 1929 | logger.warning("Failed to get frameworks list from PlatformIO") |
| 1930 | return None |
| 1931 | |
| 1932 | # Find the specific framework |
| 1933 | framework_info: Optional[FrameworkInfo] = None |
| 1934 | for fw in frameworks_list: |
| 1935 | if fw.name == framework_name: |
| 1936 | framework_info = fw |
| 1937 | break |
| 1938 | |
| 1939 | if not framework_info: |
| 1940 | logger.warning(f"Framework not found: {framework_name}") |