def list_employee():
    clear()
    print("ID |      NOME      |      FUNÇÃO     |  SALÁRIO  ")
    for x in dao_funcionario.select_all():
        print(str(x).strip("()").replace(",", " - "))

    input("\nAperte [ENTER] para voltar ao menu: ")
    clear()
    main_menu()
Exemple #2
0
    def _get_word(self):
        """
        Allow Player #1 to enter the word
        """
        print('Make sure Player #2 is not watching the screen!')
        word = input('Please enter the word: ')

        clear()
        return word.lower()
Exemple #3
0
    def _draw_field(self):
        clear()

        if self.notification:
            print(self.notification)

        self._draw_word()
        self._draw_hangman()
        self._draw_abc()
Exemple #4
0
def credit():
    clear()
    print("made with love by Laodeus")
    print("extreme 2d graphisme by Laodeus")
    print("silent music by Laodeus")
    print("(i)logic by Laodeus")

    wait()
    clear()
    
 def input_warnings():
     clear()
     # Instructions
     print("Run the DEBUG program in MS-DOS")
     print("Load the floppy data into the RAM memory")
     print("In MS-DOS: L 0 0 0 70")
     print("Dump the Reserved Area's memory region")
     print("In MS-DOS: D 0")
     input("Copy each line just like are in DOS's terminal except for '-' between byte 7 and 8.")
     clear()
     print("Dump the Reserved Area's memory region (2 lines)")
def add_employee():
    funcionario = Funcionario()
    clear()
    print("[NOVO FUNCIONÁRIO]")
    while (True):
        funcionario.set_name(input("Digite o nome do funcionário: "))
        funcionario.set_function(input("Digite a função do funcionário: "))
        funcionario.set_salary(input("Digite o salário do funcionário: "))
        clear()
        if (dao_funcionario.add(funcionario) == 1):
            return True
        else:
            return False
def update_employee():
    funcionario = Funcionario()
    clear()
    print("[ATUALIZAR FUNCIONÁRIO]")
    while (True):
        for x in dao_funcionario.select_name_id_all():
            print(str(x).strip('()').replace(",", "-"))

        choice = int(input("Escolha um para ser atualizado: "))

        if (dao_funcionario.select_id_exist(choice) == 1):
            clear()
            print(f"[ATUALIZANDO: {dao_funcionario.select_id(choice)}]")

            funcionario.set_name(input("Digite o nome do funcionário: "))
            funcionario.set_function(input("Digite a função do funcionário: "))
            funcionario.set_salary(input("Digite o salário do funcionário: "))

            if (dao_funcionario.update(funcionario, choice) == 1):
                clear()
                print("{Atualizdo com sucesso...}\n")
                break
        else:
            clear()
            print("{Opção inválida! Digite novamente...}\n")
            print("[ATUALIZAR FUNCIONÁRIO]")
Exemple #8
0
    def _draw_final(self):
        clear()

        color = Fore.GREEN if self.state == 'win' else Fore.RED

        print(color, self.notification, Fore.RESET, sep='\n')

        print(f'The word was: ')
        self._draw_word(True)

        if self.state == 'lost':
            self._draw_hangman()

        print('Stats:')
        print(f'Total Attempts: {len(self.attempts)}')
        print(f'Wrong Attempts: {self.gallows}')
Exemple #9
0
def menu(args):
    """
    docstring
        it ask the menu item to the cust and return it's choice if it's a right choice
    """
    clear()
    menu = args
    print("choose an option => ")
    print(menu)
    userInpt = input()

    while not userInpt in menu:
        print("Invalid argument")
        print("choose an option => ")
        print(menu)
        userInpt = input()

    return userInpt
    def take_dump(self, double_check=False, rows=2):
        """
        Use the data in memory to instrospect the attributes of file system.
        The correct data passing is user's responsabilty.
        :param rows: Number of rows to read
        :param double_check: For who want warrancy against mistyping with this flag on you have to type the data
        twice to check if are equal. This do not deny the fact that you can get wrong equal two times.
        """
        self.input_warnings()
        # Input
        stream = Input.enter_data(rows=rows)

        # Double check trigger
        if double_check:
            check = Input.enter_data(rows=2, confirmation=True)
            if check != stream:
                clear()
                input("The data dont match, type all again, please.")
                self.take_dump(double_check=True)
        clear()
        self.dump = stream
Exemple #11
0
def main_menu():
    clear()
    _pass = True
    while (_pass):
        print("     [EMPRESA CHARTOS]")
        choice = int(
            input(
                "1 - Lista de funcionários \n2 - Adicionar funcionário"
                "\n3 - Atualizar um funcionário \n4 - Deletar um funcionário \n0 - Sair \n\nEscolha uma opção: "
            ))

        if (choice == 1):
            list_employee()
        if (choice == 2):
            print("{Adicionado com sucesso...}\n") if add_employee(
            ) == True else print(
                "Acorreu um erro por favor repita o processo...")
        if (choice == 3):
            update_employee()
        if (choice == 4):
            delete_employee()
        if (choice == 0):
            clear()
            print("Obrigado por utilizar nosso sistema!")
            sys.exit()
        clear()
Exemple #12
0
def delete_employee():
    funcionario = Funcionario()
    clear()
    print("[DELETAR FUNCIONÁRIO]")
    while (True):
        for x in dao_funcionario.select_name_id_all():
            print(str(x).strip('()').replace(",", "-"))

        choice = int(input("Escolha um para ser excluído: "))
        if (dao_funcionario.delete_by_id(choice) == 1):
            clear()
            print("{Excluido com sucesso...}\n")
            break
        else:
            clear()
            print("{Opção inválida! Digite novamente...}\n")
            print("[DELETAR FUNCIONÁRIO]")
Exemple #13
0
def quiting():
    print("Goodbye")
    clear()
    quit()