Exemple #1
0
    def __call__(self, environ, start_response):
        # load up the config from the config file. Only needs to be
        # done once per interpreter. This is the entry point of all
        # siesta applications, so this is where we trap it.
        _conf = config.get_config()
        if _conf is None:
            import os.path
            fname = os.path.join(
                environ.get('ll.config_dir', '/local/linden/etc'),
                'indra.xml')
            config.load(fname)

        # proceed with handling the request
        self._create_routes()
        path_info = environ['PATH_INFO']
        request_method = environ['REQUEST_METHOD']
        allowed = []
        for regex, app, methods in self._routes:
            m = regex.match(path_info)
            if m:
                #print "groupdict:",m.groupdict()
                if not methods or request_method in methods:
                    environ['paste.urlvars'] = m.groupdict()
                    return app(environ, start_response)
                else:
                    allowed += methods
        if allowed:
            allowed = dict.fromkeys(allows).keys()
            allowed.sort()
            resp = exc.HTTPMethodNotAllowed(
                headers={'Allow': ', '.join(allowed)})
        else:
            resp = exc.HTTPNotFound()
        return resp(environ, start_response)
    def __call__(self, environ, start_response):
        # load up the config from the config file. Only needs to be
        # done once per interpreter. This is the entry point of all
        # siesta applications, so this is where we trap it.
        _conf = config.get_config()
        if _conf is None:
            import os.path
            fname = os.path.join(
                environ.get('ll.config_dir', '/local/linden/etc'),
                'indra.xml')
            config.load(fname)

        # proceed with handling the request
        self._create_routes()
        path_info = environ['PATH_INFO']
        request_method = environ['REQUEST_METHOD']
        allowed = []
        for regex, app, methods in self._routes:
            m = regex.match(path_info)
            if m:
                #print "groupdict:",m.groupdict()
                if not methods or request_method in methods:
                    environ['paste.urlvars'] = m.groupdict()
                    return app(environ, start_response)
                else:
                    allowed += methods
        if allowed:
            allowed = dict.fromkeys(allows).keys()
            allowed.sort()
            resp = exc.HTTPMethodNotAllowed(
                headers={'Allow': ', '.join(allowed)})
        else:
            resp = exc.HTTPNotFound()
        return resp(environ, start_response)
def get_channel(version_type):
    if version_type == 'viewer':
        settings_file = open(os.path.join(
            get_src_root(), 'indra', 'newview', 'app_settings', 'settings.xml'))
        data = llsd.parse(settings_file.read())
        settings_file.close()
        return data['VersionChannelName']['Value']
    
    config.load()
    return config.get('channel', 'Second Life Server')
Exemple #4
0
def get_channel(version_type):
    if version_type == 'viewer':
        settings_file = open(
            os.path.join(get_src_root(), 'indra', 'newview', 'app_settings',
                         'settings.xml'))
        data = llsd.parse(settings_file.read())
        settings_file.close()
        return data['VersionChannelName']['Value']

    config.load()
    return config.get('channel', 'Second Life Server')