mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
warn when notebook is started in pylab mode
because it is always a bad idea
This commit is contained in:
parent
736172febe
commit
db4c814812
@ -499,7 +499,7 @@ class NotebookApp(BaseIPythonApplication):
|
||||
|
||||
trust_xheaders = Bool(False, config=True,
|
||||
help=("Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-For headers"
|
||||
"sent by the upstream reverse proxy. Neccesary if the proxy handles SSL")
|
||||
"sent by the upstream reverse proxy. Necessary if the proxy handles SSL")
|
||||
)
|
||||
|
||||
def parse_command_line(self, argv=None):
|
||||
@ -521,6 +521,13 @@ class NotebookApp(BaseIPythonApplication):
|
||||
"""construct the kernel arguments"""
|
||||
# Scrub frontend-specific flags
|
||||
self.kernel_argv = swallow_argv(self.argv, notebook_aliases, notebook_flags)
|
||||
if any(arg.startswith(u'--pylab') for arg in self.kernel_argv):
|
||||
self.log.warn('\n '.join([
|
||||
"Starting all kernels in pylab mode is not recommended.",
|
||||
"Please use the %matplotlib magic to enable matplotlib instead.",
|
||||
"pylab implies many imports, which can have confusing side effects",
|
||||
"and harm the reproducibility of your notebooks.",
|
||||
]))
|
||||
# Kernel should inherit default config file from frontend
|
||||
self.kernel_argv.append("--IPKernelApp.parent_appname='%s'" % self.name)
|
||||
# Kernel should get *absolute* path to profile directory
|
||||
|
Loading…
Reference in New Issue
Block a user