def checkAndWriteSQL(self, input1, input2, input3): ''' The inputs should be the 3 StrVar values added by the user in the GUI. After checking the integrity of the inputs, runs the errorChecking module, then the SQL-writing module. ''' #Convert the StrVars to strings value1 = str(input1.get()) value2 = str(input2.get()) value3 = str(input3.get()) if not self.integrityCheck(value1, value2, value3): print "Problem with data! No work done." else: errorCheck(value1, value2) sourceFileName = path.basename(value1) outFileName = path.basename(value2) print "Finished writing summary of", sourceFileName, "to", outFileName writeAll(value1, value3, True) sourceFileName = path.basename(value1) outFileName = path.basename(value3) print "Finished writing SQL from", sourceFileName, "to", outFileName input1.set("") #Clear out file name input2.set("") #Clear out file name input3.set("") #Clear out file name
def checkAndWriteSQL(self, inputFile, limitLogDates, focalLogFile, dontBlankLog, errorCheckedFile, outSQLFile, dontBlankAnything): ''' The inputs should be the values added by the user in the GUI. After checking the integrity of the inputs, runs the errorChecking module, then the SQL-writing module. ''' #Convert the StrVars to strings inFile = str(inputFile.get()) logFile = str(focalLogFile.get()) limitDates = limitLogDates.get() errorFile = str(errorCheckedFile.get()) sqlFile = str(outSQLFile.get()) noBlankLog = dontBlankLog.get() noBlankAnything = dontBlankAnything.get() if not self.integrityCheck(inFile, logFile, limitDates, errorFile, sqlFile): # The dontBlank___ things aren't included because there's # nothing to check related to them print("Problem with data! No work done.") else: errorCheck(inFile, errorFile, logFile, limitDates) sourceFileName = path.basename(inFile) outFileName = path.basename(errorFile) print("Finished writing summary of", sourceFileName, "to", outFileName) writeAll(inFile, sqlFile, True) sourceFileName = path.basename(inFile) outFileName = path.basename(sqlFile) print("Finished writing SQL from", sourceFileName, "to", outFileName) if not noBlankAnything: inputFile.set("") #Clear out file name errorCheckedFile.set("") #Clear out file name outSQLFile.set("") #Clear out file name if not noBlankLog: focalLogFile.set("") #Clear out file name
def writeAllSQL(self, input1, input2): ''' The 2 inputs should be the 2 StrVar values added by the user in the GUI. After checking the integrity of the inputs, writes SQL to add data to Babase. ''' #Convert the StrVars to strings value1 = str(input1.get()) value2 = str(input2.get()) if not self.integrityCheck(value1, value2): print "Problem with data! No work done." else: writeAll(value1, value2, True) sourceFileName = path.basename(value1) outFileName = path.basename(value2) print "Finished writing SQL from", sourceFileName, "to", outFileName input1.set("") #Clear out file name input2.set("") #Clear out file name
def writeAllSQL(self, input1, input2): ''' The 2 inputs should be the 2 StrVar values added by the user in the GUI. After checking the integrity of the inputs, writes SQL to add data to Babase. ''' #Convert the StrVars to strings value1 = str(input1.get()) value2 = str(input2.get()) if not self.integrityCheck(value1, value2): print("Problem with data! No work done.") else: writeAll(value1, value2, True) sourceFileName = path.basename(value1) outFileName = path.basename(value2) print("Finished writing SQL from", sourceFileName, "to", outFileName) input1.set("") #Clear out file name input2.set("") #Clear out file name