what about in addition to allowing someone to pass in the template, how
about allowing them to pass in the location to the template.  Then all
you would have to do is give us a paste command to make waitforit spit
out the default template which someone could then modify to suit their
needs.  To use the reference to a template in addition to a real
template you have to edit middleware.py
at line 12 add:
import os


at line 31add:
elif os.path.exists(template):
            template = file(template).read()
so the entire is statement is now:
if template is None:
            template = TEMPLATE
        elif os.path.exists(template):
            template = file(template).read()
Then change wsgiapp.py so that it reads

def make_filter(
    app,
    global_conf,
    time_limit='10',
    poll_time='10',
    template=None):
    time_limit = float(time_limit)
    poll_time = float(poll_time)
    return WaitForIt(app, time_limit=time_limit,
                     poll_time=poll_time, template=template)

so that a template can be passed in at the ini file

Then the appropriate ini filter entry could be something like:
[filter:speed]
use = egg:waitforit
template = %(here)s/waitforit_templates/temp.html
time_limit = 2
poll_time = 1

That could solve thing pretty easily, although I don't know how you
would make paste spit out the default template file so that we could edit it
Jose


Ian Bicking wrote:
> [EMAIL PROTECTED] wrote:
>> Dear Ian,
>> I've been thinking waitforit, and again conceptually it is really cool
>> and solves the issue of how to display something for a user to see when
>> a long running app is started.  However, I've got a suggestion.
>> The page that is generated is pretty simple, I would like to be able to
>> make a page that fits into the general these for my application. To do
>> that we should be able to define custom css as well as add some custom
>> page design or feed it a page fragment which would include the basic
>> wait message. 
>
> You can actually pass in a "template" argument to WaitForIt, which
> replaces the default template.  That might be a bit heavy in terms of
> customization; you'd have to copy over a bunch of stuff from the
> existing template.
>
> It would probably be useful to offer some simple options you could
> pass to the default template.  For instance, a stylesheet and the
> default language, as you suggest.  To do that, it would just be
> necessary to add some options to the constructor, and then some use
> those options in the template.
>

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

Reply via email to