PyXR

c:\python24\lib\site-packages\win32 \ com \ servers \ test_pycomtest.py



0001 # This is part of the Python test suite.
0002 # The object is registered when you first run the test suite.
0003 # (and hopefully unregistered once done ;-)
0004 
0005 # Ensure the vtables in the tlb are known.
0006 from win32com import universal
0007 from win32com.server.exception import COMException
0008 from win32com.client import gencache
0009 import winerror
0010 from win32com.client import constants
0011 from win32com.server.util import wrap
0012 
0013 # We use the constants from the module, so must insist on a gencache.
0014 # Otherwise, use of gencache is not necessary (tho still advised)
0015 gencache.EnsureModule('{6BCDCB60-5605-11D0-AE5F-CADD4C000000}', 0, 1, 1)
0016 
0017 class PyCOMTest:
0018         _typelib_guid_ = "{6BCDCB60-5605-11D0-AE5F-CADD4C000000}"
0019         _typelib_version = 1,0
0020         _com_interfaces_ = ['IPyCOMTest']
0021         _reg_clsid_ = "{e743d9cd-cb03-4b04-b516-11d3a81c1597}"
0022         _reg_progid_ = "Python.Test.PyCOMTest"
0023 
0024         def DoubleString(self, str):
0025                 return str*2
0026         def DoubleInOutString(self, str):
0027                 return str*2
0028 
0029         def Fire(self, nID):
0030                 raise COMException(hresult=winerror.E_NOTIMPL)
0031 
0032         def GetLastVarArgs(self):
0033                 raise COMException(hresult=winerror.E_NOTIMPL)
0034 
0035         def GetMultipleInterfaces(self, outinterface1, outinterface2):
0036                 raise COMException(hresult=winerror.E_NOTIMPL)
0037 
0038         def GetSafeArrays(self, attrs, attrs2, ints):
0039                 raise COMException(hresult=winerror.E_NOTIMPL)
0040 
0041         def GetSetDispatch(self, indisp):
0042                 raise COMException(hresult=winerror.E_NOTIMPL)
0043 
0044         # Result is of type IPyCOMTest
0045         def GetSetInterface(self, ininterface):
0046                 return wrap(self)
0047 
0048         # Result is of type IPyCOMTest
0049         def GetSetInterfaceArray(self, ininterface):
0050                 raise COMException(hresult=winerror.E_NOTIMPL)
0051 
0052         def GetSetUnknown(self, inunk):
0053                 raise COMException(hresult=winerror.E_NOTIMPL)
0054 
0055         # Result is of type ISimpleCounter
0056         def GetSimpleCounter(self):
0057                 raise COMException(hresult=winerror.E_NOTIMPL)
0058 
0059         def GetSimpleSafeArray(self, ints):
0060                 raise COMException(hresult=winerror.E_NOTIMPL)
0061 
0062         def GetStruct(self):
0063                 raise COMException(hresult=winerror.E_NOTIMPL)
0064 
0065         def SetIntSafeArray(self, ints):
0066                 return len(ints)
0067 
0068         def SetVarArgs(self, *args):
0069                 raise COMException(hresult=winerror.E_NOTIMPL)
0070 
0071         def SetVariantSafeArray(self, vars):
0072                 raise COMException(hresult=winerror.E_NOTIMPL)
0073 
0074         def Start(self):
0075                 raise COMException(hresult=winerror.E_NOTIMPL)
0076 
0077         def Stop(self, nID):
0078                 raise COMException(hresult=winerror.E_NOTIMPL)
0079 
0080         def StopAll(self):
0081                 raise COMException(hresult=winerror.E_NOTIMPL)
0082 
0083         def TakeByRefDispatch(self, inout):
0084                 raise COMException(hresult=winerror.E_NOTIMPL)
0085 
0086         def TakeByRefTypedDispatch(self, inout):
0087                 raise COMException(hresult=winerror.E_NOTIMPL)
0088 
0089         def Test(self, key, inval):
0090                 return not inval
0091 
0092         def Test2(self, inval):
0093                 return inval
0094 
0095         def Test3(self, inval):
0096                 raise COMException(hresult=winerror.E_NOTIMPL)
0097 
0098         def Test4(self, inval):
0099                 raise COMException(hresult=winerror.E_NOTIMPL)
0100 
0101         def Test5(self, inout):
0102                 if inout == constants.TestAttr1:
0103                         return constants.TestAttr1_1
0104                 elif inout == constants.TestAttr1_1:
0105                         return constants.TestAttr1
0106                 else:
0107                         return -1
0108 
0109         def TestOptionals(self, strArg='def', sval=0, lval=1, dval=3.1400001049041748):
0110                 raise COMException(hresult=winerror.E_NOTIMPL)
0111 
0112         def TestOptionals2(self, dval, strval='', sval=1):
0113                 raise COMException(hresult=winerror.E_NOTIMPL)
0114 
0115         def CheckVariantSafeArray(self, data):
0116                 return 1
0117 
0118         def LongProp(self):
0119                 return self.intval
0120         def SetLongProp(self, val):
0121                 self.intval = val
0122         def IntProp(self):
0123                 return self.intval
0124         def SetIntProp(self, val):
0125                 self.intval = val
0126 
0127 if __name__ == '__main__':
0128         import win32com.server.register
0129         win32com.server.register.UseCommandLine(PyCOMTest)
0130 

Generated by PyXR 0.9.4
SourceForge.net Logo