Files
onepilot/tools/lib/filereader.py
Greg Hogan eca265120f FrameIterator that uses 1+ GB less RAM (#21687)
old-commit-hash: 8f1806602c4e4a70e073bf1abd8f61206864d652
2021-07-22 12:08:56 -07:00

7 lines
193 B
Python

from tools.lib.url_file import URLFile
def FileReader(fn, debug=False):
if fn.startswith("http://") or fn.startswith("https://"):
return URLFile(fn, debug=debug)
return open(fn, "rb")