mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
config, set_version
This commit is contained in:
@@ -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
|
||||
|
||||
1
modules/http_host/http_host_lib/shared.py
Symbolic link
1
modules/http_host/http_host_lib/shared.py
Symbolic link
@@ -0,0 +1 @@
|
||||
../../tile_gen/tile_gen_lib/shared.py
|
||||
Reference in New Issue
Block a user