当前位置: 首页>>代码示例>>Python>>正文


Python ScreenHandler.replace_screen方法代码示例

本文整理汇总了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
开发者ID:jaymzh,项目名称:anaconda,代码行数:34,代码来源:software_selection.py

示例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
开发者ID:rvykydal,项目名称:anaconda,代码行数:27,代码来源:time_spoke.py

示例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)
开发者ID:rvykydal,项目名称:anaconda,代码行数:11,代码来源:time_spoke.py

示例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)
开发者ID:zhangsju,项目名称:anaconda,代码行数:13,代码来源:language_support.py

示例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)
开发者ID:zhangsju,项目名称:anaconda,代码行数:5,代码来源:language_support.py

示例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)
开发者ID:zhangsju,项目名称:anaconda,代码行数:4,代码来源:installation_source.py


注:本文中的simpleline.render.screen_handler.ScreenHandler.replace_screen方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。