Repository navigation
Expand file tree
/
Copy pathops.py
More file actions
55 lines (40 loc) · 1.41 KB
/
Copy pathops.py
File metadata and controls
55 lines (40 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from utils import limpa_tela, retorna_ao_menu, exibir_subTitulos
from crud_restaurante import cadastrar_restaurante, listar_restaurantes, alternar_estado_restaurante
def exibir_nome_programa():
print('Sabor Express')
def exibir_opcoes():
## ----- Menu ------ ##
### ----- 1. Cadastrar: Restaurante ------ ###
### ----- 2. Listar: Restaurante ------ ###
### ----- 3. Ativar: Restaurante ------ ###
### ----- 4. Sair: Restaurante ------ ###
op = ['1. Cadastrar: Restaurante', '2. Listar: Restaurante', '3. Altera Status: Restaurante', '4. Sair']
print(op[0])
print(op[1])
print(op[2])
print(op[3])
return op
retorna_ao_menu()
def escolhe_opcao():
exibir_opcoes()
### ---- Verifica opção escolhida ----- ###
### Por match -> >=3.10 ###
try:
opcao_escolhida = int(input('Escolha uma opção: '))
match opcao_escolhida:
case 1:
cadastrar_restaurante()
case 2:
listar_restaurantes()
case 3:
alternar_estado_restaurante()
case 4:
exibir_subTitulos('Finalizando o app')
case _:
exibir_subTitulos('Opção inválida')
limpa_tela()
retorna_ao_menu()
except ValueError:
exibir_subTitulos('Opção inválida')
limpa_tela()
retorna_ao_menu()