# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr## This file is part of CubicWeb.## CubicWeb is free software: you can redistribute it and/or modify it under the# terms of the GNU Lesser General Public License as published by the Free# Software Foundation, either version 2.1 of the License, or (at your option)# any later version.## CubicWeb is distributed in the hope that it will be useful, but WITHOUT# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more# details.## You should have received a copy of the GNU Lesser General Public License along# with CubicWeb. If not, see <http://www.gnu.org/licenses/>."""module defining the root handler for a lax instance. You should not haveto change anything here."""__docformat__="restructuredtext en"# compute instance's root directoryfromos.pathimportdirname,abspathAPPLROOT=dirname(abspath(__file__))# apply monkey patches firstfromcubicwebimportgoagoa.do_monkey_patch()# get instance's configuration (will be loaded from app.conf file)fromcubicweb.goa.goaconfigimportGAEConfigurationGAEConfiguration.uiprops['JAVASCRIPTS'].append('DATADIR/goa.js')config=GAEConfiguration('toto',APPLROOT)# dynamic objects registryfromcubicweb.goa.goavregimportGAEVregistryvreg=GAEVregistry(config,debug=goa.MODE=='dev')# trigger automatic classes registration (metaclass magic), should be done# before schema loadingimportcustom# load instance'schemavreg.schema=config.load_schema()# load dynamic objectsvreg.load(APPLROOT)# call the postinit so custom get a chance to do instance specific stuffcustom.postinit(vreg)fromcubicweb.wsgi.handlerimportCubicWebWSGIApplicationapplication=CubicWebWSGIApplication(config,vreg=vreg)# main function so this handler module is cacheddefmain():fromwsgiref.handlersimportCGIHandlerCGIHandler().run(application)if__name__=="__main__":main()