[feat] introduce max_lnbits_version for extensions (#2834)

* feat: add `max_lnbits_version`

* fix: min/max lables

* chore: `make bundle`

* refactor: extract `is_version_compatible_with_lnbits`

* refactor: rename method
This commit is contained in:
Vlad Stan
2024-12-16 17:41:36 +02:00
committed by GitHub
parent 3ff85363f2
commit 27241e01f3
23 changed files with 80 additions and 40 deletions
+15
View File
@@ -241,6 +241,21 @@ def version_parse(v: str):
return version.parse("0.0.0")
def is_lnbits_version_ok(
min_lnbits_version: Optional[str], max_lnbits_version: Optional[str]
) -> bool:
if min_lnbits_version and (
version_parse(min_lnbits_version) > version_parse(settings.version)
):
return False
if max_lnbits_version and (
version_parse(max_lnbits_version) <= version_parse(settings.version)
):
return False
return True
def download_url(url, save_path):
with request.urlopen(url, timeout=60) as dl_file:
with open(save_path, "wb") as out_file: