mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-22 09:13:01 +00:00
readfile: do transparent gzip by default
....but there's a glad to turn it off if needed
This commit is contained in:
parent
eac6472c97
commit
d0f2e3d730
1 changed files with 4 additions and 2 deletions
|
@ -1,7 +1,9 @@
|
||||||
import io
|
import io
|
||||||
|
|
||||||
def readfile(filepath):
|
from .handle_open import handle_open
|
||||||
handle = io.open(filepath, "r")
|
|
||||||
|
def readfile(filepath, transparent_gzip=True):
|
||||||
|
handle = io.open(filepath, "r") if transparent_gzip else handle_open(filepath, "r")
|
||||||
content = handle.read()
|
content = handle.read()
|
||||||
handle.close()
|
handle.close()
|
||||||
return content
|
return content
|
Loading…
Reference in a new issue