<s> import sys , os <EOL> import logging <EOL> logging . basicConfig ( ) <EOL> sys . path . append ( os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , r"<STR_LIT>" ) ) ) <EOL> import comtypes <EOL> from comtypes . hresult import S_OK <EOL> import comtypes . server . connectionpoints <EOL> if not hasattr ( sys , "<STR_LIT>" ) : <EOL> import comtypes . client <EOL> tlbfile = os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT>" ) <EOL> comtypes . client . GetModule ( tlbfile ) <EOL> from comtypes . gen import TestDispServerLib <EOL> class TestDispServer ( <EOL> TestDispServerLib . TestDispServer , <EOL> comtypes . server . connectionpoints . ConnectableObjectMixin , <EOL> ) : <EOL> _com_interfaces_ = TestDispServerLib . TestDispServer . _com_interfaces_ + [ comtypes . connectionpoints . IConnectionPointContainer ] <EOL> _reg_threading_ = "<STR_LIT>" <EOL> _reg_progid_ = "<STR_LIT>" <EOL> _reg_novers_progid_ = "<STR_LIT>" <EOL> _reg_desc_ = "<STR_LIT>" <EOL> _reg_clsctx_ = comtypes . CLSCTX_INPROC_SERVER | comtypes . CLSCTX_LOCAL_SERVER <EOL> def DTestDispServer_eval ( self , this , expr , presult ) : <EOL> self . Fire_Event ( <NUM_LIT:0> , "<STR_LIT>" , expr ) <EOL> presult [ <NUM_LIT:0> ] = eval ( expr ) <EOL> self . Fire_Event ( <NUM_LIT:0> , "<STR_LIT>" , expr , presult [ <NUM_LIT:0> ] . value ) <EOL> return S_OK <EOL> def DTestDispServer_eval2 ( self , expr ) : <EOL> self . Fire_Event ( <NUM_LIT:0> , "<STR_LIT>" , expr ) <EOL> result = eval ( expr ) <EOL> self . Fire_Event ( <NUM_LIT:0> , "<STR_LIT>" , expr , result ) <EOL> return result <EOL> def DTestDispServer__get_id ( self , this , pid ) : <EOL> pid [ <NUM_LIT:0> ] = id ( self ) <EOL> return S_OK <EOL> def DTestDispServer_Exec ( self , this , what ) : <EOL> exec ( what ) <EOL> return S_OK <EOL> def DTestDispServer_Exec2 ( self , what ) : <EOL> exec ( what ) <EOL> _name = u"<STR_LIT>" <EOL> def DTestDispServer__get_name ( self , this , pname ) : <EOL> pname [ <NUM_LIT:0> ] = self . _name <EOL> return S_OK <EOL> def DTestDispServer__set_name ( self , this , name ) : <EOL> self . _name = name <EOL> return S_OK <EOL> def DTestDispServer_sEtNaMe ( self , name ) : <EOL> self . _name = name <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> from comtypes . server . register import UseCommandLine <EOL> UseCommandLine ( TestDispServer ) </s>
