def setup(self, oneshot): """Listen to netbeans and start vim. Method parameters: oneshot: boolean when True, 'nbserver' accepts only a single connection """ # log platform information for debugging info(platform_data()) # read keys mappings self.debugger._read_keysfile() # listen on netbeans port conn = list(CONNECTION_DEFAULTs) if self.options.netbeans: conn = self.options.netbeans.split(':') conn[1:] = conn[1:] or [CONNECTION_DEFAULTs[1]] conn[2:] = conn[2:] or [CONNECTION_DEFAULTs[2]] assert len(conn) == 3, 'too many netbeans connection parameters' conn[1] = conn[1] or CONNECTION_DEFAULTs[1] self.nbserver.bind_listen(oneshot, *conn) if self.options.editor: self.spawn_vim() # pyclewn is started from within vim else: self.vim_version() script = self.debugger._vim_script(self.options) info('building the Vim script file: %s', script)
def start(self): """Start Vim, connect to it, and start the debugger.""" # log platform information for debugging info(platform_data()) # instantiate the debugger self.debugger = self.clazz(self.netbeans, self.options) # read keys mappings self.debugger._read_keysfile() # listen on netbeans port conn = list(CONNECTION_DEFAULTs) if self.options.netbeans: conn = self.options.netbeans.split(':') conn[1:] = conn[1:] or [CONNECTION_DEFAULTs[1]] conn[2:] = conn[2:] or [CONNECTION_DEFAULTs[2]] assert len(conn) == 3, 'too many netbeans connection parameters' conn[1] = conn[1] or CONNECTION_DEFAULTs[1] self.netbeans.nb_listen(*conn) info(self.netbeans) if self.options.vim: self.spawn_vim() # pyclewn is started from within vim else: self.vim_version() script = self.debugger._vim_script(self.options) info('building the Vim script file: %s', script) # run the dispatch loop self.loop() self.debugger.close()