David Smith wrote:
> I've attached patches to pastescript and pastedeploy to support
> what I had in mind: a pastedeploy abstract factory for commands
> that receive the standard config and then do anything they want
> and a simple entry_point supporting runner command for
> paster. See the test case in pastedeploy and after patching
> paste you can run with a command such as
> 
>  $ paster cmd -n batch basic_app.ini

One way I considered doing this is simply something like:

   paster fetch config.ini /batch

Which would fetch whatever was at /batch -- this seems simpler.  On IRC 
Ben and I talked some about using this general technique to also replace 
setup-app (this was after a bunch of issues in Pylons where context 
wasn't set up in the setup and test cases the same way as in actual 
operation).

Actually I was thinking of taking it a bit further, and imagining all 
applications have a special path, like /_meta/about, which would return 
some file (maybe XML, or rfc822 headers or something) describing all 
these special URLs.  Then you might do:

   paster fetch --show-all config.ini

And it'll display the information from there.  Some dispatchers like 
Paste#urlmap could aggregate the information from all their 
subapplications, giving you a complete site overview.

Using the Accept header, applications could support both 
through-the-browser setup, and command-line setup (from the command line 
you'd just get Accept: text/plain).

Also, there would be a special key in the environment that showed that 
it was run from the command line or some trusted interface.  It would be 
fairly easy then to use some special means to access the real server to 
run this request, if that was desired -- e.g., because you want to run 
the request as the same unix user as the server, or something like that. 
  Doing this would require some kind of signed request or something; 
that would be abstracted at a different level.  The app would just look 
for a special key, it wouldn't concern itself with how it got there.


-- 
Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to