-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLimpiezaCompleta.py
71 lines (48 loc) · 1.78 KB
/
LimpiezaCompleta.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
# -*- coding: utf-8 -*-
"""
Created on Wed May 3 12:01:58 2017
@author: Luis Carlos Prieto
"""
import log
import ta_MongoDB
import ta_SQLServer
import ta_DataCleaner
def main():
# Variables Generales...
Errores = 0
miLog = log.Log()
GestorMongoDB = ta_MongoDB.MongoDB
GestorSQLServer = ta_SQLServer.SQLServer
miLog.Salidaln("Bienvenido al Manager MBIT, Iniciando servicios...")
try:
# Iniciamos el proceso...
# Creación del Gestor de MongoDB
GestorMongoDB = ta_MongoDB.MongoDB()
except Exception as e:
Errores += 1
miLog.Salidaln("ERROR generando Gestor de MongoDB")
try:
# Creación del -Gestor de SQL Server
GestorSQLServer = ta_SQLServer.SQLServer()
except Exception as e:
Errores += 1
miLog.Salidaln("ERROR generando Gestor de SQL Server..." + e.with_traceback)
return -1
try:
#Una vez aseguradas las conexiones a BBDD, cargamos los Tweets en formato JSON
GestorMongoDB.CargarJSON()
# Creación del DataCleaner y Volcados a SQL Server
DataCleaner = ta_DataCleaner.DataCleaner(GestorMongoDB.m_ListaJSON)
DataCleaner.AnalisisTweets()
GestorSQLServer.RegenerarTwiteros(DataCleaner.m_ListaTwiteros)
GestorSQLServer.RegenerarTimeline(DataCleaner.m_ListaTimeline)
GestorSQLServer.m_conSQL.close()
except Exception as e:
Errores += 1
miLog.Salidaln("ERROR No se ha podido generar DataCleaner ")
if (Errores > 0 ):
miLog.Salidaln("ERRORES DETECTADOS")
else:
miLog.Salidaln("Proceso finalizado con exito...")
main()