def GET(self, request): """ Get setting data from the :mod:`config`. Parameters are expected to be part of the query string. If the base of this address handler is called: :returns: A list of sections in the :mod:`config` :rtype: ``list`` If anything more than the base of this handler is called then the excess is assumed to be a section name and: :returns: A JSON representation of that particular section of the :mod:`config`. :rtype: ``json`` :raises: :exc:`restlite.Status` 404 if the section does not exist. """ authentication.login(request) section = getSection(request['PATH_INFO']) if section: settings = config.getSettings(section, False) if settings is None: raise restlite.Status, "404 Not Found" else: return request.response(settings) else: return request.response(config.getSections())
def getModules(): typeName = 'modules' modules = [] for moduleName in config.getSections(typeName, typeName): modules.append(getModule(moduleName)) return modules
def GET(request): authentication.login(request) section = getSection(request['PATH_INFO']) if section: settings = config.getSettings(section, False) if settings is None: raise restlite.Status, "404 Not Found" else: return request.response(settings) else: return request.response(config.getSections())