oiV UdZddlmZddlZddlmZddlZddlZddlZddl m Z ddl m Z GddZ Gd d e ZGd d eZGd deZ ddlZeZded<dS#e$reZYdSwxYw)zNDispatcher Please see policy.py for a discussion on dispatchers and policies ) annotationsN)NoReturn)IsCOMServerException)IIDToInterfaceNameczeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZddZdZdS)DispatcherBaseaThe base class for all Dispatchers. This dispatcher supports wrapping all operations in exception handlers, and all the necessary delegation to the policy. This base class supports the printing of "unexpected" exceptions. Note, however, that exactly where the output of print goes may not be useful! A derived class may provide additional semantics for this. c\|||_ttdd|_dS)Nlogger)policygetattrwin32comr )self policyClassobjects JC:\PYTHON\Scheduler\python\Lib\site-packages\win32com/server/dispatcher.py__init__zDispatcherBase.__init__s,!k&)) h$77 c |j||tj||S#|YdSxYwN)r _CreateInstance_ pythoncom WrapObject_HandleException_)rclsidreqIIDs rrzDispatcherBase._CreateInstance_#sV % K ( ( 7 7 7'f55 5 %  " " $ $ $ $ $ $s /2A cp |j|S#|YdSxYwr)r _QueryInterface_r)riids rrzDispatcherBase._QueryInterface_*sA %;//44 4 %  " " $ $ $ $ $ $5cv |j||||S#|YdSxYwr)r _Invoke_rrdispidlcidwFlagsargss rr!zDispatcherBase._Invoke_0sG %;''fdCC C %  " " $ $ $ $ $ $s8cr |j||S#|YdSxYwr)r _GetIDsOfNames_rrnamesr$s rr(zDispatcherBase._GetIDsOfNames_6sC %;..ud;; ; %  " " $ $ $ $ $ $6cr |j||S#|YdSxYwr)r _GetTypeInfo_rrindexr$s rr-zDispatcherBase._GetTypeInfo_<sC %;,,UD99 9 %  " " $ $ $ $ $ $r+cn |jS#|YdSxYwr)r _GetTypeInfoCount_rrs rr1z!DispatcherBase._GetTypeInfoCount_Bs? %;1133 3 %  " " $ $ $ $ $ $4cr |j||S#|YdSxYwr)r _GetDispID_rrnamefdexs rr5zDispatcherBase._GetDispID_HsC %;**466 6 %  " " $ $ $ $ $ $r+cz |j||||||S#|YdSxYwr)r _InvokeEx_rrr#r$r%r&kwargsserviceProviders rr:zDispatcherBase._InvokeEx_NsR %;))fdFO  %  " " $ $ $ $ $ $s!:cr |j||S#|YdSxYwr)r _DeleteMemberByName_rr6s rr?z#DispatcherBase._DeleteMemberByName_VsC %;33D$?? ? %  " " $ $ $ $ $ $r+cp |j|S#|YdSxYwr)r _DeleteMemberByDispID_rrids rrAz%DispatcherBase._DeleteMemberByDispID_\sA %;55b99 9 %  " " $ $ $ $ $ $rcr |j||S#|YdSxYwr)r _GetMemberProperties_rrrCr8s rrEz$DispatcherBase._GetMemberProperties_bsC %;44R>> > %  " " $ $ $ $ $ $r+cp |j|S#|YdSxYwr)r _GetMemberName_rrr#s rrHzDispatcherBase._GetMemberName_hsA %;..v66 6 %  " " $ $ $ $ $ $rcr |j||S#|YdSxYwr)r _GetNextDispID_rrr8flagss rrKzDispatcherBase._GetNextDispID_nsC %;..tU;; ; %  " " $ $ $ $ $ $r+cn |jS#|YdSxYwr)r _GetNameSpaceParent_rr2s rrOz#DispatcherBase._GetNameSpaceParent_ts? %;3355 5 %  " " $ $ $ $ $ $r3returnrcts5|j|jdntj)zfCalled whenever an exception is raised. Default behaviour is to print the exception. Nzpythoncom server error)rr exception traceback print_excr2s rrz DispatcherBase._HandleException_zsF $%% &{& %%&>????#%%% rc|jDdtt|}|j|dS|ddD]}t |dt |ddS)N )end)r joinmapstrdebugprint)rr&recordargs r_trace_zDispatcherBase._trace_s ; "XXc#tnn--F K  f % % % % %CRCy $ $cs##### $r(OOOOOrN)rPr)__name__ __module__ __qualname____doc__rrrr!r(r-r1r5r:r?rArErHrKrOrr`rrrrs"888 %%%%%% %%% %%% %%% %%% %%% %%%%%% %%% %%% %%% %%% %%%    rrc`eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdS)DispatcherTracezGA dispatcher, which causes a 'print' line for each COM function called.ct||}|sA|d|jjt |||S)Nz5in {!r}._QueryInterface_ with unsupported IID {} ({}))rrr`formatr _obj_r)rrrcs rrz DispatcherTrace._QueryInterface_sd  , ,T3 7 7  LLGNNK%'9#'>'>     rcn|d||fzt|||S)Nz&in _GetIDsOfNames_ with '%s' and '%d' )r`rr(r)s rr(zDispatcherTrace._GetIDsOfNames_s6 >%NOOO--dE4@@@rcn|d||fzt|||S)Nz(in _GetTypeInfo_ with index=%d, lcid=%d )r`rr-r.s rr-zDispatcherTrace._GetTypeInfo_s6 @E4=PQQQ++D%>>>rc`|dt|S)Nzin _GetTypeInfoCount_ )r`rr1r2s rr1z"DispatcherTrace._GetTypeInfoCount_s) .///00666rcp|d||||t|||||S)Nzin _Invoke_ with)r`rr!r"s rr!zDispatcherTrace._Invoke_s9 'vtDDD&&tVT64HHHrch|d||t|||S)Nzin _GetDispID_ with)r`rr5r6s rr5zDispatcherTrace._GetDispID_s1 *D$777))$d;;;rc |d|jj|||||t|||||||S)Nz(in {!r}._InvokeEx_-{}{!r} [{:x},{},{!r}])r`rir rjrr:r;s rr:zDispatcherTrace._InvokeEx_sf 6 = = !64     (( &$fo   rch|d||t|||S)Nzin _DeleteMemberByName_ with)r`rr?r6s rr?z$DispatcherTrace._DeleteMemberByName_s1 3T4@@@224tDDDrcd|d|t||S)Nzin _DeleteMemberByDispID_ with)r`rrArBs rrAz&DispatcherTrace._DeleteMemberByDispID_s- 5r:::44T2>>>rch|d||t|||S)Nzin _GetMemberProperties_ with)r`rrErFs rrEz%DispatcherTrace._GetMemberProperties_s1 4b$???33D"dCCCrcd|d|t||S)Nzin _GetMemberName_ with)r`rrHrIs rrHzDispatcherTrace._GetMemberName_s- .777--dF;;;rch|d||t|||S)Nzin _GetNextDispID_ with)r`rrKrLs rrKzDispatcherTrace._GetNextDispID_s1 .e<<<--dD%@@@rc`|dt|S)Nzin _GetNameSpaceParent_)r`rrOr2s rrOz$DispatcherTrace._GetNameSpaceParent_s) .///224888rN)rarbrcrdrr(r-r1r!r5r:r?rArErHrKrOrerrrgrgsQQAAA???777III<<<   EEE???DDD<<<AAA99999rrgceZdZdZdZdS)DispatcherWin32tracezNA tracing dispatcher that sends its output to the win32trace remote collector.ct||||jddl}|d|ddS)Nrz2Object with win32trace dispatcher created (object=))rgrr win32traceutilr`)rrrr|s rrzDispatcherWin32trace.__init__sR  {F;;; ;  ! ! ! ! U&UUUVVVVVrN)rarbrcrdrrerrryrys.XXWWWWWrryceZdZdZdZdS)DispatcherOutputDebugStringzHA tracing dispatcher that sends its output to win32api.OutputDebugStringc|ddD]&}tjt|dz'tjt|ddzdS)NrWrV )win32apiOutputDebugStringr[)rr&r_s rr`z#DispatcherOutputDebugString._trace_s]9 7 7C  &s3xx#~ 6 6 6 6"3tBx==4#788888rN)rarbrcrdr`rerrr~r~s)RR99999rr~ztype[DispatcherTrace]DefaultDebugDispatcher)rd __future__rrStypingrrrr win32com.server.exceptionr win32com.utilrrrgryr~ win32tracer__annotations__ ImportErrorrerrrs #"""""::::::,,,,,,}}}}}}}}@A9A9A9A9A9nA9A9A9HWWWWW?WWW99999/999-4HHHHHHH---,-s$ A11A<;A<