1 #!/usr/bin/env python 2 3 """ 4 Webware plug-in code. 5 """ 6 7 __version__ = "1.3" 8 9 from WebStack.Adapters.Webware import WebStackServletFactory 10 from SimpleWithLogin import get_site_map 11 12 # Change this to be the exact URL. 13 # eg. http://localhost:8000/myapp/login 14 15 login_url = "http://localhost/webkit/app.login" 16 17 # Change this to be the URL base for your server. 18 # eg. http://localhost:8000 19 20 app_url = "http://localhost" # No trailing "/"! 21 22 # Must match the key used elsewhere. 23 24 secret_key = "horses" 25 26 resource = get_site_map(app_url, login_url, secret_key) 27 28 # NOTE: Initialising a shared resource. 29 30 def InstallInWebKit(appServer): 31 global resource 32 app = appServer.application() 33 34 # NOTE: Allow .simplewithlogin files only. Really, we'd like any kind of 35 # NOTE: file, but that would severely undermine the servlet factory concept. 36 37 app.addServletFactory(WebStackServletFactory(app, resource, [".simplewithlogin"])) 38 39 # vim: tabstop=4 expandtab shiftwidth=4