Hi,

In the example below, I want to use a member of the class to process the
HTML render request. How can I arrange my code to allow access to class
members?

# -----------------------------------------------------------
from nevow import loaders
from nevow import rend
from nevow import tags as T

import monitorBroker

class HttpServer(rend.Page):
   def __init__(self):
        def ServerInfo(self, ctx, data):
             self.broker.GetServerData()  # self refers to
WovenContext, not HttpServer, not happy!

        self.addSlash = True
        self.docFactory = loaders.stan( T.html [ T.head ( title =
"TestMonitor" ),
                                              T.body [ T.h1[ "Test
Monitor 0.1" ],
                                                       T.div[ "HUB
Server: ", ServerInfo]
                                                     ]
                                              ]
                                   )

        self.broker = monitorBroker.PBroker('127.0.0.1', 7021)

#-----------------

Thanks

Simon






_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to