コード例 #1
0
    def input(self, args, key):
        """Handle user input. Numbers are used to show a spoke, the rest is passed
        to the higher level for processing."""

        if self._container.process_user_input(key):
            return InputState.PROCESSED
        else:
            # If we get a continue, check for unfinished spokes.  If unfinished
            # don't continue
            # TRANSLATORS: 'c' to continue
            if key == Prompt.CONTINUE:
                for spoke in self._spokes.values():
                    if not spoke.completed and spoke.mandatory:
                        print(
                            _("Please complete all spokes before continuing"))
                        return InputState.DISCARDED
            # TRANSLATORS: 'h' to help
            elif key == Prompt.HELP:
                if self.has_help:
                    help_path = ihelp.get_help_path(self.helpFile,
                                                    self.instclass, True)
                    ScreenHandler.push_screen_modal(HelpScreen(help_path))
                    self.redraw()
                    return InputState.PROCESSED
            return key
コード例 #2
0
    def input(self, args, key):
        """Handle user input. Numbers are used to show a spoke, the rest is passed
        to the higher level for processing."""

        try:
            number = int(key)
            self.app.switch_screen_with_return(self._keys[number])
            return INPUT_PROCESSED

        except (ValueError, KeyError):
            # If we get a continue, check for unfinished spokes.  If unfinished
            # don't continue
            # TRANSLATORS: 'c' to continue
            if key == tui.Prompt.CONTINUE:
                for spoke in self._spokes.values():
                    if not spoke.completed and spoke.mandatory:
                        print(
                            _("Please complete all spokes before continuing"))
                        return INPUT_DISCARDED
            # TRANSLATORS: 'h' to help
            elif key == tui.Prompt.HELP:
                if self.has_help:
                    help_path = ihelp.get_help_path(self.helpFile,
                                                    self.instclass, True)
                    self.app.switch_screen_modal(
                        HelpScreen(self.app, help_path))
                    return INPUT_PROCESSED
            return key
コード例 #3
0
ファイル: __init__.py プロジェクト: wathsalav/anaconda
    def input(self, args, key):
        """Handle the input."""
        # TRANSLATORS: 'h' to help
        if key.lower() == Prompt.HELP:
            if self.has_help:
                help_path = ihelp.get_help_path(self.helpFile, True)
                ScreenHandler.push_screen_modal(HelpScreen(help_path))
                return InputState.PROCESSED_AND_REDRAW

        return super().input(args, key)
コード例 #4
0
ファイル: __init__.py プロジェクト: mariannecx/anaconda
    def input(self, args, key):
        """Handle the input."""
        # TRANSLATORS: 'h' to help
        if key.lower() == tui.Prompt.HELP:
            if self.has_help:
                help_path = ihelp.get_help_path(self.helpFile, self.instclass, True)
                self.app.switch_screen_modal(HelpScreen(self.app, help_path))
                return INPUT_PROCESSED

        return super(NormalTUISpoke, self).input(args, key)
コード例 #5
0
ファイル: __init__.py プロジェクト: dougsland/anaconda
    def input(self, args, key):
        """Handle the input."""
        # TRANSLATORS: 'h' to help
        if key.lower() == tui.Prompt.HELP:
            if self.has_help:
                help_path = ihelp.get_help_path(self.helpFile, self.instclass, True)
                self.app.switch_screen_modal(HelpScreen(self.app, help_path))
                return INPUT_PROCESSED

        return super(NormalTUISpoke, self).input(args, key)
コード例 #6
0
ファイル: __init__.py プロジェクト: jaymzh/anaconda
    def input(self, args, key):
        """Handle the input."""
        # TRANSLATORS: 'h' to help
        if key.lower() == Prompt.HELP:
            if self.has_help:
                help_path = ihelp.get_help_path(self.helpFile, self.instclass, True)
                ScreenHandler.push_screen_modal(HelpScreen(help_path))
                self.redraw()
                return InputState.PROCESSED

        return super(NormalTUISpoke, self).input(args, key)
コード例 #7
0
    def input(self, args, key):
        """Handle the input."""
        # TRANSLATORS: 'h' to help
        if key.lower() == Prompt.HELP:
            if self.has_help:
                help_path = ihelp.get_help_path(self.helpFile, self.instclass,
                                                True)
                ScreenHandler.push_screen_modal(HelpScreen(help_path))
                self.redraw()
                return InputState.PROCESSED

        return super(NormalTUISpoke, self).input(args, key)
コード例 #8
0
ファイル: __init__.py プロジェクト: zhangsju/anaconda
    def input(self, args, key):
        """Handle user input. Numbers are used to show a spoke, the rest is passed
        to the higher level for processing."""

        if self._container.process_user_input(key):
            return InputState.PROCESSED
        else:
            # If we get a continue, check for unfinished spokes.  If unfinished
            # don't continue
            # TRANSLATORS: 'c' to continue
            if key == Prompt.CONTINUE:
                for spoke in self._spokes.values():
                    if not spoke.completed and spoke.mandatory:
                        print(_("Please complete all spokes before continuing"))
                        return InputState.DISCARDED
            # TRANSLATORS: 'h' to help
            elif key == Prompt.HELP:
                if self.has_help:
                    help_path = ihelp.get_help_path(self.helpFile, self.instclass, True)
                    ScreenHandler.push_screen_modal(HelpScreen(help_path))
                    return InputState.PROCESSED_AND_REDRAW
            return key
コード例 #9
0
ファイル: __init__.py プロジェクト: LiuCan01/anaconda
 def _on_help_clicked(self, window):
     # the help button has been clicked, start the yelp viewer with
     # content for the current spoke
     ihelp.start_yelp(ihelp.get_help_path(self.helpFile, self.instclass))
コード例 #10
0
ファイル: __init__.py プロジェクト: zhangsju/anaconda
 def _on_help_clicked(self, window):
     # the help button has been clicked, start the yelp viewer with
     # content for the current spoke
     ihelp.start_yelp(ihelp.get_help_path(self.helpFile, self.instclass))
コード例 #11
0
 def _on_help_clicked(self, window, obj):
     # the help button has been clicked, start the yelp viewer with
     # content for the current screen
     ihelp.start_yelp(ihelp.get_help_path(obj.helpFile))