def kmlGetSessionResponse(self, request, quotedId, method): sessionId = urllib.unquote_plus(quotedId) #print 'sessionId:', sessionId #print 'method:', method if method == 'initial': return KmlUtils.wrapKmlDjango(self.kmlGetInitialKml(request, sessionId)) elif method == 'update': return KmlUtils.wrapKmlDjango(self.kmlGetUpdateKml(request, sessionId)) else: raise Exception('method must be "initial" or "update"')
def kmlStartSession(self, request): searchQuery = request.REQUEST.get('q', None) sessionId = GoogleEarthSession.getSessionId(searchQuery) print >>sys.stderr, "ViewKml: started session %s" % sessionId return KmlUtils.wrapKmlDjango(self.kmlGetStartSessionKml(request, sessionId))