修复 Russia 数据源 f-string 嵌套引号语法错误
This commit is contained in:
@@ -208,7 +208,8 @@ class RussiaStationSourceMixin:
|
|||||||
|
|
||||||
started = time.perf_counter()
|
started = time.perf_counter()
|
||||||
try:
|
try:
|
||||||
url = f"{os.getenv("RUSSIA_POGODAIKLIMAT_BASE_URL", "").strip() or "https://www.pogodaiklimat.ru"}/weather.php?id={station_code}"
|
_ru_base = os.getenv('RUSSIA_POGODAIKLIMAT_BASE_URL', '').strip() or 'https://www.pogodaiklimat.ru'
|
||||||
|
url = f"{_ru_base}/weather.php?id={station_code}"
|
||||||
html_text = self._ru_http_get_text(url)
|
html_text = self._ru_http_get_text(url)
|
||||||
parsed = self._ru_parse_station_current_from_weather_html(html_text)
|
parsed = self._ru_parse_station_current_from_weather_html(html_text)
|
||||||
if not parsed:
|
if not parsed:
|
||||||
@@ -268,7 +269,7 @@ class RussiaStationSourceMixin:
|
|||||||
"is_official": True,
|
"is_official": True,
|
||||||
"is_airport_station": station_code == "27524",
|
"is_airport_station": station_code == "27524",
|
||||||
"is_settlement_anchor": False,
|
"is_settlement_anchor": False,
|
||||||
"page_url": f"{os.getenv("RUSSIA_POGODAIKLIMAT_BASE_URL", "").strip() or "https://www.pogodaiklimat.ru"}/weather.php?id={station_code}",
|
"page_url": f"{_ru_base}/weather.php?id={station_code}",
|
||||||
}
|
}
|
||||||
with self._ru_station_cache_lock:
|
with self._ru_station_cache_lock:
|
||||||
self._ru_station_cache[cache_key] = {"d": result, "t": now_ts}
|
self._ru_station_cache[cache_key] = {"d": result, "t": now_ts}
|
||||||
|
|||||||
Reference in New Issue
Block a user