Skip to content
Snippets Groups Projects
Select Git revision
  • 1042e1cc6a76558fa2e9735675861d4885b23bbe
  • master default protected
2 results

batch_unlizeToNotebook.sh

Blame
  • console.py 1.59 KiB
    #!/usr/bin/python3
    # -*- coding: utf-8 -*
    # Copyright (C) 2017 Tetras Libre <contact@Tetras-Libre.fr>
    # Author: Beniamine, David <David.Beniamine@Tetras-Libre.fr>
    #
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU Affero General Public License as
    # published by the Free Software Foundation, either version 3 of the
    # License, or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU Affero General Public License for more details.
    #
    # You should have received a copy of the GNU Affero General Public License
    # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    from zxcvbn import zxcvbn
    from dateutil.parser import parse
    import getpass
    from test_pass import test_pass
    
    # Read password
    passwd = getpass.getpass("Merci d'entrer un mot de passe qui ne sera pas affiché\n")
    
    word = "a"
    user_inputs = []
    while word != "":
        word = input("Veuillez entrer un mot d'aide ou une date au format jj/mm/yyyy pour le système ou tappez [entrer]"
                     "pour arrêter\n")
        if word != "":
            try:
                date = parse(word)
                words = [date.day]
                words.append(date.month)
                words.append(date.year)
            except:
                words = [word]
            finally:
                for word in words:
                    user_inputs.append(word)
    
    # TODO call wrapper
        lines = test_pass(passwd, user_inputs)
    for line in lines:
        print(line)