mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-19 08:53:55 +08:00
version: dragonpilot v2022.09.07 release for EON/C2
date: 2022-09-07T07:01:54
dp-dev(priv2) beta2 commit: 30a852791f
12 lines
347 B
Python
12 lines
347 B
Python
import os
|
|
from tools.lib.url_file import URLFile
|
|
|
|
DATA_ENDPOINT = os.getenv("DATA_ENDPOINT", "http://data-raw.internal/")
|
|
|
|
def FileReader(fn, debug=False):
|
|
if fn.startswith("cd:/"):
|
|
fn = fn.replace("cd:/", DATA_ENDPOINT)
|
|
if fn.startswith("http://") or fn.startswith("https://"):
|
|
return URLFile(fn, debug=debug)
|
|
return open(fn, "rb")
|