From 2b99a4c340ed55de30fc1aecd2a1d583b5ccc409 2014-04-30 18:59:16 From: Paul Ivanov Date: 2014-04-30 18:59:16 Subject: [PATCH] more DRYing out of consoleapp --- diff --git a/IPython/consoleapp.py b/IPython/consoleapp.py index a668b03..574df95 100644 --- a/IPython/consoleapp.py +++ b/IPython/consoleapp.py @@ -28,7 +28,7 @@ from IPython.kernel import tunnel_to_kernel, find_connection_file, swallow_argv from IPython.kernel.kernelspec import NoSuchKernel from IPython.utils.path import filefind from IPython.utils.traitlets import ( - Dict, List, Unicode, CUnicode, Int, CBool, Any + Dict, List, Unicode, CUnicode, CBool, Any ) from IPython.kernel.zmq.kernelapp import ( kernel_flags, @@ -144,21 +144,6 @@ class IPythonConsoleApp(ConnectionFileMixin): sshkey = Unicode('', config=True, help="""Path to the ssh key to use for logging in to the ssh server.""") - hb_port = Int(0, config=True, - help="set the heartbeat port [default: random]") - shell_port = Int(0, config=True, - help="set the shell (ROUTER) port [default: random]") - iopub_port = Int(0, config=True, - help="set the iopub (PUB) port [default: random]") - stdin_port = Int(0, config=True, - help="set the stdin (DEALER) port [default: random]") - connection_file = Unicode('', config=True, - help="""JSON file in which to store connection info [default: kernel-.json] - - This file will contain the IP, ports, and authentication key needed to connect - clients to this kernel. By default, this file will be created in the security-dir - of the current profile, but can be specified by absolute path. - """) def _connection_file_default(self): return 'kernel-%i.json' % os.getpid() diff --git a/IPython/kernel/connect.py b/IPython/kernel/connect.py index 0d35dac..137d0c8 100644 --- a/IPython/kernel/connect.py +++ b/IPython/kernel/connect.py @@ -419,11 +419,16 @@ class ConnectionFileMixin(Configurable): # protected traits - hb_port = Integer(0, config=True, help="set the heartbeat port [default: random]") - shell_port = Integer(0, config=True, help="set the shell (ROUTER) port [default: random]") - iopub_port = Integer(0, config=True, help="set the iopub (PUB) port [default: random]") - stdin_port = Integer(0, config=True, help="set the stdin (ROUTER) port [default: random]") - control_port = Integer(0, config=True, help="set the control (ROUTER) port [default: random]") + hb_port = Integer(0, config=True, + help="set the heartbeat port [default: random]") + shell_port = Integer(0, config=True, + help="set the shell (ROUTER) port [default: random]") + iopub_port = Integer(0, config=True, + help="set the iopub (PUB) port [default: random]") + stdin_port = Integer(0, config=True, + help="set the stdin (ROUTER) port [default: random]") + control_port = Integer(0, config=True, + help="set the control (ROUTER) port [default: random]") @property def ports(self):