#NEWLINE# def process( db_add , db_del , db_equal ) : #NEWLINE# #INDENT# ' Processes RepDB entries in order for syslog, stdout, csv file, etc\n\n    :param repDB db_add: RepDB entry to show added items\n    :param repDB db_del: RepDB entry to show deleted items\n    :param repDB db_equal: RepDB entry to show unchanged values\n    ' #NEWLINE# f = open ( 'cache/coords.txt' , 'w' ) #NEWLINE# count_add = 0 #NEWLINE# count_del = 0 #NEWLINE# count_equal = 0 #NEWLINE# for line in db_add : #NEWLINE# #INDENT# for i in line : #NEWLINE# #INDENT# count_add += 1 #NEWLINE# msg = buildcef ( 'add' , i ) #NEWLINE# syslog ( msg ) #NEWLINE# if config . debug : #NEWLINE# #INDENT# printjson ( 'add' , i ) #NEWLINE# #UNINDENT# f . write ( ( '%s %s\n' % ( i [ 'latitude' ] , i [ 'longitude' ] ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# for line in db_del : #NEWLINE# #INDENT# for i in line : #NEWLINE# #INDENT# count_del += 1 #NEWLINE# msg = buildcef ( 'delete' , i ) #NEWLINE# if config . debug : #NEWLINE# #INDENT# printjson ( 'delete' , i ) #NEWLINE# #UNINDENT# syslog ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# for line in db_equal : #NEWLINE# #INDENT# for i in line : #NEWLINE# #INDENT# count_equal += 1 #NEWLINE# msg = buildcef ( 'update' , i ) #NEWLINE# syslog ( msg ) #NEWLINE# if config . debug : #NEWLINE# #INDENT# printjson ( 'update' , i ) #NEWLINE# #UNINDENT# f . write ( ( '%s %s\n' % ( i [ 'latitude' ] , i [ 'longitude' ] ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# f . close ( ) #NEWLINE# print ( 'Sent {0} New, {1} deleted, and {2} unchanged entries to {3}:{4}' . format ( count_add , count_del , count_equal , config . host , config . port ) )