@ -66,6 +66,7 @@ else:
out , err = process . communicate ( )
if err == None :
serverResults = { }
serverScores = { }
results = json . loads ( out )
for result in results :
#2015-08-08T12:26:42.894Z
@ -74,7 +75,8 @@ else:
key = str ( result [ ' problemId ' ] ) + " . " + str ( result [ ' seed ' ] )
if not key in serverResults or serverResults [ key ] [ ' createdAt ' ] < result [ ' createdAt ' ] :
serverResults [ key ] = result
#print results
if not key in serverScores or serverScores [ key ] < result [ ' score ' ] :
serverScores [ key ] = result
tags = { }
for serverResult in serverResults :
if not serverResults [ serverResult ] [ ' tag ' ] in tags :
@ -101,6 +103,11 @@ else:
print bcolors . WARNING + str ( solutionToSend [ ' problemId ' ] ) + " " + str ( solutionToSend [ ' seed ' ] ) + " solution evaluation pending " + bcolors . ENDC
elif scores [ key ] != serverResults [ key ] [ ' score ' ] :
print bcolors . FAIL + str ( solutionToSend [ ' problemId ' ] ) + " " + str ( solutionToSend [ ' seed ' ] ) + " score differ: " + str ( scores [ key ] ) + " != " + str ( serverResults [ key ] [ ' score ' ] ) + " (server) " + bcolors . ENDC
elif serverScores [ key ] [ ' score ' ] > scores [ key ] :
print bcolors . FAIL + str ( solutionToSend [ ' problemId ' ] ) + " " + str ( solutionToSend [ ' seed ' ] ) + " better solution alredy exists on the server: " + serverScores [ key ] [ ' solutions ' ] + bcolors . ENDC
print 32432432
elif not key in serverScores :
print " cazziammolla "
print " Tags statistics: "
for tag in tags :
print " %s : %d " % ( tag , tags [ tag ] )