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): EditTUISpoke.refresh(self, args) threadMgr.wait(THREAD_PAYLOAD) _methods = [_("CD/DVD"), _("local ISO file"), _("Network")] if self.data.method.method == "harddrive" and \ get_mount_device(DRACUT_ISODIR) == get_mount_device(DRACUT_REPODIR): message = _("The installation source is in use by the installer and cannot be changed.") self._window += [TextWidget(message), ""] return True if args == 3: text = [TextWidget(_(p)) for p in self._protocols] else: self._window += [TextWidget(_("Choose an installation source type."))] text = [TextWidget(m) for m in _methods] 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) # gnarl and mangle all of our widgets so things look pretty on screen choices = [_prep(i, w) for i, w in enumerate(text)] displayed = ColumnWidget([(78, choices)], 1) self._window.append(displayed) return True
def initialize(self): EditTUISpoke.initialize(self) self.initialize_start() threadMgr.add(AnacondaThread(name=THREAD_SOURCE_WATCHER, target=self._initialize)) payloadMgr.addListener(payloadMgr.STATE_ERROR, self._payload_error)
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 __init__(self, app, data, storage, payload, instclass): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) self.hostname_dialog = OneShotEditTUIDialog(app, data, storage, payload, instclass) self.hostname_dialog.value = self.data.network.hostname self.supported_devices = [] self.errors = [] self._apply = False
def refresh(self, args=None): EditTUISpoke.refresh(self, args) threadMgr.wait(THREAD_PAYLOAD) threadMgr.wait(THREAD_PAYLOAD_MD) _methods = [_("CD/DVD"), _("local ISO file"), _("Network")] if args == 3: text = [TextWidget(p) for p in self._protocols] else: self._window += [TextWidget(_("Choose an installation source type."))] text = [TextWidget(m) for m in _methods] 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) # gnarl and mangle all of our widgets so things look pretty on screen choices = [_prep(i, w) for i, w in enumerate(text)] displayed = ColumnWidget([(78, choices)], 1) self._window.append(displayed) return True
def __init__(self, app, data, storage, payload, instclass, ndata): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) self.args = ndata if self.args.bootProto == "dhcp": self.args.ip = "dhcp" if self.args.noipv6: self.args.ipv6 = "ignore" self.args._apply = False
def initialize(self): self.initialize_start() self._load_new_devices() EditTUISpoke.initialize(self) if not self.data.network.seen: self._update_network_data() self.initialize_done()
def __init__(self, app, data, storage, payload, instclass, ndata): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) self.args = ndata if self.args.bootProto == "dhcp": self.args.ip = "dhcp" if self.args.noipv6: self.args.ipv6 = "ignore" self.args._apply = False self.dialog.wrong_input_message = _("Bad format of the IP address")
def __init__(self, data, storage, payload, instclass): EditTUISpoke.__init__(self, data, storage, payload, instclass) self.title = N_("Network configuration") self._container = None self.hostname_dialog = OneShotEditTUIDialog(data, storage, payload, instclass) self.hostname_dialog.value = self.data.network.hostname self.supported_devices = [] self.errors = [] self._apply = False
def refresh(self, args=None): self.args._admin = "wheel" in self.args.groups self.args._groups = ", ".join(self.args.groups) # if we have any errors, display them while self.errors: print(self.errors.pop()) EditTUISpoke.refresh(self, args)
def __init__(self, data, storage, payload, instclass, ndata): EditTUISpoke.__init__(self, data, storage, payload, instclass) self.title = N_("Device configuration") self.args = ndata if self.args.bootProto == "dhcp": self.args.ip = "dhcp" if self.args.noipv6: self.args.ipv6 = "ignore" self.args._apply = False
def __init__(self, app, data, storage, payload, instclass, selection, error): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) SourceSwitchHandler.__init__(self) self.selection = selection self._error = error nfs = self.data.method self.args = DataHolder(server="", opts=nfs.opts or "") if nfs.method == "nfs" and nfs.server and nfs.dir: self.args.server = "%s:%s" % (nfs.server, nfs.dir)
def initialize(self): for name in nm.nm_devices(): if nm.nm_device_type_is_ethernet(name): # ignore slaves if nm.nm_device_setting_value(name, "connection", "slave-type"): continue self.supported_devices.append(name) EditTUISpoke.initialize(self) if not self.data.network.seen: self._update_network_data()
def __init__(self, app, data, storage, payload, instclass): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) self.args = self.data.addons.com_redhat_kdump # Read the config file into data.content so that it will be written # to the system even though it is not editable try: with open(CONFIG_FILE, "r") as fobj: self.data.addons.com_redhat_kdump.content = fobj.read() except IOError: pass
def __init__(self, app, data, storage, payload, instclass): FirstbootSpokeMixIn.__init__(self) EditTUISpoke.__init__(self, app, data, storage, payload, instclass) if self.data.user.userList: self.args = self.data.user.userList[0] self.args._create = True else: self.args = self.data.UserData() self.args._create = False self.args._use_password = self.args.isCrypted or self.args.password
def __init__(self, app, data, storage, payload, instclass): FirstbootSpokeMixIn.__init__(self) EditTUISpoke.__init__(self, app, data, storage, payload, instclass) if self.data.user.userList: self.args = self.data.user.userList[0] self.args._create = True else: self.args = self.data.UserData() self.args._create = False self.args._use_password = self.args.isCrypted or self.args.password # Keep the password separate from the kickstart data until apply() # so that all of the properties are set at once self.args._password = ""
def input(self, args, key): self.dialog.wrong_input_message = _("Bad format of the IP address") try: field = self.visible_fields[int(key)-1] except (ValueError, IndexError): pass else: if field.attribute == "netmask": self.dialog.wrong_input_message = _("Bad format of the netmask") return EditTUISpoke.input(self, args, key)
def __init__(self, app, data, storage, payload, instclass): EditTUISpoke.__init__(self, app, data, storage, payload, instclass, "user") self.dialog.wrong_input_message = _("You have provided an invalid user name.\n" "Tip: Keep your user name shorter than 32 " "characters and do not use spaces.\n") if self.data.user.userList: self.args = self.data.user.userList[0] self.args._create = True else: self.args = self.data.UserData() self.args._create = False self.args._use_password = self.args.isCrypted or self.args.password # Keep the password separate from the kickstart data until apply() # so that all of the properties are set at once self.args._password = "" self.errors = []
def refresh(self, args=None): """ Refresh screen. """ self._load_new_devices() EditTUISpoke.refresh(self, args) # on refresh check if we haven't got hostname from NM on activated # connection (dhcp or DNS) if self.hostname_dialog.value == network.DEFAULT_HOSTNAME: hostname = network.getHostname() network.update_hostname_data(self.data, hostname) self.hostname_dialog.value = self.data.network.hostname summary = self._summary_text() self._window += [TextWidget(summary), ""] hostname = _("Host Name: %s\n") % self.data.network.hostname self._window += [TextWidget(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.append(displayed) return True
def input(self, args, key): self.dialog.wrong_input_message = None try: field = self.visible_fields[int(key)-1] except (ValueError, IndexError): pass else: if field.attribute == "gecos": self.dialog.wrong_input_message = _("Full name can't contain the ':' character") elif field.attribute == "name": # more granular message is returned by check_username pass elif field.attribute == "_groups": self.dialog.wrong_input_message = _("Either a group name in the group list is invalid or groups are not separated by a comma") return EditTUISpoke.input(self, args, key)
def initialize(self): EditTUISpoke.initialize(self) threadMgr.add(AnacondaThread(name=THREAD_SOURCE_WATCHER, target=self._initialize))
def __init__(self, app, data, storage, payload, instclass): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) self._ready = False self.errors = [] self._cdrom = None
def refresh(self, args=None): """ Refresh window. """ return EditTUISpoke.refresh(self, args)
def __init__(self, app, data, storage, payload, instclass, selection, errors): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) self.selection = selection self.args = self.data.method self.errors = errors
def refresh(self, args = None): self.args._admin = "wheel" in self.args.groups self.args._groups = ", ".join(self.args.groups) return EditTUISpoke.refresh(self, args)
def __init__(self, app, data, storage, payload, instclass): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) SourceSwitchHandler.__init__(self) self._ready = False self._error = False self._cdrom = None
def refresh(self, args=None): """ Refresh window. """ EditTUISpoke.refresh(self, args) message = _("Configuring device %s.") % self.args.device self._window += [TextWidget(message), ""] return True
def __init__(self, app, data, storage, payload, instclass): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) self.args = self.data.addons.com_redhat_kdump
def __init__(self, app, data, storage, payload, instclass, selection): EditTUISpoke.__init__(self, app, data, storage, payload, instclass) SourceSwitchHandler.__init__(self) self.selection = selection self.args = self.data.method
def refresh(self, args=None): """ Refresh window. """ EditTUISpoke.refresh(self, args)
def refresh(self, args=None): self.args._admin = "wheel" in self.args.groups self.args._groups = ", ".join(self.args.groups) return EditTUISpoke.refresh(self, args)
def __init__(self, data, storage, payload, instclass, protocol): EditTUISpoke.__init__(self, data, storage, payload, instclass) SourceSwitchHandler.__init__(self) self.title = N_("Specify Repo Options") self.protocol = protocol self.args = self.data.method
def refresh(self, args=None): """ Refresh window. """ EditTUISpoke.refresh(self, args) message = _("Configuring device %s.") % self.args.device self.window.add_with_separator(TextWidget(message))
def initialize(self): self._load_new_devices() EditTUISpoke.initialize(self) if not self.data.network.seen: self._update_network_data()