示例#1
0
 def openLatePrecinctNum(self):
     m = analysis_places_open_late2.open_late(self.data)
     pMap = {}
     for key in m:
         if self.b.machinePrecinctNumMap.has_key(key):
             pMap[self.b.machinePrecinctNumMap[key]] = m[key]
     for key2 in pMap:
         print key2, pMap[key2]
 def openLatePrecinctNum(self):
     m = analysis_places_open_late2.open_late(self.data)
     pMap = {}
     for key in m:
         if self.b.machinePrecinctNumMap.has_key(key):
             pMap[self.b.machinePrecinctNumMap[key]] = m[key]
     for key2 in pMap:
         print key2, pMap[key2]
示例#3
0
#import random as rnd
path = sys.argv[1]
path2 = sys.argv[2]
path3 = sys.argv[3]

parsedLog = AuditLog(open(path, 'r'))
parsedEL68A = el68a.EL68A(open(path3, 'r'))
parsedBallotImage = BallotImage(open(path2, 'r'), parsedLog, parsedEL68A)

# first generate list of valid machines
dateModObject = dateMod.DateMod(parsedLog, parsedEL68A.electionDate)
times, a = dateMod.timeopen(parsedLog, dateModObject.eday)
mmap = dateMod.timecheck(times)
validMachines = mmap.keys()
pollOpenLate = analysis_places_open_late2.open_late(parsedLog,
                                                    parsedBallotImage,
                                                    validMachines)
mapMachA, mapMachB, lTV, pA, pB = consecutiveVotes(parsedLog,
                                                   parsedBallotImage,
                                                   validMachines, pollOpenLate)
#for key, value in sorted(pA.iteritems(), key=lambda (k,v): (v,k), reverse = False):
#print "%3s                 %s" % (key, value)

mapTimeVotes = {}
for time in lTV:
    if not time in mapTimeVotes:
        mapTimeVotes[time] = 1
    else:
        mapTimeVotes[time] += 1
#rnd.seed()
示例#4
0
#import random as rnd
path = sys.argv[1]
path2 = sys.argv[2]
path3 = sys.argv[3]

parsedLog = AuditLog(open(path, 'r'))
parsedEL68A = el68a.EL68A(open(path3, 'r'))
parsedBallotImage = BallotImage(open(path2, 'r'), parsedLog, parsedEL68A)

# first generate list of valid machines
dateModObject = dateMod.DateMod(parsedLog, parsedEL68A.electionDate)
times, a = dateMod.timeopen(parsedLog, dateModObject.eday)
mmap = dateMod.timecheck(times)
validMachines = mmap.keys()
pollOpenLate = analysis_places_open_late2.open_late(parsedLog, parsedBallotImage, validMachines)
mapMachA, mapMachB, lTV, pA, pB = consecutiveVotes(parsedLog, parsedBallotImage, validMachines, pollOpenLate)
#for key, value in sorted(pA.iteritems(), key=lambda (k,v): (v,k), reverse = False):
    #print "%3s                 %s" % (key, value)

mapTimeVotes = {}
for time in lTV:
    if not time in mapTimeVotes:
        mapTimeVotes[time] = 1
    else:
        mapTimeVotes[time] += 1
#rnd.seed()

pollLoc7, pollLoc8, pollLoc9, pollLoc10, pollLoc11, pollLoc12, pollLoc13, pollLoc14, pollLoc15, pollLoc16, pollLoc17, pollLoc18, pollLoc19 = longLine(parsedBallotImage, mapMachA, mapMachB)

#just look the precincts that close after 7 PM to avoid errors