def __init__(self, handler=None, root=None, extra_configs=None):
        """rueckenwind Application to plug into tornado's httpserver.

        Either `root` or `handler` must be specified.

        :param rw.http.Module root: The root module to serve
        :param handler: The request handler (should subclass `tornado.web.RequestHandler`)
        :param extra_configs: path to alternative config file for rueckenwind
        """
        self.settings = {}
        self.rw_settings = {}
        self.root = root
        self.scope = rw.scope.Scope()
        self.scope['app'] = self
        self.extra_configs = extra_configs
        if self.root:
            self.handler = handler if handler is not None else RequestHandler
            self.scope['settings'] = rw.cfg.read_configs(self.root.name,
                                                         self.extra_configs)

            pkgs = self.scope['settings'].get('rw.templates', {}).get('pkgs', None)
            if not pkgs:
                pkgs = [root.name]

            self.scope['template_env'] = rw.template.create_template_env(pkgs)
            self.scope['template_env'].globals['app'] = self
        else:
            self.handler = handler
            self.scope['settings'] = {}
            assert handler is not None

        self._wsgi = False  # wsgi is not supported
        # compatibility so we can mount tornado RequestHandlers
        self.ui_modules = {}
        self.ui_methods = {}
        rw.server.PHASE_CONFIGURATION.add(self.configure)
def __init__ ( self , handler = None , root = None , extra_configs = None ) : self . settings = { } self . rw_settings = { } self . root = root self . scope = rw . scope . Scope ( ) self . scope [ 'app' ] = self self . extra_configs = extra_configs if self . root : self . handler = handler if handler is not None else RequestHandler self . scope [ 'settings' ] = rw . cfg . read_configs ( self . root . name , self . extra_configs ) pkgs = self . scope [ 'settings' ] . get ( 'rw.templates' , { } ) . get ( 'pkgs' , None ) if not pkgs : pkgs = [ root . name ] self . scope [ 'template_env' ] = rw . template . create_template_env ( pkgs ) self . scope [ 'template_env' ] . globals [ 'app' ] = self else : self . handler = handler self . scope [ 'settings' ] = { } assert handler is not None self . _wsgi = False self . ui_modules = { } self . ui_methods = { } rw . server . PHASE_CONFIGURATION . add ( self . configure )
rueckenwind Application to plug into tornado's httpserver.

        Either `root` or `handler` must be specified.

        :param rw.http.Module root: The root module to serve
        :param handler: The request handler (should subclass `tornado.web.RequestHandler`)
        :param extra_configs: path to alternative config file for rueckenwind