On 1/4/07, David Smith <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm writing a webapp that mails a newsletter to registered > users every month. It requires access to the same database that > the webapp uses and so I'd like to have it use the same > pastedeploy config file where the dsn is defined. I'm currently > doing this with a standard configparser but it makes me think > that I'm looking at a pattern that is not implemented in paste > yet; that is, often there are batch applications that are used > with web apps and they should share configuration, > transaction support, and possibly other framework details. > > 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 > > After discussing this with Ian on IRC yesterday, he stressed > two points: > > # pastedeploy's existing configparser is brittle and should > probably not be reused further. > > # paste's existing transaction and synchronization support > would require a large refactoring to support non-WSGI apps > easily. > > This implies it would be better to make this work as wrapping > the command up into a simple WSGI app and running it with an > empty request, then discarding the output. I don't really like > that idea, and so would like to discuss it further here. > > Should the patch, as written or improved but keeping the same > design, be included in paste? Are there serious problems that > require a different design? > -- > David D. Smith
Do something general that meets your needs. Do whatever you want with your configuration and transaction stuff. Then, using your configuration, auto-generate the .ini file for Paste. Alternatively, in the past, I've used cron to call a Web page that did work like you're doing, and it worked fine. My $0.02, -jj -- http://jjinux.blogspot.com/ _______________________________________________ Paste-users mailing list [email protected] http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users
