MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / get_open_fn

Function get_open_fn

tools/tasks.py:804–811  ·  view source on GitHub ↗

Return open function for path. gzip.open if suffixed with .gz, else open.

(path: Union[pathlib.Path, str])

Source from the content-addressed store, hash-verified

802
803
804def get_open_fn(path: Union[pathlib.Path, str]) -> Callable:
805 """
806 Return open function for path. gzip.open if suffixed with .gz, else open.
807 """
808 path = pathlib.Path(path)
809 if path.suffix == ".gz":
810 return gzip.open
811 return open
812
813
814def urlopen(url: str, auth_headers: dict[str, str]) -> http.client.HTTPResponse:

Callers 1

_process_fileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected