mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-19 11:52:12 +08:00
d8e5331c6e
date: 2023-08-22T14:21:17 commit: 6148ce3d77530281f890970718e9c42b2acc5ff1
12 lines
338 B
Python
12 lines
338 B
Python
import os
|
|
from 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")
|