Exemplo n.º 1
0
        else:
            print ''
            print 'Starting over...'
            print ''

except:
    print 'An unexpected error occurred building inputs: ' + str(
        sys.exc_info()[0])
    var = raw_input("Hit enter to quit")

try:
    ###################################################################################################
    #	BUILD INPUT LIST
    ###################################################################################################

    testInputs = wppbatchlib.inputData()

    numInputs = 0
    doneWithFile = False
    while not doneWithFile:
        row = next(iFileReader, 'thisistheend')
        if row != 'thisistheend':
            numInputs += 1
            #build URL
            apiURL = 'http://' + apiHost + '/2.1/location.json?'
            for i in inputMap:
                if len(row[int(i[1])]) > 0:
                    apiURL += str(i[0]).lower() + '=' + str(
                        urllib.quote(row[int(i[1])])) + '&'

            apiURL += 'api_key=' + apiKey
			inputsFinalized = True
		else:
			print ''
			print 'Starting over...'
			print ''
	
except:
	print 'An unexpected error occurred building inputs: '+str(sys.exc_info()[0])
	var = raw_input("Hit enter to quit")

try:	
	###################################################################################################
	#	BUILD INPUT LIST
	###################################################################################################

	testInputs = wppbatchlib.inputData()

	numInputs = 0
	doneWithFile = False
	while not doneWithFile:
		row = next(iFileReader, 'thisistheend')
		if row != 'thisistheend':
			numInputs += 1
			#build URL
			apiURL = 'http://'+apiHost+'/3.2/identity_check_fast.json?'
			for i in inputMap:
				if len(row) > int(i[1]):
					if len(row[int(i[1])]) > 0:
						apiURL += str(i[0]).lower()+'='+str(urllib.quote(row[int(i[1])]))+'&'
			apiURL += 'api_key='+apiKey
			#add to testInputs