config, set_version

This commit is contained in:
Zsolt Ero
2024-09-01 15:25:30 +02:00
parent 77a5855b0c
commit add716cb58
14 changed files with 120 additions and 165 deletions

View File

@@ -2,9 +2,8 @@ import shutil
import subprocess
import sys
import requests
from http_host_lib.config import config
from http_host_lib.shared import get_versions_for_area
from http_host_lib.utils import download_file_aria2, get_remote_file_size
@@ -41,14 +40,6 @@ def download_area_version(area: str, version: str) -> bool:
return download_and_extract_btrfs(area, selected_version)
def get_versions_for_area(area: str) -> list:
r = requests.get('https://btrfs.openfreemap.com/dirs.txt', timeout=30)
r.raise_for_status()
versions = [v.split('/')[2] for v in r.text.splitlines() if v.startswith(f'areas/{area}/')]
return sorted(versions)
def download_and_extract_btrfs(area: str, version: str) -> bool:
"""
returns True if download successful, False if skipped

View File

@@ -0,0 +1 @@
../../tile_gen/tile_gen_lib/shared.py