def getDataFromCsv(self, dfFileName): try: tempDF = iof.fromCSV(filePath=self.outputLoc, fileName=dfFileName) return tempDF except: errorMsg = self.saveFileName + ' failed to import (getDataFromCsv)' func.errorLog(self.historyLogLoc, self.historyLogFileName\ , errorMsg) return pd.DataFrame()
def finalSave(self, saveName, dFrameName): try: iof.toCSV(pathList=[self.outputLoc], fileName=saveName, dFrame=dFrameName, index=True) except: errorMsg = saveName + ' export failure (finalSave)' print(errorMsg) func.errorLog(self.historyLogLoc, self.historyLogFileName, errorMsg)
def as400Print(self, yyyyMMStr): self.saveFileName=self.saveFileNameFunc(yyyyMMStr) as400TestList=func.getUpdatedThisMonthResults(self.outputLoc, self.saveFileName, self.reportMonthCheckFlag) if as400TestList[0]==0: self.sqlDataReturn=func.runAS400Query(queryText=self.sqlData, odbcVarName=self.odbcVar) func.df_tocsv(self.sqlDataReturn, [self.outputLoc], self.saveFileName) func.errorLog(self.historyLogLoc, self.historyLogFileName\ , as400TestList[1]) else: pass func.errorLog(self.historyLogLoc, self.historyLogFileName\ , as400TestList[1])
def main_2(): #print(func.getUpdatedThisMonthResults(os.getcwd(), 'cceRO_main.py')) func.errorLog('//hke.local/hma/Dept/Customer_Satisfaction/Service Business Development/PS_Merchandising/Contractor/CCE Program/Database'\ ,'test.txt'\ ,'hello world!')