示例#1
0
文件: settings.py 项目: jelford/reef
    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())
示例#2
0
文件: loader.py 项目: lapig-ufg/sitt
def getModules():

	typeName = 'modules'
	modules = []

	for moduleName in config.getSections(typeName, typeName):
		modules.append(getModule(moduleName))

	return modules
示例#3
0
def getModules():

    typeName = 'modules'
    modules = []

    for moduleName in config.getSections(typeName, typeName):
        modules.append(getModule(moduleName))

    return modules
示例#4
0
文件: settings.py 项目: OhBaby/reef
 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())