<s> class BaseProtocol ( object ) : <EOL> PROTOCOL_NAME = '<STR_LIT>' <EOL> def __init__ ( self , app ) : <EOL> self . _app = app <EOL> def on_open ( self ) : <EOL> self . app . on_open ( ) <EOL> def on_message ( self , message ) : <EOL> self . app . on_message ( message ) <EOL> def on_close ( self , reason = None ) : <EOL> self . app . on_close ( reason ) <EOL> @ property <EOL> def app ( self ) : <EOL> if self . _app : <EOL> return self . _app <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> @ property <EOL> def server ( self ) : <EOL> if not hasattr ( self . app , '<STR_LIT>' ) : <EOL> return None <EOL> return self . app . ws . handler . server <EOL> @ property <EOL> def handler ( self ) : <EOL> if not hasattr ( self . app , '<STR_LIT>' ) : <EOL> return None <EOL> return self . app . ws . handler </s>
