def _get_blob_name(blob):
"""
Gets blob name (last part of the path).
:param blob: instance of :class:`google.cloud.storage.Blob`.
:return: name string.
"""
if isinstance(blob, Blob):
return url_unescape(blob.path).rsplit("/", 1)[-1]
assert isinstance(blob, (unicode, str))
if blob.endswith("/"):
blob = blob[:-1]
return blob.rsplit("/", 1)[-1]
评论列表
文章目录