예제 #1
0
 def __init__(self, mod_name = '__main__', launch_file = None):
     ReplBackend.__init__(self)
     self.launch_file = launch_file
     self.mod_name = mod_name
     self.km = VsKernelManager()
     
     if is_ipython_versionorgreater(0, 13):
         # http://pytools.codeplex.com/workitem/759
         # IPython stopped accepting the ipython flag and switched to launcher, the new
         # default is what we want though.
         self.km.start_kernel(**{'extra_arguments': self.get_extra_arguments()})
     else:
         self.km.start_kernel(**{'ipython': True, 'extra_arguments': self.get_extra_arguments()})
     self.km.start_channels()
     self.exit_lock = thread.allocate_lock()
     self.exit_lock.acquire()     # used as an event
     self.members_lock = thread.allocate_lock()
     self.members_lock.acquire()
     
     self.km.shell_channel._vs_backend = self
     self.km.stdin_channel._vs_backend = self
     if is_ipython_versionorgreater(1, 0):
         self.km.iopub_channel._vs_backend = self
     else:
         self.km.sub_channel._vs_backend = self
     self.km.hb_channel._vs_backend = self
     self.execution_count = 1
예제 #2
0
    def __init__(self, mod_name='__main__', launch_file=None):
        ReplBackend.__init__(self)
        self.launch_file = launch_file
        self.mod_name = mod_name
        self.km = VsKernelManager()

        if is_ipython_versionorgreater(0, 13):
            # http://pytools.codeplex.com/workitem/759
            # IPython stopped accepting the ipython flag and switched to launcher, the new
            # default is what we want though.
            self.km.start_kernel(
                **{'extra_arguments': self.get_extra_arguments()})
        else:
            self.km.start_kernel(**{
                'ipython': True,
                'extra_arguments': self.get_extra_arguments()
            })
        self.km.start_channels()
        self.exit_lock = thread.allocate_lock()
        self.exit_lock.acquire()  # used as an event
        self.members_lock = thread.allocate_lock()
        self.members_lock.acquire()

        self.km.shell_channel._vs_backend = self
        self.km.stdin_channel._vs_backend = self
        if is_ipython_versionorgreater(1, 0):
            self.km.iopub_channel._vs_backend = self
        else:
            self.km.sub_channel._vs_backend = self
        self.km.hb_channel._vs_backend = self
        self.execution_count = 1
예제 #3
0
 def __init__(self, mod_name = '__main__', launch_file = None):
     ReplBackend.__init__(self)
     self.launch_file = launch_file
     self.mod_name = mod_name
     self.km = VsKernelManager()
     self.km.start_kernel()
     self.km.start_channels()
     self.exit_lock = thread.allocate_lock()
     self.exit_lock.acquire()     # used as an event
     self.members_lock = thread.allocate_lock()
     self.members_lock.acquire()
     
     self.km.xreq_channel._vs_backend = self
     self.km.rep_channel._vs_backend = self
     self.km.sub_channel._vs_backend = self
     self.km.hb_channel._vs_backend = self