-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
65 lines (48 loc) · 1.95 KB
/
test.py
File metadata and controls
65 lines (48 loc) · 1.95 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
56
57
58
59
60
61
62
63
64
65
import sqlite3
from dataBaseName import dataBaseName
from sqliteQuerys import signalSave
from sqliteQuerys import selectLineProduction
from sqliteQuerys import existSignalFromHour
from sqliteQuerys import signalUpdate
from sqliteQuerys import showMeTheProducaoTable
from sqliteQuerys import existLineProduction
from sqliteQuerys import incrementContadorIntable1
from sqliteQuerys import existDataInTable1
from sqliteQuerys import countToday
from terminalClear import terminalClear
import datetime
import time
#-------------------------------------------------------------------------------
# Verifica se existe algum registro na Tabela Linha de Produção
#-------------------------------------------------------------------------------
if existLineProduction() == False:
terminalClear()
print("Voce esqueceu de Cadastrar uma Linha de Producao. \n Digite: python lineProduction.py para criar!")
exit()
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Verifica se existe algum registro por hora atual e data atual
#-------------------------------------------------------------------------------
if existSignalFromHour() == False:
try:
signalSave(selectLineProduction()[0], selectLineProduction()[1])
print("Novo registro realizado com Sucesso.")
showMeTheProducaoTable()
except Exception as e:
print("Erro ao tentar Cadastrar um novo Registro: ", e)
if existDataInTable1():
print('existe')
else:
print('nao existe dados na tabela1')
else:
try:
signalUpdate()
print("Novo incremento realizado com Sucesso.")
showMeTheProducaoTable()
except Exception as e:
print("Erro ao tentar Incrementar um Registro: ", e)
if existDataInTable1():
incrementContadorIntable1(str(countToday()), selectLineProduction()[1])
else:
print('nao existe dados na tabela1')
#-------------------------------------------------------------------------------