mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-29 01:23:58 +08:00
ab81464bd1
Add navigation and map matching providers with the vendored map service sources. Co-authored-by: Daniel Koepping <elkoled@gmail.com> Co-authored-by: Danny <dannyirwin31@yahoo.com> Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu> Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
15 lines
417 B
Python
15 lines
417 B
Python
import os
|
|
from pathlib import Path
|
|
import re
|
|
|
|
|
|
STORAGE_ANCHOR = Path('/data/media/0')
|
|
|
|
|
|
def offline_root(anchor: Path = STORAGE_ANCHOR) -> Path:
|
|
prefix = os.environ.get('OPENPILOT_PREFIX', '')
|
|
if prefix and re.fullmatch(r'[A-Za-z0-9_-]{1,64}', prefix) is None:
|
|
raise ValueError('Invalid map storage namespace')
|
|
name = f'starpilot-{prefix}' if prefix else 'starpilot'
|
|
return anchor / name / 'maps/offline'
|