本文整理汇总了Python中pyanaconda.ui.tui.spokes.EditTUISpoke类的典型用法代码示例。如果您正苦于以下问题:Python EditTUISpoke类的具体用法?Python EditTUISpoke怎么用?Python EditTUISpoke使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EditTUISpoke类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: initialize
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)
开发者ID:dougsland,项目名称:anaconda,代码行数:7,代码来源:source.py
示例2: refresh
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
开发者ID:adrelanos,项目名称:qubes-installer-qubes-os,代码行数:31,代码来源:source.py
示例3: refresh
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)
开发者ID:jaymzh,项目名称:anaconda,代码行数:25,代码来源:network.py
示例4: refresh
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
开发者ID:joesaland,项目名称:qubes-installer-qubes-os,代码行数:25,代码来源:source.py
示例5: __init__
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
开发者ID:dougsland,项目名称:anaconda,代码行数:7,代码来源:network.py
示例6: refresh
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
开发者ID:dougsland,项目名称:anaconda,代码行数:32,代码来源:network.py
示例7: initialize
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()
开发者ID:dougsland,项目名称:anaconda,代码行数:8,代码来源:network.py
示例8: __init__
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")
开发者ID:rtruxal,项目名称:anaconda,代码行数:9,代码来源:network.py
示例9: __init__
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
开发者ID:jaymzh,项目名称:anaconda,代码行数:9,代码来源:network.py
示例10: refresh
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)
开发者ID:jaymzh,项目名称:anaconda,代码行数:9,代码来源:user.py
示例11: __init__
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)
开发者ID:adrelanos,项目名称:qubes-installer-qubes-os,代码行数:10,代码来源:source.py
示例12: initialize
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()
开发者ID:akozumpl,项目名称:anaconda,代码行数:11,代码来源:network.py
示例13: __init__
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
开发者ID:cs2c-zhangchao,项目名称:nkwin1.0-anaconda,代码行数:12,代码来源:user.py
示例14: __init__
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
开发者ID:bcl,项目名称:kdump-anaconda-addon,代码行数:12,代码来源:kdump.py
示例15: __init__
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 = ""
开发者ID:Sabayon,项目名称:anaconda,代码行数:16,代码来源:user.py
示例16: input
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)
开发者ID:dougsland,项目名称:anaconda,代码行数:10,代码来源:network.py
示例17: __init__
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 = []
开发者ID:marmarek,项目名称:qubes-installer-qubes-os,代码行数:20,代码来源:user.py
示例18: refresh
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
开发者ID:sujithshankar,项目名称:anaconda,代码行数:37,代码来源:network.py
示例19: input
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)
开发者ID:adrelanos,项目名称:qubes-installer-qubes-os,代码行数:17,代码来源:user.py
示例20: initialize
def initialize(self):
EditTUISpoke.initialize(self)
threadMgr.add(AnacondaThread(name=THREAD_SOURCE_WATCHER,
target=self._initialize))
开发者ID:Sabayon,项目名称:anaconda,代码行数:5,代码来源:source.py
注:本文中的pyanaconda.ui.tui.spokes.EditTUISpoke类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论