def main(): app_manager = AppManager(STORE_URL='store', LOCAL_URL='local') template = Template( html_file=join('gui', 'app_manager.html'), base_url='gui', recommended_size=(600,500) ) if len(sys.argv)>1 and sys.argv[1] == 'web': app = WebApp(template=template, context={'app_manager': app_manager}, port=8000) else: app = QtApp(template=template, context={'app_manager': app_manager}) app.start()
Name: {{person.name}} Age: {{person.age}} """), command='ipython notebook examples_notebook.ipynb' ), ] return examples def get_example(self, ID): ''' Return the example with the given ID.''' example = None for example in self.examples: if example.ID == ID: return example return None #### UI layer #### template = Template(html_file='demo.html', recommended_size=(1400, 800)) #### Entry point #### if __name__ == '__main__': examples_server = ExamplesServer(root=expanduser('~/work/jigna/examples')) app = WebApp(template=template, context={'server': examples_server}, port=8001) app.start()