Ian Bicking <[EMAIL PROTECTED]> writes:

> 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).

This is a good idea but I don't think it satisfies the same
need well. The more I think about it, it leaves the usage and
construction of bundled scripts even stranger. That is, paste
would expcect whatever runs at that URL to be conformant to
WSGI, but

 # writing a batch script as a WSGI callable is backwards. It
   should be a standard python script (possibly with a factory
   function) that only imports things from paste, not use
   tricks to make it look like a regular, non-WSGI callable.

 # mounting the command in the webapp's URL tree is needlessly
   complex. The author (or some wrapper) would have to check
   the value of the environ variable you suggest to determine
   if it was a web request or a console request.

To be clear, I think having a command in paster to send a
request to a webapp from the command line would be useful
since you have to build up a lot more to be able to do it in a
browser and a browser can't even send PUT and DELETE requests,
but I would still prefer to have a simple way to write a
regular script that shares configuration with a webapp.

I'm going to take the rest of what you wrote and break it into
a separate thread.

Please think about the above and my original patch.

Thanks,
-- 
  David D. Smith

Attachment: pgpwsrNYGlQuc.pgp
Description: PGP signature

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

Reply via email to