<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from sparts . vtask import VTask <EOL> class ThriftHandlerTask ( VTask ) : <EOL> """<STR_LIT>""" <EOL> LOOPLESS = True <EOL> MODULE = None <EOL> SERVICE_NAME = None <EOL> _processor = None <EOL> def initTask ( self ) : <EOL> super ( ThriftHandlerTask , self ) . initTask ( ) <EOL> assert self . MODULE is not None <EOL> self . _verifyInterface ( ) <EOL> def _verifyInterface ( self ) : <EOL> iface = self . MODULE . Iface <EOL> missing_methods = [ ] <EOL> for k in dir ( iface ) : <EOL> v = getattr ( iface , k , None ) <EOL> if not callable ( v ) or k . startswith ( '<STR_LIT:_>' ) : <EOL> continue <EOL> v2 = getattr ( self , k , None ) <EOL> if v2 is None or not callable ( v ) : <EOL> missing_methods . append ( k ) <EOL> if missing_methods : <EOL> raise TypeError ( "<STR_LIT>" % <EOL> ( self . __class__ . __name__ , missing_methods ) ) <EOL> def _makeProcessor ( self ) : <EOL> return self . MODULE . Processor ( self ) <EOL> @ property <EOL> def processor ( self ) : <EOL> if self . _processor is None : <EOL> self . _processor = self . _makeProcessor ( ) <EOL> return self . _processor <EOL> @ property <EOL> def service_name ( self ) : <EOL> if self . SERVICE_NAME is not None : <EOL> return self . SERVICE_NAME <EOL> return self . name </s>
