How to use the glances.compat.input function in Glances

To help you get started, we’ve selected a few Glances examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nicolargo / glances / glances / password.py View on Github external
# password_confirm is the clear password (only used to compare)
                password_confirm = self.sha256_hash(getpass.getpass('Password (confirm): '))

                if not self.check_password(password_hashed, password_confirm):
                    logger.critical("Sorry, passwords do not match. Exit.")
                    sys.exit(1)

            # Return the plain SHA-256 or the salted password
            if clear:
                password = password_sha256
            else:
                password = password_hashed

            # Save the hashed password to the password file
            if not clear:
                save_input = input('Do you want to save the password? [Yes/No]: ')
                if len(save_input) > 0 and save_input[0].upper() == 'Y':
                    self.save_password(password_hashed)

        return password
github nicolargo / glances / glances / main.py View on Github external
def __get_username(self, description=''):
        """Read an username from the command line.
        """
        return input(description)
github nicolargo / glances / glances / main.py View on Github external
def __get_username(self, description=''):
        """Read an username from the command line."""
        return input(description)