[Twisted-Python] how can I invoke an httpFactory method in http.request?
1 Oct
2006
1 Oct
'06
10:01 a.m.
hi, is that a way to invoke a function in httpFactory from a http.request? code here: from twisted.web import http class anotherRequestHandler(http.Request): def process(self): ''' how to invoke a method in anotherHttpFactory such as judge? ''' class anotherHttp(http.HTTPChannel): requestFactory = anotherRequestHandler class resolve: def show(self): return 'ok' class anotherHttpFactory(http.HTTPFactory): def __init__(self): a = resolve() def judge(self): return a.show() I don't want class 'resolve' to be initialized every time when a request comes, or am I mis-understand it ? Thanks for help.
6563
Age (days ago)
6563
Last active (days ago)
0 comments
1 participants
participants (1)
-
wang wei