def init_qt_elements(self): # Create the widget. base_path = os.path.abspath(os.path.dirname(__file__)) icon_path = os.path.join(base_path, 'resources', 'icon', 'JupyterConsole.svg') self.app.icon = QtGui.QIcon(icon_path) QtGui.QApplication.setWindowIcon(self.app.icon) ip = self.ip local_kernel = (not self.existing) or is_local_ip(ip) self.widget = self.widget_factory(config=self.config, local_kernel=local_kernel) self.init_colors(self.widget) self.widget._existing = self.existing self.widget._may_close = not self.existing self.widget._confirm_exit = self.confirm_exit self.widget._display_banner = self.display_banner self.widget.kernel_manager = self.kernel_manager self.widget.kernel_client = self.kernel_client self.window = MainWindow(self.app, confirm_exit=self.confirm_exit, new_frontend_factory=self.new_frontend_master, slave_frontend_factory=self.new_frontend_slave, connection_frontend_factory=self.new_frontend_connection, ) self.window.log = self.log self.window.add_tab_with_frontend(self.widget) self.window.init_menu_bar() # Ignore on OSX, where there is always a menu bar if sys.platform != 'darwin' and self.hide_menubar: self.window.menuBar().setVisible(False) self.window.setWindowTitle('Jupyter QtConsole')
def init_qt_elements(self): # Create the widget. base_path = os.path.abspath(os.path.dirname(__file__)) icon_path = os.path.join(base_path, "resources", "icon", "JupyterConsole.svg") self.app.icon = QtGui.QIcon(icon_path) QtGui.QApplication.setWindowIcon(self.app.icon) ip = self.ip local_kernel = (not self.existing) or is_local_ip(ip) self.widget = self.widget_factory(config=self.config, local_kernel=local_kernel) self.init_colors(self.widget) self.widget._existing = self.existing self.widget._may_close = not self.existing self.widget._confirm_exit = self.confirm_exit self.widget._display_banner = self.display_banner self.widget.kernel_manager = self.kernel_manager self.widget.kernel_client = self.kernel_client self.window = MainWindow( self.app, confirm_exit=self.confirm_exit, new_frontend_factory=self.new_frontend_master, slave_frontend_factory=self.new_frontend_slave, ) self.window.log = self.log self.window.add_tab_with_frontend(self.widget) self.window.init_menu_bar() # Ignore on OSX, where there is always a menu bar if sys.platform != "darwin" and self.hide_menubar: self.window.menuBar().setVisible(False) self.window.setWindowTitle("Jupyter QtConsole")
def init_qt_elements(self): ip = self.ip local_kernel = (not self.existing) or is_local_ip(ip) self.widget = widget = self.widget_factory( parent=self.parent_widget, config=self.config, local_kernel=local_kernel, banner='', kernel_banner='', gui_completion='droplist', in_prompt='>>>', out_prompt='-->', ) widget.style_sheet = dark_style_sheet widget.syntax_style = dark_syntax_style widget._existing = self.existing widget._may_close = not self.existing widget._confirm_exit = self.confirm_exit widget._display_banner = self.display_banner widget.kernel_manager = self.kernel_manager widget.kernel_client = self.kernel_client
def ip_is_local(ip): return localinterfaces.is_public_ip(ip) or localinterfaces.is_local_ip( ip)
def ip_is_local(ip): """Returns True if `ip` is considered local to this server, False otherwise. """ return localinterfaces.is_public_ip(ip) or localinterfaces.is_local_ip( ip)
def ip_is_local(ip): return localinterfaces.is_public_ip(ip) or localinterfaces.is_local_ip(ip)