parent
2c94f15584
commit
d5f4fdb1db
|
@ -1,6 +1,11 @@
|
||||||
|
import os
|
||||||
from tools.lib.url_file import URLFile
|
from tools.lib.url_file import URLFile
|
||||||
|
|
||||||
|
DATA_PREFIX = os.getenv("DATA_PREFIX", "http://data-raw.internal/")
|
||||||
|
|
||||||
def FileReader(fn, debug=False):
|
def FileReader(fn, debug=False):
|
||||||
|
if fn.startswith("cd:/"):
|
||||||
|
fn.replace("cd:/", DATA_PREFIX)
|
||||||
if fn.startswith("http://") or fn.startswith("https://"):
|
if fn.startswith("http://") or fn.startswith("https://"):
|
||||||
return URLFile(fn, debug=debug)
|
return URLFile(fn, debug=debug)
|
||||||
return open(fn, "rb")
|
return open(fn, "rb")
|
||||||
|
|
|
@ -17,10 +17,7 @@ from tools.lib.cache import cache_path_for_file_path
|
||||||
from tools.lib.exceptions import DataUnreadableError
|
from tools.lib.exceptions import DataUnreadableError
|
||||||
from common.file_helpers import atomic_write_in_dir
|
from common.file_helpers import atomic_write_in_dir
|
||||||
|
|
||||||
try:
|
from tools.lib.filereader import FileReader
|
||||||
from xx.chffr.lib.filereader import FileReader
|
|
||||||
except ImportError:
|
|
||||||
from tools.lib.filereader import FileReader
|
|
||||||
|
|
||||||
HEVC_SLICE_B = 0
|
HEVC_SLICE_B = 0
|
||||||
HEVC_SLICE_P = 1
|
HEVC_SLICE_P = 1
|
||||||
|
|
|
@ -5,10 +5,7 @@ import bz2
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import capnp
|
import capnp
|
||||||
|
|
||||||
try:
|
from tools.lib.filereader import FileReader
|
||||||
from xx.chffr.lib.filereader import FileReader
|
|
||||||
except ImportError:
|
|
||||||
from tools.lib.filereader import FileReader
|
|
||||||
from cereal import log as capnp_log
|
from cereal import log as capnp_log
|
||||||
|
|
||||||
# this is an iterator itself, and uses private variables from LogReader
|
# this is an iterator itself, and uses private variables from LogReader
|
||||||
|
|
Loading…
Reference in New Issue