a „oeã@s&dZddlZddlZGdd„dƒZdS)z&Utilities for working with ConnectionséNc@s<eZdZdZddd„Zdd„Zdd „Zdd d „Zd d „ZdS)ÚSimpleConnectionz"A simple, single connection objectNrcCs,d|_d|_||_|dur(| |||¡dS©N)ÚcpÚcookieÚdebugÚConnect)ÚselfÚ coInstanceÚ eventInstanceÚ eventCLSIDr©r ú8C:\Program Files\Certbot\pkgs\win32com\client\connect.pyÚ__init__ s zSimpleConnection.__init__cCs&z | ¡Wntjy Yn0dSr)Ú DisconnectÚ pythoncomÚerror©rr r r Ú__del__s zSimpleConnection.__del__cCs.d}|jrddlm}|j}tjjj||d�S)Nr)Ú dispatcher)Ú useDispatcher)rZwin32com.serverrZDefaultDebugDispatcherÚwin32comZserverÚutilÚwrap)rÚobjrrr r r Ú_wraps  zSimpleConnection._wrapcCsdz |j}Wnty |}Yn0| tj¡}|dur<|j}| |¡}| |¡|_|j  |¡|_ dSr) Z_oleobj_ÚAttributeErrorZQueryInterfacerZIID_IConnectionPointContainerZCLSIDrZFindConnectionPointrZAdviser)rr r r ZoleobjZcpcZcomEventInstancer r r rs      zSimpleConnection.ConnectcCs.|jdur*|jr$|j |j¡d|_d|_dSr)rrZUnadviserr r r r+s  zSimpleConnection.Disconnect)NNNr)N) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrr r r r rs   r)rrZwin32com.server.utilrrr r r r Ús