Package muntjac :: Package addon :: Package invient :: Package demo :: Module invient_demo_app
[hide private]
[frames] | no frames]

Source Code for Module muntjac.addon.invient.demo.invient_demo_app

 1  # @INVIENT_COPYRIGHT@ 
 2  #  
 3  # Licensed under the Apache License, Version 2.0 (the "License");  
 4  # you may not use this file except in compliance with the License.  
 5  # You may obtain a copy of the License at  
 6  #  
 7  #     http://www.apache.org/licenses/LICENSE-2.0  
 8  #  
 9  # Unless required by applicable law or agreed to in writing, software  
10  # distributed under the License is distributed on an "AS IS" BASIS,  
11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
12  # See the License for the specific language governing permissions and  
13  # limitations under the License. 
14   
15  from muntjac.application \ 
16      import Application 
17   
18  from muntjac.addon.invient.demo.invient_demo_win \ 
19      import InvientChartsDemoWin 
20   
21  from muntjac.terminal.gwt.server.http_servlet_request_listener \ 
22      import IHttpServletRequestListener 
23   
24   
25 -class InvientChartsDemoApp(Application, IHttpServletRequestListener):
26
27 - def __init__(self):
28 super(InvientChartsDemoApp, self).__init__() 29 self._isAppRunningOnGAE = None
30 31
32 - def isAppRunningOnGAE(self):
33 if self._isAppRunningOnGAE is None: 34 return False 35 return self._isAppRunningOnGAE
36 37
38 - def init(self):
39 self.setMainWindow(InvientChartsDemoWin()) 40 self.getMainWindow().showNotification( 41 'To hide a series, click on its legend label.')
42 43
44 - def onRequestStart(self, request, response):
45 if self._isAppRunningOnGAE is None: 46 self._isAppRunningOnGAE = False
47 # serverInfo = request.getSession().getServletContext().getServerInfo() FIXME 48 # if serverInfo is not None and 'Google' in serverInfo: 49 # self._isAppRunningOnGAE = True 50 51
52 - def onRequestEnd(self, request, response):
53 pass
54 55 56 if __name__ == '__main__': 57 from muntjac.main import muntjac 58 from invient_demo_app_servlet import InvientChartsDemoAppServlet 59 60 muntjac(InvientChartsDemoApp, nogui=True, forever=True, debug=True, 61 # servletClass=InvientChartsDemoAppServlet, 62 contextRoot='.') 63