예제 #1
0
def makeJson(party):
    data = getData()
    reader.readVotes(data, party)
    state = data['state']
    counties = data['counties']
    for county in counties.itervalues():
        del county['centroid']
        del county['points']

    result = {'status': 'ok', 'state': state, 'counties': counties}

    write('../results_%s.js' % party,
          'Json.%sResults(%s)' % (party, json(result)))
예제 #2
0
def makeJson(party):
    data = getData()
    reader.readVotes(data, party)
    state = data["state"]
    counties = data["counties"]
    for county in counties.itervalues():
        # del county['centroid']
        del county["shapes"]

    result = {"status": "ok", "state": state, "counties": counties}

    write("results_%s.js" % party, "Json.%sResults(%s)" % (party, json(result)))

    print "%s of %s precincts reporting" % (state["precincts"]["reporting"], state["precincts"]["total"])
예제 #3
0
def makeJson(party):
    data = getData()
    reader.readVotes(data, party)
    state = data['state']
    counties = data['counties']
    for county in counties.itervalues():
        #del county['centroid']
        del county['shapes']

    result = {'status': 'ok', 'state': state, 'counties': counties}

    write('results_%s.js' % party,
          'Json.%sResults(%s)' % (party, json(result)))

    print '%s of %s precincts reporting' % (state['precincts']['reporting'],
                                            state['precincts']['total'])
예제 #4
0
def makeJson( party ):
	data = getData()
	reader.readVotes( data, party )
	state = data['state']
	counties = data['counties']
	for county in counties.itervalues():
		del county['centroid']
		del county['points']
	
	result = {
		'status': 'ok',
		'state': state,
		'counties': counties
	}
	
	write(
		'../results_%s.js' % party,
		'Json.%sResults(%s)' %( party, json(result) )
	)
예제 #5
0
def makeJson( party ):
	data = getData()
	reader.readVotes( data, party )
	state = data['state']
	counties = data['counties']
	for county in counties.itervalues():
		#del county['centroid']
		del county['shapes']
	
	result = {
		'status': 'ok',
		'state': state,
		'counties': counties
	}
	
	write(
		'results_%s.js' % party,
		'Json.%sResults(%s)' %( party, json(result) )
	)
	
	print '%s of %s precincts reporting' %( state['precincts']['reporting'], state['precincts']['total'] )
예제 #6
0
 def make(party):
     data = getData(earth)
     reader.readVotes(data, party)
     writeKML(earth, data["counties"], party)
예제 #7
0
 def make(party):
     data = getData(earth)
     reader.readVotes(data, party)
     writeKML(earth, data['counties'], party)