From e64f689374771614fa8beaeb4e5388dda11afe9c Mon Sep 17 00:00:00 2001 From: MinRK Date: Tue, 24 Jun 2014 14:25:24 -0700 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20import=20IPython.parallel=20unt?= =?UTF-8?q?il=20it=E2=80=99s=20used?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in IPython.html.notebookapp --- .../html/services/clusters/clustermanager.py | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/IPython/html/services/clusters/clustermanager.py b/IPython/html/services/clusters/clustermanager.py index 66fb529ed..fecde707a 100644 --- a/IPython/html/services/clusters/clustermanager.py +++ b/IPython/html/services/clusters/clustermanager.py @@ -21,7 +21,6 @@ from zmq.eventloop import ioloop from IPython.config.configurable import LoggingConfigurable from IPython.utils.traitlets import Dict, Instance, CFloat -from IPython.parallel.apps.ipclusterapp import IPClusterStart from IPython.core.profileapp import list_profiles_in from IPython.core.profiledir import ProfileDir from IPython.utils import py3compat @@ -33,17 +32,6 @@ from IPython.utils.path import get_ipython_dir #----------------------------------------------------------------------------- -class DummyIPClusterStart(IPClusterStart): - """Dummy subclass to skip init steps that conflict with global app. - - Instantiating and initializing this class should result in fully configured - launchers, but no other side effects or state. - """ - - def init_signal(self): - pass - def reinit_logging(self): - pass class ClusterManager(LoggingConfigurable): @@ -59,6 +47,20 @@ class ClusterManager(LoggingConfigurable): return IOLoop.instance() def build_launchers(self, profile_dir): + from IPython.parallel.apps.ipclusterapp import IPClusterStart + + class DummyIPClusterStart(IPClusterStart): + """Dummy subclass to skip init steps that conflict with global app. + + Instantiating and initializing this class should result in fully configured + launchers, but no other side effects or state. + """ + + def init_signal(self): + pass + def reinit_logging(self): + pass + starter = DummyIPClusterStart(log=self.log) starter.initialize(['--profile-dir', profile_dir]) cl = starter.controller_launcher