mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-19 07:44:00 +08:00
version: lp-dp v0.9.5 for EON/C2 date: 2023-09-13T13:36:48 commit: 1d59b81c40b93f37d4a341c5d35b1c3cd293543d
12 lines
348 B
Python
12 lines
348 B
Python
import os
|
|
from openpilot.tools.lib.url_file import URLFile
|
|
|
|
DATA_ENDPOINT = os.getenv("DATA_ENDPOINT", "http://data-raw.comma.internal/")
|
|
|
|
def FileReader(fn, debug=False):
|
|
if fn.startswith("cd:/"):
|
|
fn = fn.replace("cd:/", DATA_ENDPOINT)
|
|
if fn.startswith(("http://", "https://")):
|
|
return URLFile(fn, debug=debug)
|
|
return open(fn, "rb")
|