Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# The master toctree document.
master_doc = "index"
# General information about the project.
project = "GCSFs"
copyright = "2017, Continuum Analytics"
author = "Continuum Analytics"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
import gcsfs
version = gcsfs.__version__
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
async def _get_file(self, rpath, lpath, **kwargs):
if await self._isdir(rpath):
return
u2 = self.url(rpath)
headers = kwargs.pop("headers", {})
consistency = kwargs.pop("consistency", self.consistency)
if "User-Agent" not in headers:
headers["User-Agent"] = "python-gcsfs/" + version
headers.update(self.heads or {}) # add creds
# needed for requester pays buckets
if self.requester_pays:
if isinstance(self.requester_pays, str):
user_project = self.requester_pays
else:
user_project = self.project
kwargs["userProject"] = user_project
async with self.session.get(
url=u2, params=kwargs, headers=headers, timeout=self.requests_timeout,
) as r:
r.raise_for_status()
if self.consistency == "md5":
md = md5()