a „oe1ã@s¢dZddlZddlZddlmZddlmZddlmZm Z m Z m Z ddl m Z mZmZmZdd „ZGd d „d e jƒZGd d „d e je je jƒZGdd„dƒZdS)z* Management of documents for AXDebugging. éN)Ú Exception)Úunwrapé)ÚaxdebugÚ codecontainerÚcontextsÚgateways)Ú RaiseNotImplÚ_wrapÚ _wrap_removeÚtracecCs|ddkrt |¡S|S)Nrú<)Úwin32apiZGetFullPathName)Úfname©rú>C:\Program Files\Certbot\pkgs\win32comext\axdebug\documents.pyÚGetGoodFileNames  rc@s,eZdZdd„Zdd„Zdd„Zdd„Zd S) ÚDebugDocumentProvidercCs ||_dS©N©Údoc)ÚselfrrrrÚ__init__szDebugDocumentProvider.__init__cCs |j |¡Sr)rÚGetName©rZdntrrrrszDebugDocumentProvider.GetNamecCs |j ¡Sr)rÚGetDocumentClassId©rrrrrsz(DebugDocumentProvider.GetDocumentClassIdcCs|jSrrrrrrÚ GetDocument!sz!DebugDocumentProvider.GetDocumentN)Ú__name__Ú __module__Ú __qualname__rrrrrrrrrsrc@sŒeZdZejjejjejjZejjejjejjZdd„Z dd„Z dd„Z dd„Z d d „Z d d „Zd d„Zdd„Zdd„Zdd„ZdS)ÚDebugDocumentTextcCs.tj |¡tj |¡tj |¡||_dSr)rr!rÚDebugDocumentInfoÚ DebugDocumentÚ codeContainer)rr$rrrr5s   zDebugDocumentText.__init__cCsd|_d|_dSr)Z docContextsr$rrrrÚ_Close;szDebugDocumentText._ClosecCs |j |¡Sr)r$rrrrrrAszDebugDocumentText.GetNamecCsdS)Nz&{DF630910-1C1D-11d0-AE36-8C0F5E000000}rrrrrrDsz$DebugDocumentText.GetDocumentClassIdcCs|j ¡|j ¡fSr)r$Z GetNumLinesZ GetNumCharsrrrrÚGetSizeLszDebugDocumentText.GetSizecCs |j |¡Sr)r$ÚGetPositionOfLine)rZ cLineNumberrrrr'Psz#DebugDocumentText.GetPositionOfLinecCs |j |¡Sr)r$ÚGetLineOfPosition)rÚcharPosrrrr(Ssz#DebugDocumentText.GetLineOfPositioncCs|j}| ¡}| ¡|fSr)r$ZGetSyntaxColorAttributesÚGetText)rr)ÚmaxCharsZwantAttrZcontÚattrrrrr*VszDebugDocumentText.GetTextcCstd|ƒt|ƒ}|j|jfS)NÚGetPositionOfContext)r rÚoffsetÚlength)rÚcontextrrrr-^s z&DebugDocumentText.GetPositionOfContextcCs$t|tjƒ}|j |¡}| tj¡Sr)r rZIID_IDebugDocumentr$ZGetCodeContextAtPositionZQueryInterfaceZIID_IDebugDocumentContext)rr)r+rÚrcrrrÚGetContextOfPositionds  z&DebugDocumentText.GetContextOfPositionN)rrr rr"Z_com_interfaces_r!r#Z_public_methods_rr%rrr&r'r(r*r-r2rrrrr!%s,ÿþÿÿþÿr!c@s2eZdZdZdd„Zd dd„Zdd„Zd d „ZdS) ÚCodeContainerProvidera(An abstract Python class which provides code containers! Given a Python file name (as the debugger knows it by) this will return a CodeContainer interface suitable for use. This provides a simple base imlpementation that simply supports a dictionary of nodes and providers. cCs i|_dSr)Ú ccsAndNodesrrrrruszCodeContainerProvider.__init__NcCst|jƒ}||f|j|<dSr)rZfileNamer4)rÚccÚnoderrrrÚAddCodeContainerxs z&CodeContainerProvider.AddCodeContainercCs|j t|ƒd¡\}}|S)N)NN)r4Úgetr)rrr5r6rrrÚ FromFileName|sz"CodeContainerProvider.FromFileNamec CsP|j ¡D]:\}}z|dur$| ¡| ¡Wq tjyBYq 0q i|_dSr)r4ÚvaluesÚCloser%Ú pythoncomZ com_error)rr5r6rrrr;‚s zCodeContainerProvider.Close)N)rrr Ú__doc__rr7r9r;rrrrr3ks   r3)r=r<rZwin32com.server.exceptionrZwin32com.server.utilrÚrrrrÚutilr r r r rrr"r!r#r3rrrrÚs    ÿF