Skip to content

Commit 766aaaa

Browse files
committed
Fixes from PR comments
1 parent d1f1f4b commit 766aaaa

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

jgscm/__init__.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class GoogleStorageContentManager(ContentsManager):
210210
)
211211

212212
def __init__(self, *args, **kwargs):
213+
# Stub for the GSClient instance (set lazily by the client property).
213214
self._client = None
214215
super(GoogleStorageContentManager, self).__init__(*args, **kwargs)
215216

@@ -465,18 +466,18 @@ def run_post_save_hook(self, model, os_path):
465466
def _checkpoints_class_default(self):
466467
return GoogleStorageCheckpoints
467468

468-
def _resolve_storagetype(self, path, type):
469+
def _resolve_storagetype(self, path, storagetype):
469470
"""Based on the arguments and status of GCS, return a valid type."""
470471
if "/" not in path or path.endswith("/") or path == "":
471-
if type not in (None, "directory"):
472+
if storagetype not in (None, "directory"):
472473
raise web.HTTPError(
473474
400, u"%s is not a directory" % path, reason="bad type")
474475
return "directory"
475-
if type is None and path.endswith(".ipynb"):
476+
if storagetype is None and path.endswith(".ipynb"):
476477
return "notebook"
477-
if type is not None:
478-
return type
479-
# If type cannot be inferred from the argument set, hit
478+
if storagetype is not None:
479+
return storagetype
480+
# If type cannot be inferred from the argument set, use
480481
# the storage API to see if a blob or a prefix exists.
481482
if self.file_exists(path):
482483
return "file"

0 commit comments

Comments
 (0)