80 lines
2.4 KiB
Python
80 lines
2.4 KiB
Python
import os
|
|
|
|
from App.Config.GeneralConfig import GeneralConfig
|
|
from App.Config.GeneralConfig import ConfigFTP
|
|
from App.Utils.db_utils import DatabaseManager
|
|
from App.Utils.ftp_utils import FTPManager
|
|
from App.Utils.sftp_utils import SFTPManager
|
|
from App.Utils.sharepoint_utils import SharepointManager
|
|
|
|
|
|
|
|
class PGConfig:
|
|
def __init__(self):
|
|
#Inicializando la base de datos
|
|
self.databaseCode = 'glm_pg'
|
|
self.databaseID = '00080001'
|
|
|
|
self.database = DatabaseManager(self.databaseCode, self.databaseID)
|
|
|
|
#Inicializando SharePoint
|
|
self.userSharepoint = 'gldatadeployment.im@pg.com'
|
|
self.passwordSharepoint = 'Glm-infinity-2025'
|
|
self.siteSharepoint = 'https://pgone.sharepoint.com/sites/eLeaderDataSharing'
|
|
|
|
data = self.database.get_execute_query("select reportID, parameter from TransferDataParameter where category = 'Sharepoint'")
|
|
|
|
self.sharepointPath = {
|
|
row['reportID']: row['parameter']
|
|
for row in data
|
|
}
|
|
|
|
|
|
self.sharepoint = SharepointManager(self.siteSharepoint, self.userSharepoint, self.passwordSharepoint)
|
|
|
|
#Inicialzando el FTP
|
|
self.ftpdatabase = FTPManager(ConfigFTP.ftp_server, ConfigFTP.ftp_user, ConfigFTP.ftp_password, ConfigFTP.ftp_port)
|
|
|
|
#Inicializando el SFTP
|
|
#self.sftp_host = 'c6a3nxpth6mf4.eastus2.azurecontainer.io'
|
|
#self.sftp_port = 22
|
|
#self.sftp_username = 'eLeader01'
|
|
#self.sftp_password = 'c8gNBhJE@zt$ZkT&'
|
|
|
|
#self.sftpdatabase = SFTPManager(self.sftp_host, self.sftp_port, self.sftp_username, self.sftp_password)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#General configuration PG
|
|
self.areaID = '0001'
|
|
self.project_name = 'PG'
|
|
self.classID = '0003'
|
|
|
|
self.reports = self.database.get_execute_query(f"select * from TransferData where active = 1")
|
|
|
|
|
|
|
|
|
|
|
|
self.reportsID = {'Cobertura':'0001',
|
|
'Negociadas':'0002',
|
|
'Promociones':'0003',
|
|
#'Precios':'0004',
|
|
#'Fmot':'0005',
|
|
'QualityDisplay':'0006',
|
|
'Checkout':'0007',
|
|
'QualityShelf':'0008',
|
|
'SOS':'0009',
|
|
#'OsaTorre':'0010',
|
|
#'OsaPsmt':'0011',
|
|
'OsaFarmacia':'0012',
|
|
'OsaMassy':'0013',
|
|
'OsaPenny':'0014',
|
|
'OsaFotografico':'0015',
|
|
'DataAvailability':'0016'
|
|
}
|
|
|