Not sure I follow. When I do the return in the function, I am
enclosing it in three single quotes, which should be the same as three
double quotes? I changed it anyways and had the same result.

On Jun 28, 9:58 am, Greg Milby <[email protected]> wrote:
> Try return in buffer string?  """String here"""
>
> ::Sent from my Verizon HTC Incredible Android::
> On Jun 28, 2011 7:49 AM, "ckdehg" <[email protected]> wrote:
>
>
>
>
>
>
>
> > Like the title says, I'm having issues with web.py.
>
> > I have a script that starts a web.py instance and is serving basic
> > pages. Using the web.py template system, I'm able to get functions
> > like time.time() to refresh every time I reload(meaning, when I
> > refresh, the time printed has increased). However, I have a self
> > written function that performs some math and returns a multiline
> > string. When the function is called either from a script or on the
> > command line, it returns a different value each time, however, when I
> > call it using the web.py templating system, it seems to only run the
> > function once, and then will not re-run it again on additional page
> > reloads (even though time.time() updates each time). The only way to
> > get it to re-run is to restart the script.
>
> > Here's the function in question:
>
> > def casecount():
> > curcount = 80
> > sc = startcount(date)
> > delta = sc - curcount
> > pace = float(delta) / float(ElTime(time, "9:00"))
> > eta = float(curcount) / float(pace)
> > return '''We started with %d cases as of 9AM<br>
> > Remaining cases as of %s: %d<br>
> > We\'re working at a pace of %.3f cases per hour. At this rate,
> > we will finish in approximately %.3f hours<br>''' % (sc, time,
> > curcount, pace, eta)
> > Obviously there are other functions I've written that the script
> > calls, but I know for a fact that it works when run on its own.
>
> > I'm providing function access to the web.py templating system using
> > this code:
>
> > render = web.template.render('templates/', cache=False,
> > globals={'cc': casecount, 'time': time} )
> > and finally, I'm calling the code in the template with this:
>
> > <html>
> > <head>
> > </head>
> > <body>
> > $time()
> > $cc()
> > </body>
> > </html>
> > Any ideas? I've been at it for a while and have searched google to no
> > avail.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> "web.py" 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/webpy?hl=en.
>
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to