def refresh(self, args=None): """ Refresh screen. """ self._load_new_devices() EditTUISpoke.refresh(self, args) summary = self._summary_text() self._window += [TextWidget(summary), ""] hostname = _("Host Name: %s\n") % self.data.network.hostname self._window += [TextWidget(hostname), ""] current_hostname = _("Current host name: %s\n") % network.current_hostname() self._window += [TextWidget(current_hostname), ""] # if we have any errors, display them while len(self.errors) > 0: self._window += [TextWidget(self.errors.pop()), ""] def _prep(i, w): """ Mangle our text to make it look pretty on screen. """ number = TextWidget("%2d)" % (i + 1)) return ColumnWidget([(4, [number]), (None, [w])], 1) _opts = [_("Set host name")] for devname in self.supported_devices: _opts.append(_("Configure device %s") % devname) text = [TextWidget(o) for o in _opts] # make everything presentable on screen choices = [_prep(i, w) for i, w in enumerate(text)] displayed = ColumnWidget([(78, choices)], 1) self._window += [displayed, ""] return True
def refresh(self, args=None): """ Refresh screen. """ self._load_new_devices() EditTUISpoke.refresh(self, args) summary = self._summary_text() self._window += [TextWidget(summary), ""] hostname = _("Host Name: %s\n") % self.data.network.hostname self._window += [TextWidget(hostname), ""] current_hostname = _( "Current host name: %s\n") % network.current_hostname() self._window += [TextWidget(current_hostname), ""] # if we have any errors, display them while len(self.errors) > 0: self._window += [TextWidget(self.errors.pop()), ""] def _prep(i, w): """ Mangle our text to make it look pretty on screen. """ number = TextWidget("%2d)" % (i + 1)) return ColumnWidget([(4, [number]), (None, [w])], 1) _opts = [_("Set host name")] for devname in self.supported_devices: _opts.append(_("Configure device %s") % devname) text = [TextWidget(o) for o in _opts] # make everything presentable on screen choices = [_prep(i, w) for i, w in enumerate(text)] displayed = ColumnWidget([(78, choices)], 1) self._window += [displayed, ""] return True
def refresh(self, args=None): """ Refresh screen. """ self._load_new_devices() EditTUISpoke.refresh(self, args) self._container = ListColumnContainer(1, columns_width=78, spacing=1) summary = self._summary_text() self.window.add_with_separator(TextWidget(summary)) hostname = _("Host Name: %s\n") % self.data.network.hostname self.window.add_with_separator(TextWidget(hostname)) current_hostname = _("Current host name: %s\n") % network.current_hostname() self.window.add_with_separator(TextWidget(current_hostname)) # if we have any errors, display them while len(self.errors) > 0: self.window.add_with_separator(TextWidget(self.errors.pop())) self._container.add(TextWidget(_("Set host name")), callback=self._set_hostname_callback) for dev_name in self.supported_devices: text = (_("Configure device %s") % dev_name) self._container.add(TextWidget(text), callback=self._configure_network_interface, data=dev_name) self.window.add_with_separator(self._container)
def refresh(self, args=None): """ Refresh screen. """ self._load_new_devices() NormalTUISpoke.refresh(self, args) self._container = ListColumnContainer(1, columns_width=78, spacing=1) summary = self._summary_text() self.window.add_with_separator(TextWidget(summary)) hostname = _("Host Name: %s\n") % self.data.network.hostname self.window.add_with_separator(TextWidget(hostname)) current_hostname = _( "Current host name: %s\n") % network.current_hostname() self.window.add_with_separator(TextWidget(current_hostname)) # if we have any errors, display them while len(self.errors) > 0: self.window.add_with_separator(TextWidget(self.errors.pop())) dialog = Dialog(_("Host Name")) self._container.add(TextWidget(_("Set host name")), callback=self._set_hostname_callback, data=dialog) for dev_name in self.supported_devices: text = (_("Configure device %s") % dev_name) self._container.add(TextWidget(text), callback=self._configure_network_interface, data=dev_name) self.window.add_with_separator(self._container)