當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。