Esempio n. 1
0
	def do_POST(self):
		form = cgi.FieldStorage()
		startLocation = form["startnode"].value
		endLocation = form["endnode"].value
		endTime = form["starttime"].value
		startTime = form["endtime"].value

		#TODO: checkout what time is and converto to datetime.time

		startInfo = googlequery(startLocation)
		endInfo = googlequery(endLocation)

		pathFinder = PathFinder(startInfo[1], endInfo[1], startInfo[0], 
								endInfo[0], startTime, endTime, graph)

		result = pathFinder.getJsonDataFromDatabase()
		print "Content-type: application/json"#"Content-type: text/plain"
		print
		print result
Esempio n. 2
0
from googlequery import *
from pathFinder import *
from pathGenerator import *
import datetime
import json

#pathGenerator = PathGenerator()
#pathGenerator.createPathDict()
#print "successfully created the dictionary and logged into the database!"

form = cgi.FieldStorage()
startLocation = form["startnode"].value
endLocation = form["endnode"].value
startTime = form["starttime"].value
endTime = form["endtime"].value
startTime = datetime.time(int(startTime[:2]), int(startTime[5:7]))
endTime = datetime.time(int(endTime[:2]), int(endTime[5:7]))
#TODO: checkout what time is and converto to datetime.time

startInfo = googlequery(startLocation)
endInfo = googlequery(endLocation)

pathFinder = PathFinder(startInfo[1], endInfo[1], startInfo[0], endInfo[0],
                        startTime, endTime, pathGenerator.graph)

result = pathFinder.getJsonDataFromDatabase()

print result