-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
46 lines (29 loc) · 863 Bytes
/
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
#!/usr/bin/python
# coding=utf-8
import connection
import os
import datetime
import mail
import pill
import replace_data
file = open("/remmeds/log.txt", "a")
date = datetime.datetime.now()
#print(str(date.hour)+":"+str(date.minute))
#print(data)
#Synchro des bdd
userID = connection.selectUserID() #Vérifier si il y'a un user en récupérant son id
if(userID): #si la variable contient un id
#print(userID)
connection.synchroBDD(userID) #La synchro se lance.
file.write("\nUserID -> "+str(userID)) #Log
compNum = connection.checkComp()
print(compNum)
if(compNum):
mail.infos(compNum)
compNum["call"] = "Main"
print("APPEL LED")
pill.led(compNum)
minute = str(date.minute)
minute = replace_data.replace(minute, "num")
file.write("\nlog hour " + str(date.hour)+":"+minute +" --> "+str(compNum) + " Mail ")
file.close()