web.options.options

Package web :: Package options :: Module options |
[hide private]
[frames] | no frames]

# Source Code for Module web.options.options

     1  import web
     2  from decorators import i18n
     3
     4
     5 -class Options:
     6      '''
     7      This class is a view where the plugins' options are showed to the user.
     8      Each plugins has a form that can be filled by the user. When a form is
     9      submitted the corresponding plugin is notified by save_options function.
    10      '''
    11 -    def GET(self):
    12          return web.ctx.render.options.options(web.ctx.plugin_manager.plugins)
    13
    14      @i18n
    15 -    def POST(self):
    16          plugin = web.ctx.plugin_manager.get_plugin_by_name(
    17                  web.input().plugin_form)
    18          plugin.save_options(web.input())
    19
    20          web.ctx.notify(_('Successful'), 'notification')
    21
    22          return self.GET()
    23