<s> """<STR_LIT>""" <EOL> from twisted . python . reflect import qual <EOL> from twisted . python . deprecate import getWarningMethod <EOL> from twisted . python . failure import Failure <EOL> from twisted . python . log import err <EOL> _missingProcessExited = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> class BaseProcess ( object ) : <EOL> pid = None <EOL> status = None <EOL> lostProcess = <NUM_LIT:0> <EOL> proto = None <EOL> def __init__ ( self , protocol ) : <EOL> self . proto = protocol <EOL> def _callProcessExited ( self , reason ) : <EOL> default = object ( ) <EOL> processExited = getattr ( self . proto , '<STR_LIT>' , default ) <EOL> if processExited is default : <EOL> getWarningMethod ( ) ( <EOL> _missingProcessExited % ( qual ( self . proto . __class__ ) , ) , <EOL> DeprecationWarning , stacklevel = <NUM_LIT:0> ) <EOL> else : <EOL> try : <EOL> processExited ( Failure ( reason ) ) <EOL> except : <EOL> err ( None , "<STR_LIT>" ) <EOL> def processEnded ( self , status ) : <EOL> """<STR_LIT>""" <EOL> self . status = status <EOL> self . lostProcess += <NUM_LIT:1> <EOL> self . pid = None <EOL> self . _callProcessExited ( self . _getReason ( status ) ) <EOL> self . maybeCallProcessEnded ( ) <EOL> def maybeCallProcessEnded ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . proto is not None : <EOL> reason = self . _getReason ( self . status ) <EOL> proto = self . proto <EOL> self . proto = None <EOL> try : <EOL> proto . processEnded ( Failure ( reason ) ) <EOL> except : <EOL> err ( None , "<STR_LIT>" ) </s>
