Errormessage = 'SQLresponse error for SQL command ' + '\"' + SQLcommand + '\"' if ((SQLresponse) == failure): File.Logerror(ErrorfileObject, module, Errormessage, warning) else: Errormessage = 'No job urls found in ' + OutlookFolder.name File.Logerror(ErrorfileObject, module, Errormessage, warning) EngineIndex += 1 # Display total number of new vacancies Errormessage = str(Totalurlcount) + ' new job urls found in total' File.Logerror(ErrorfileObject, module, Errormessage, info) # Progress update File.Logerror(ErrorfileObject, module, 'Displayed mail folder information', info) # Disconnect from database. Errormessage = 'Could not disconnect from database' if (Db.Disconnect(DbObject, failure) == failure): File.Logerror(ErrorfileObject, module, Errormessage, warning) # Log end of script File.Logerror(ErrorfileObject, module, 'Completed', info) # Close error log file Errormessage = 'Could not close ' + Errorfilename if (File.Close(ErrorfileObject, failure) == failure): File.Logerror(ErrorfileObject, module, Errormessage, warning)
# Add entry in table 'history' to reflect the change in state of the vacancy. Fieldnames = ['engine_id','vacancy_id','vacancy_state'] Fieldvalues = [Engine_Id,Vacancy_Id,'Dropped'] SQLcommand = Db.GenSQLinsert(HistoryTable,Fieldnames,HistoryFields,Fieldvalues) SQLresponse = ( Db.SQLload(DbObject,DbCursor,SQLcommand,failure) ) Errormessage = 'SQLresponse error for SQL command ' + '\"' + SQLcommand + '\"' if ( (SQLresponse) == failure ): File.Logerror(ErrorfileObject,module,Errormessage,warning) Errormessage = 'Vacancy ID %s Vacancy URL %s has been \'Dropped\'' % (Vacancy_Id,Vacancy_Url) File.Logerror(ErrorfileObject,module,Errormessage,info) DuplicateCount += 1 # Progress update if ( DuplicateCount > 0 ) : Errormessage = 'Removed %d duplicate vacancies' % DuplicateCount File.Logerror(ErrorfileObject,module,Errormessage,info) # Disconnect from database. Errormessage = 'Could not disconnect from database' if ( Db.Disconnect(DbObject,failure) == failure ) : File.Logerror(ErrorfileObject,module,Errormessage,warning) # Log end of script File.Logerror(ErrorfileObject,module,'Completed',info) # Close error log file Errormessage = 'Could not close ' + Errorfilename if ( File.Close(ErrorfileObject,failure) == failure ) : File.Logerror(ErrorfileObject,module,Errormessage,warning)