Re: url_for for static resources

2008-06-21 Thread Shannon -jj Behrens
On Sat, Jun 21, 2008 at 7:53 AM, Jonathan Vanasco <[EMAIL PROTECTED]> wrote: > i had a similar situation -- i wanted to change url_for's output on > people who have a 'preview' cookie and those who don't > > i basically did this > > def url_for_custom( url ): >rval = url_for(url) >if logic

Re: Background Threads

2008-06-21 Thread EricHolmberg
Excellent suggestions, guys! I'm impressed. I originally just had a simple issue to running the background task to complement the Pylons application, but looking over everybody's suggestions, I can see that I can refactor a lot of other systems that I deal with to make them easier to maintain an

Re: url_for for static resources

2008-06-21 Thread Jonathan Vanasco
i had a similar situation -- i wanted to change url_for's output on people who have a 'preview' cookie and those who don't i basically did this def url_for_custom( url ): rval = url_for(url) if logic_test(): rval = regex or stringsub or both return rval then quickly did a fi

Re: Background Threads

2008-06-21 Thread Jonathan Vanasco
i've done two things to handle this in the past: 1- CRON I used to just write a simple script to handle it all, then have cron run at 1,5,10,15,30,60 minute intervals or whatever.. and use some PID files to make sure I don't have an overlap in execution 2- Twisted Now I often just run a twisted

Re: Background Threads

2008-06-21 Thread Graham Dumpleton
On Jun 21, 12:50 am, EricHolmberg <[EMAIL PROTECTED]> wrote: > I would like to have a background thread handle tasks such as sending > notification emails and doing background integrity checks on the > database. What is the best way to handle this? Possible solutions > include: > > 1. Start a t