本文整理汇总了Python中simpleline.render.screen_handler.ScreenHandler.replace_screen方法的典型用法代码示例。如果您正苦于以下问题:Python ScreenHandler.replace_screen方法的具体用法?Python ScreenHandler.replace_screen怎么用?Python ScreenHandler.replace_screen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simpleline.render.screen_handler.ScreenHandler
的用法示例。
在下文中一共展示了ScreenHandler.replace_screen方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: input
# 需要导入模块: from simpleline.render.screen_handler import ScreenHandler [as 别名]
# 或者: from simpleline.render.screen_handler.ScreenHandler import replace_screen [as 别名]
def input(self, args, key):
""" Handle the input; this chooses the desktop environment. """
if self._container is not None and self._container.process_user_input(key):
self.redraw()
else:
# TRANSLATORS: 'c' to continue
if key.lower() == C_('TUI|Spoke Navigation', 'c'):
# No environment was selected, close
if self._selected_environment is None:
self.close()
# The environment was selected, switch screen
elif args is None:
# Get addons for the selected environment
environment = self._translate_env_selection_to_name(self._selected_environment)
environment_id = self._translate_env_name_to_id(environment)
addons = self._get_available_addons(environment_id)
# Switch the screen
ScreenHandler.replace_screen(self, addons)
# The addons were selected, apply and close
else:
self.apply()
self.close()
return InputState.PROCESSED
else:
return super(SoftwareSpoke, self).input(args, key)
return InputState.PROCESSED
示例2: input
# 需要导入模块: from simpleline.render.screen_handler import ScreenHandler [as 别名]
# 或者: from simpleline.render.screen_handler.ScreenHandler import replace_screen [as 别名]
def input(self, args, key):
if self._container.process_user_input(key):
return InputState.PROCESSED
else:
if key.lower().replace("_", " ") in self._lower_zones:
index = self._lower_zones.index(key.lower().replace("_", " "))
self._selection = self._zones[index]
self.apply()
return InputState.PROCESSED_AND_CLOSE
elif key.lower() in self._lower_regions:
index = self._lower_regions.index(key.lower())
if len(self._timezones[self._regions[index]]) == 1:
self._selection = "%s/%s" % (self._regions[index],
self._timezones[self._regions[index]][0])
self.apply()
self.close()
else:
ScreenHandler.replace_screen(self, self._regions[index])
return InputState.PROCESSED
# TRANSLATORS: 'b' to go back
elif key.lower() == C_('TUI|Spoke Navigation|Time Settings', 'b'):
ScreenHandler.replace_screen(self)
return InputState.PROCESSED
else:
return key
示例3: _select_region_callback
# 需要导入模块: from simpleline.render.screen_handler import ScreenHandler [as 别名]
# 或者: from simpleline.render.screen_handler.ScreenHandler import replace_screen [as 别名]
def _select_region_callback(self, data):
region = data
selected_timezones = self._timezones[region]
if len(selected_timezones) == 1:
self._selection = "%s/%s" % (region, selected_timezones[0])
self.apply()
self.close()
else:
ScreenHandler.replace_screen(self, region)
示例4: input
# 需要导入模块: from simpleline.render.screen_handler import ScreenHandler [as 别名]
# 或者: from simpleline.render.screen_handler.ScreenHandler import replace_screen [as 别名]
def input(self, args, key):
""" Handle user input. """
if self._container.process_user_input(key):
return InputState.PROCESSED
else:
# TRANSLATORS: 'b' to go back
if key.lower() == C_("TUI|Spoke Navigation|Language Support", "b"):
ScreenHandler.replace_screen(self)
return InputState.PROCESSED
else:
return super().input(args, key)
示例5: _show_locales_callback
# 需要导入模块: from simpleline.render.screen_handler import ScreenHandler [as 别名]
# 或者: from simpleline.render.screen_handler.ScreenHandler import replace_screen [as 别名]
def _show_locales_callback(self, data):
locales = data
ScreenHandler.replace_screen(self, locales)
示例6: _set_network_install_source
# 需要导入模块: from simpleline.render.screen_handler import ScreenHandler [as 别名]
# 或者: from simpleline.render.screen_handler.ScreenHandler import replace_screen [as 别名]
def _set_network_install_source(self, data):
ScreenHandler.replace_screen(self, self.SET_NETWORK_INSTALL_MODE)