From: "fumanchu" <fuman...@amor.org>
Date: Wed, 03 Jan 2007 15:02:17 -0800
Local: Wed, Jan 3 2007 6:02 pm
Subject: Mount apps in config
I was letting off steam on IRC today (after Alberto announced he wanted
TG to move away from CherryPy) and boasted "there's nothing in paste.deploy that CP 3 doesn't do more beautifully". Elvelind kindly called me on it, mentioning Paste's ability to mount multiple apps from config. I whipped up a module to provide that feature, and thought some of you might benefit from using it, and some others might benefit from seeing how AMAZINGLY SIMPLE it can be for CP, you, or a larger framework like TG to provide similar features. So here's deploy.py: import sys class Mounter(object): def __init__(self, namespace='tree'): def namespace_handler(self, k, v): def mount_all(self): def mount(path): if __name__ == '__main__': Add the following lines to your global config file: [global] Then, from the command-line, run the following: C:\Python24\Lib\site-packages>python deploy.py myglobal.conf How it works: this adds a handler for the "tree" namespace to the This example only mounts CherryPy WSGI Applications, but it would only Robert Brewer You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||