-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
85 lines (70 loc) · 1.99 KB
/
main.py
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
from var import messeges, lines, msg_error, styles
from project import project
from table import table
#Datos
__sqlite = 'data.db'
def cls():
os.system('clear')
def printWait(messege, clean=False):
print(messege)
input()
if clean == True:
cls()
def makeProject():
objP = project(__sqlite)
name_p = input(lines['name_project'])
objP.create_project(name_p)
objP.create_init_install()
def work_project(tupla):
cls()
objP = project(__sqlite)
#tupla esta armado por 0=id, 1=name 2=path
objP.work_project(tupla[0], tupla[1], tupla[2])
def openProject():
cls()
print(messeges['open_project'])
objP = project(__sqlite)
result = objP.get_list_proyect()
selectTrue= False
data_project = ''
while not(selectTrue):
headers = ('ID','NOMBRE', 'RUTA')
tab = table(len(headers))
tab.setMaxWidth(30)
tab.setHeaders(headers)
tab.setBody(result)
tab.print_table()
#for i in result:
# print(styles['result'].format(i))
select_project = input(lines['input_option'])
if select_project.isnumeric():
select_project = int(select_project)
for tupla in result:
if select_project == tupla[0]:
selectTrue = True
objP = None
work_project(tupla)
else:
print('Ingrese un valor valido, un ID')
input('Salio')
def main():
_continue = True
while(_continue):
cls()
print(messeges['menu-welcome'])
_option = input(lines['options'])
if _option == '1':
makeProject()
elif _option == '2':
openProject()
elif _option == '3':
_continue = False
printWait(messeges['exit'])
cls()
else:
printWait(msg_error['error_option'], clean=True)
if __name__ == "__main__":
main()