-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Add a new preferred-dir traitlet #549
PR: Add a new preferred-dir traitlet #549
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
9a641a3
to
b5f62ad
Compare
b0da0eb
to
c030c2d
Compare
@kevin-bates, I think I covered the approach you suggested. Let me know if it works. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @goanpeca! This looks good to me (assuming the tests pass)!
Codecov Report
@@ Coverage Diff @@
## master #549 +/- ##
==========================================
+ Coverage 76.34% 76.54% +0.20%
==========================================
Files 110 110
Lines 9819 9918 +99
Branches 1067 1072 +5
==========================================
+ Hits 7496 7592 +96
- Misses 1943 1946 +3
Partials 380 380
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good Gonzalo. Just had a couple of naming/typo nits. Thanks.
jupyter_server/serverapp.py
Outdated
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.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo:
help=trans.gettext("Prefered starting directory to use for notebooks and kernels.") | |
help=trans.gettext("Preferred starting directory to use for notebooks and kernels.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
jupyter_server/serverapp.py
Outdated
@validate('root_dir') | ||
def _root_dir_validate(self, proposal): | ||
value = proposal['value'] | ||
def _normalize_root_or_preferred_dir(self, value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this name more generic since it doesn't require/act on root_dir
or preferred_dir
?
def _normalize_root_or_preferred_dir(self, value): | |
def _normalize_dir(self, value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
Made the fixes @kevin-bates, thanks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good Gonzalo - thank you.
The build failure is unrelated and being investigated - merging. |
Fixes #534