The easy answer is "it works in awake, just put it there." Setting up the connection for every page request slows down response time. I'd like to be able to keep the response snappy as much as possible.
What is your experience with init vs awake? Why won't setting the xmlrpc server proxy in init work?
Example code:
class SitePage(Page): # Page is WebKit.Page
def __init__(self):
Page.__init__(self)
self.__debug = MyConfigFile.debug
#self.setLogicServer(MyConfigFile.logic_location) # does not work here (Webware hangs)
# other code clipped
def awake(self,trans): Page.awake(self,trans) self.setLogicServer(MyConfigFile.logic_location) # works here # other permissions code clipped
def setLogicServer(self,location):
initial_auth_key = 'xyz123'
self.__logicServer = xmlrpclib.ServerProxy(location,transport=MyTransport(initial_auth_key))
try:
self.__logicServer.init_connection('foo','bar','baz') except BadLoginError, msg:
raise # do something smart
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Webware-discuss mailing list Webware-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/webware-discuss