web.pluginmanager.pluginview

Package web :: Package pluginmanager :: Module pluginview |
[hide private]
[frames] | no frames]

# Source Code for Module web.pluginmanager.pluginview

     1  import web
     2
     3 -class PluginView:
     4 -    def GET(self, args):
     5          return self.request(args, "GET")
     6
     7 -    def POST(self, args):
     8          return self.request(args, "POST")
     9
    10 -    def request(self, args, method):
    11          argslist = args.partition('/')
    12          plugin_name = argslist[0]
    13          plugin = web.ctx.plugin_manager.get_plugin_by_name(plugin_name)
    14          if not plugin:
    15              print "plugin %s not found" % plugin_name
    16              raise web.notfound()
    17
    18          if not plugin.is_enabled():
    19              print "plugin %s not enabled" % plugin_name
    20              raise web.notfound()
    21
    22          return plugin._request(argslist[2], method)
    23