def autorun(self, args, loop=True):
        """
        The accessible method for dynamically running a screen.
        This method will basically parse the arguments, prepare them with
        the method `_parse_args` that is inherited in sub-classes, and with
        the property `cli_opts` that holds the formatting of the arguments.

        Once all is ready to go, this will call the `_run_cycle` method, which
        is filled in the sub-classes with the algorithms to display text on
        screen to behave as a screensaver.

        The arguments of this method are:

            * args: (MANDATORY) the arguments passed when termsaver is executed
                    from command-line. See `termsaver` script for details.

            * loop: (OPTIONAL) defines if termsaver should be executing on an
                    infinite looping (goes on until the keyboard interrupt
                    (Ctrl+C) is pressed), or not. This is up to the screen
                    action (or end-user through configuable setting) to decide.
        """

        # prepare values and validate
        if not args:
            args = ''
        if not self.cli_opts \
            or 'opts' not in self.cli_opts.keys() \
                or not self.cli_opts['opts']:
            self.cli_opts['opts'] = ''
        if not self.cli_opts['long_opts']:
            self.cli_opts['long_opts'] = []
        else:
            if not type(self.cli_opts['long_opts']) is list or \
                [type(i) == str for i in self.cli_opts['long_opts']] \
                    != [True for __ in range(len(self.cli_opts['long_opts']))]:
                #
                # Don't worry too much about errors here. This is supposed to
                # help developers while programming screens for this app.
                #
                raise Exception("Value of 'long_opts' in cli_opts dict MUST "\
                                "be a list of strings.")

        try:
            self._parse_args(getopt.getopt(args, self.cli_opts['opts'],
                                     self.cli_opts['long_opts']))
        except getopt.GetoptError, e:
            raise exception.InvalidOptionException("", str(e))

        # execute the cycle
        self.clear_screen()

        while(loop):
            try:
                self._run_cycle()
            except __HOLE__, e:
                #
                # do some cleanup if applicable
                #
                self._on_keyboard_interrupt()
                raise e

            # Clear screen if appropriate
            if self.cleanup_per_cycle:
                self.clear_screen()
dataset/ETHPy150Open brunobraga/termsaver/termsaverlib/screen/base/__init__.py/ScreenBase.autorun