On Fri, Oct 2, 2009 at 10:12 AM, Mikie <[email protected]> wrote:
>
> Alex, try
> http://pirsqr.com:2713/
> and do the integral calculation. I had to use "request.write" in the
> posthandler and it produces the "Request did not return a string". I
> can't use "return", because the html page is in parts.
The following should solved this problem:
#do this import:
from twisted.web import server
#now in your "render" method, do this:
def render(self, request):
...
d = some_method_that_returns_a_deferred(...)
d.addCallback(self.my_success_callback, request)
return server.NOT_DONE_YET
def my_success_callback(self, request):
request.write(...)
request.finish()
So that should be it.
-Alex
>
>
> On Oct 2, 6:27 am, "Dr. David Kirkby" <[email protected]> wrote:
>> Alex Clemesha wrote:
>> >> root = Resource()
>> >> root.putChild("foo", File("/tmp"))
>> >> root.putChild("bar", File("/lost+found"))
>> >> root.putChild("baz", File("/opt"))
>> >> root.putChild("varr", File("/var"))
>> >> root.putChild("buy", PaymentRequired())
>> >> root.putChild("men", menu())
>> >> factory = Site(root)
>> >> reactor.listenTCP(3333, factory)
>> >> reactor.run()
>> >> ----------------------------------------------
>> >> It will not load the second page.
>>
>> > Do you mean that it will not load the page that
>> > shows the contents of "/lost+found"? Maybe there
>> > is a problem accessing that directory in the filesystem?
>> > Apologies if this is not the question you are asking.
>>
>> > -Alex
>>
>> lost+found would need root access in order to see the contents. It is
>> the place where files go when the file system gets in a mess, and as
>> such can contain other peoples files.
>>
>> dave- Hide quoted text -
>>
>> - Show quoted text -
> >
>
--
Alex Clemesha
clemesha.org
--~--~---------~--~----~------------~-------~--~----~
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/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---