paulb@59 | 1 | #!/usr/bin/env python |
paulb@59 | 2 | |
paulb@59 | 3 | """ |
paulb@59 | 4 | Webware plug-in code. |
paulb@59 | 5 | """ |
paulb@59 | 6 | |
paulb@59 | 7 | __version__ = "0.1" |
paulb@59 | 8 | |
paulb@59 | 9 | from WebStack.Adapters.Webware import WebStackServletFactory |
paulb@59 | 10 | from Auth import AuthResource |
paulb@59 | 11 | |
paulb@59 | 12 | # NOTE: Initialising a shared resource. |
paulb@59 | 13 | |
paulb@59 | 14 | resource = AuthResource() |
paulb@59 | 15 | |
paulb@59 | 16 | def InstallInWebKit(appServer): |
paulb@59 | 17 | global resource |
paulb@59 | 18 | app = appServer.application() |
paulb@59 | 19 | |
paulb@59 | 20 | # NOTE: Allow .auth files only. Really, we'd like any kind of file, but |
paulb@59 | 21 | # NOTE: that would severely undermine the servlet factory concept. |
paulb@59 | 22 | |
paulb@59 | 23 | app.addServletFactory(WebStackServletFactory(app, resource, [".auth"])) |
paulb@59 | 24 | |
paulb@59 | 25 | # vim: tabstop=4 expandtab shiftwidth=4 |