Skip to content

Commit

Permalink
Fix review comments. Fix typo and func name
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Jul 7, 2021
1 parent c030c2d commit 04459a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ def _default_root_dir(self):
else:
return os.getcwd()

def _normalize_root_or_preferred_dir(self, value):
def _normalize_dir(self, value):
# Strip any trailing slashes
# *except* if it's root
_, path = os.path.splitdrive(value)
Expand All @@ -1370,13 +1370,13 @@ def _normalize_root_or_preferred_dir(self, value):

@validate('root_dir')
def _root_dir_validate(self, proposal):
value = self._normalize_root_or_preferred_dir(proposal['value'])
value = self._normalize_dir(proposal['value'])
if not os.path.isdir(value):
raise TraitError(trans.gettext("No such directory: '%r'") % value)
return value

preferred_dir = Unicode(config=True,
help=trans.gettext("Prefered starting directory to use for notebooks and kernels.")
help=trans.gettext("Preferred starting directory to use for notebooks and kernels.")
)

@default('preferred_dir')
Expand All @@ -1385,7 +1385,7 @@ def _default_prefered_dir(self):

@validate('preferred_dir')
def _preferred_dir_validate(self, proposal):
value = self._normalize_root_or_preferred_dir(proposal['value'])
value = self._normalize_dir(proposal['value'])
if not os.path.isdir(value):
raise TraitError(trans.gettext("No such preferred dir: '%r'") % value)

Expand Down

0 comments on commit 04459a2

Please sign in to comment.