Load extension in predictable order.

Not doing this can lead to subtle incomprehensible issues when 2
extensions (eg, jupyterlab and jupyterlab_extensions) both register the
same handlers, that will randomly at each start get a different
extension take precedence.
pull/1650/head
Matthias Bussonnier 10 years ago
parent 1816b306cb
commit 72a85fe189

@ -902,7 +902,8 @@ class NotebookApp(JupyterApp):
nbserver_extensions = Dict({}, config=True,
help=("Dict of Python modules to load as notebook server extensions."
"Entry values can be used to enable and disable the loading of"
"the extensions.")
"the extensions. The extensions will be loaded in alphabetical "
"order.")
)
reraise_server_extension_failures = Bool(
@ -1156,7 +1157,7 @@ class NotebookApp(JupyterApp):
if not modulename in self.nbserver_extensions:
self.nbserver_extensions[modulename] = True
for modulename in self.nbserver_extensions:
for modulename in sorted(self.nbserver_extensions):
if self.nbserver_extensions[modulename]:
try:
mod = importlib.import_module(modulename)

Loading…
Cancel
Save