comtypes 1.4.7__zip → 1.4.8__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {comtypes-1.4.7 → comtypes-1.4.8}/CHANGES.txt +18 -0
- {comtypes-1.4.7/comtypes.egg-info → comtypes-1.4.8}/PKG-INFO +5 -3
- {comtypes-1.4.7 → comtypes-1.4.8}/README.md +4 -2
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/__init__.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_comobject.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_memberspec.py +1 -1
- comtypes-1.4.8/comtypes/_meta.py +95 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_npsupport.py +2 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/__init__.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/misc.py +20 -39
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/unknwn.py +94 -69
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/__init__.py +21 -31
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_code_cache.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_events.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_generate.py +5 -5
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/lazybind.py +0 -5
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/git.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/hints.pyi +4 -4
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/persist.py +7 -7
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/safearray.py +2 -6
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/__init__.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/register.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/shelllink.py +48 -43
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestComServer.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestDispServer.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/__init__.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/find_memleak.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_agilent.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_clear_cache.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_createwrappers.py +0 -2
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dispinterface.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_excel.py +0 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_inout_args.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_server.py +6 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_shelllink.py +10 -14
- comtypes-1.4.8/comtypes/test/test_stream.py +131 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_typeannotator.py +1 -1
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_urlhistory.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_variant.py +0 -2
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/namespaces.py +97 -27
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/typeannotator.py +2 -4
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/tlbparser.py +33 -32
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/typedesc.py +2 -2
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/typeinfo.py +21 -25
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/util.py +1 -0
- {comtypes-1.4.7 → comtypes-1.4.8/comtypes.egg-info}/PKG-INFO +5 -3
- comtypes-1.4.8/pyproject.toml +54 -0
- comtypes-1.4.7/comtypes/_meta.py +0 -70
- comtypes-1.4.7/comtypes/test/test_stream.py +0 -53
- comtypes-1.4.7/pyproject.toml +0 -3
- {comtypes-1.4.7 → comtypes-1.4.8}/LICENSE.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/MANIFEST.in +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/GUID.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_idl_stuff.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_post_coinit/bstr.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_py_instance_method.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_safearray.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/_tlib_version_checker.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/automation.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/clear_cache.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/_constants.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/client/dynamic.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/connectionpoints.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/errorinfo.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/hresult.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/logutil.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/messageloop.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/patcher.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/automation.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/connectionpoints.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/inprocserver.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/localserver.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/server/w_getopt.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/stream.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestComServer.idl +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestComServer.tlb +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestDispServer.idl +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/TestDispServer.tlb +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/mylib.idl +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/mylib.tlb +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/mytypelib.idl +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/runtests.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/setup.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_BSTR.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_DISPPARAMS.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_GUID.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_QueryService.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_avmc.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_basic.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_casesensitivity.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_client.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_client_dynamic.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_client_regenerate_modules.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_collections.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_comserver.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dict.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dispifc_records.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dispifc_safearrays.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_dyndispatch.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_findgendir.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_getactiveobj.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_ie.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_ienum.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_imfattributes.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_jscript.js +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_midl_safearray_create.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_monikers.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_msscript.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_npsupport.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_outparam.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_persist.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_propputref.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_pump_events.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_recordinfo.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_safearray.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_sapi.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_showevents.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_storage.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_subinterface.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_typeinfo.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_win32com_interop.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_wmi.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/test_word.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/test/urlhist.tlb +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/__init__.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/__init__.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/codegenerator.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/helpers.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/modulenamer.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/codegenerator/packing.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/tools/typedesc_base.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes/viewobject.py +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/SOURCES.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/dependency_links.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/entry_points.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/comtypes.egg-info/top_level.txt +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/setup.cfg +0 -0
- {comtypes-1.4.7 → comtypes-1.4.8}/setup.py +0 -0
comtypes-1.4.7/comtypes/_meta.py
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# comtypes._meta helper module
|
|
2
|
-
from ctypes import POINTER, c_void_p, cast
|
|
3
|
-
import comtypes
|
|
4
|
-
|
|
5
|
-
################################################################
|
|
6
|
-
# metaclass for CoClass (in comtypes/__init__.py)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def _wrap_coclass(self):
|
|
10
|
-
# We are an IUnknown pointer, represented as a c_void_p instance,
|
|
11
|
-
# but we really want this interface:
|
|
12
|
-
itf = self._com_interfaces_[0]
|
|
13
|
-
punk = cast(self, POINTER(itf))
|
|
14
|
-
result = punk.QueryInterface(itf)
|
|
15
|
-
result.__dict__["__clsid"] = str(self._reg_clsid_)
|
|
16
|
-
return result
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def _coclass_from_param(cls, obj):
|
|
20
|
-
if isinstance(obj, (cls._com_interfaces_[0], cls)):
|
|
21
|
-
return obj
|
|
22
|
-
raise TypeError(obj)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
#
|
|
26
|
-
# The mro() of a POINTER(App) type, where class App is a subclass of CoClass:
|
|
27
|
-
#
|
|
28
|
-
# POINTER(App)
|
|
29
|
-
# App
|
|
30
|
-
# CoClass
|
|
31
|
-
# c_void_p
|
|
32
|
-
# _SimpleCData
|
|
33
|
-
# _CData
|
|
34
|
-
# object
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class _coclass_meta(type):
|
|
38
|
-
# metaclass for CoClass
|
|
39
|
-
#
|
|
40
|
-
# When a CoClass subclass is created, create a POINTER(...) type
|
|
41
|
-
# for that class, with bases <coclass> and c_void_p. Also, the
|
|
42
|
-
# POINTER(...) type gets a __ctypes_from_outparam__ method which
|
|
43
|
-
# will QueryInterface for the default interface: the first one on
|
|
44
|
-
# the coclass' _com_interfaces_ list.
|
|
45
|
-
def __new__(cls, name, bases, namespace):
|
|
46
|
-
klass = type.__new__(cls, name, bases, namespace)
|
|
47
|
-
if bases == (object,):
|
|
48
|
-
return klass
|
|
49
|
-
# XXX We should insist that a _reg_clsid_ is present.
|
|
50
|
-
if "_reg_clsid_" in namespace:
|
|
51
|
-
clsid = namespace["_reg_clsid_"]
|
|
52
|
-
comtypes.com_coclass_registry[str(clsid)] = klass
|
|
53
|
-
PTR = _coclass_pointer_meta(
|
|
54
|
-
"POINTER(%s)" % klass.__name__,
|
|
55
|
-
(klass, c_void_p),
|
|
56
|
-
{
|
|
57
|
-
"__ctypes_from_outparam__": _wrap_coclass,
|
|
58
|
-
"from_param": classmethod(_coclass_from_param),
|
|
59
|
-
},
|
|
60
|
-
)
|
|
61
|
-
from ctypes import _pointer_type_cache
|
|
62
|
-
|
|
63
|
-
_pointer_type_cache[klass] = PTR
|
|
64
|
-
|
|
65
|
-
return klass
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
# will not work if we change the order of the two base classes!
|
|
69
|
-
class _coclass_pointer_meta(type(c_void_p), _coclass_meta):
|
|
70
|
-
pass
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import unittest as ut
|
|
2
|
-
|
|
3
|
-
from ctypes import POINTER, byref, c_bool, c_ubyte
|
|
4
|
-
import comtypes
|
|
5
|
-
import comtypes.client
|
|
6
|
-
|
|
7
|
-
comtypes.client.GetModule("portabledeviceapi.dll")
|
|
8
|
-
from comtypes.gen.PortableDeviceApiLib import IStream
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def _create_stream() -> IStream:
|
|
12
|
-
# Create an IStream
|
|
13
|
-
stream = POINTER(IStream)() # type: ignore
|
|
14
|
-
comtypes._ole32.CreateStreamOnHGlobal(None, c_bool(True), byref(stream))
|
|
15
|
-
return stream # type: ignore
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class Test_RemoteWrite(ut.TestCase):
|
|
19
|
-
def test_RemoteWrite(self):
|
|
20
|
-
stream = _create_stream()
|
|
21
|
-
test_data = "Some data".encode("utf-8")
|
|
22
|
-
pv = (c_ubyte * len(test_data)).from_buffer(bytearray(test_data))
|
|
23
|
-
|
|
24
|
-
written = stream.RemoteWrite(pv, len(test_data))
|
|
25
|
-
|
|
26
|
-
# Verification
|
|
27
|
-
self.assertEqual(written, len(test_data))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class Test_RemoteRead(ut.TestCase):
|
|
31
|
-
def test_RemoteRead(self):
|
|
32
|
-
stream = _create_stream()
|
|
33
|
-
test_data = "Some data".encode("utf-8")
|
|
34
|
-
pv = (c_ubyte * len(test_data)).from_buffer(bytearray(test_data))
|
|
35
|
-
stream.RemoteWrite(pv, len(test_data))
|
|
36
|
-
|
|
37
|
-
# Make sure the data actually gets written before trying to read back
|
|
38
|
-
stream.Commit(0)
|
|
39
|
-
# Move the stream back to the beginning
|
|
40
|
-
STREAM_SEEK_SET = 0
|
|
41
|
-
stream.RemoteSeek(0, STREAM_SEEK_SET)
|
|
42
|
-
|
|
43
|
-
buffer_size = 1024
|
|
44
|
-
|
|
45
|
-
read_buffer, data_read = stream.RemoteRead(buffer_size)
|
|
46
|
-
|
|
47
|
-
# Verification
|
|
48
|
-
self.assertEqual(data_read, len(test_data))
|
|
49
|
-
self.assertEqual(bytearray(read_buffer)[0:data_read], test_data)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if __name__ == "__main__":
|
|
53
|
-
ut.main()
|
comtypes-1.4.7/pyproject.toml
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|