Ian Bicking wrote:
> This has kind of been hanging for a long time.  I think I'm going to add 
> a command:
> 
>    paster request config.ini /

I added the commands "paster request" and "paster post" to PasteScript 
trunk.  If you do "easy_install PasteScript==dev" you should have them 
available.

Since it does requests, your commands will be run in the full 
configuration context of a normal application.  Useful for cron jobs, 
the error handler will also be in place and you can get email reports of 
failed requests.

Because arguments all just go in QUERY_STRING, request.GET and 
request.PARAMS won't look like you expect.  But you can parse them with 
something like:

   parser = optparse.OptionParser()
   parser.add_option(etc)

   args = [item[0] for item in
           cgi.parse_qsl(request.environ['QUERY_STRING'])]
   options, args = parser.parse_args(args)

Also environ['paste.command_request'] will be true, so you can block 
public access.

A Pylons controller that handled some of this would probably be quite 
useful.  Probably even nicer with additions to the current template, so 
that /.command/ all gets routed to a single controller that uses actions 
for the various sub-commands, and can provide a useful response to 
/.command/?-h, etc.


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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to