comtypes 1.4.2__zip → 1.4.4__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.
Files changed (121) hide show
  1. {comtypes-1.4.2 → comtypes-1.4.4}/CHANGES.txt +22 -2
  2. {comtypes-1.4.2/comtypes.egg-info → comtypes-1.4.4}/PKG-INFO +30 -3
  3. {comtypes-1.4.2 → comtypes-1.4.4}/README.md +28 -1
  4. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/__init__.py +6 -8
  5. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/automation.py +26 -2
  6. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/hints.pyi +15 -0
  7. comtypes-1.4.4/comtypes/test/mylib.tlb +0 -0
  8. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_GUID.py +23 -2
  9. comtypes-1.4.4/comtypes/test/test_dispifc_records.py +90 -0
  10. comtypes-1.4.4/comtypes/test/test_findgendir.py +87 -0
  11. comtypes-1.4.4/comtypes/test/urlhist.tlb +0 -0
  12. comtypes-1.4.4/comtypes/tools/codegenerator/__init__.py +5 -0
  13. {comtypes-1.4.2/comtypes/tools → comtypes-1.4.4/comtypes/tools/codegenerator}/codegenerator.py +56 -721
  14. comtypes-1.4.4/comtypes/tools/codegenerator/helpers.py +357 -0
  15. comtypes-1.4.4/comtypes/tools/codegenerator/modulenamer.py +24 -0
  16. comtypes-1.4.4/comtypes/tools/codegenerator/namespaces.py +212 -0
  17. comtypes-1.4.4/comtypes/tools/codegenerator/packing.py +81 -0
  18. {comtypes-1.4.2/comtypes/tools → comtypes-1.4.4/comtypes/tools/codegenerator}/typeannotator.py +18 -3
  19. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/tools/tlbparser.py +19 -49
  20. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/tools/typedesc.py +57 -9
  21. {comtypes-1.4.2 → comtypes-1.4.4/comtypes.egg-info}/PKG-INFO +30 -3
  22. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes.egg-info/SOURCES.txt +13 -3
  23. comtypes-1.4.4/pyproject.toml +3 -0
  24. comtypes-1.4.4/setup.cfg +51 -0
  25. comtypes-1.4.4/setup.py +117 -0
  26. comtypes-1.4.2/comtypes/test/test_findgendir.py +0 -94
  27. comtypes-1.4.2/setup.cfg +0 -4
  28. comtypes-1.4.2/setup.py +0 -172
  29. {comtypes-1.4.2 → comtypes-1.4.4}/LICENSE.txt +0 -0
  30. {comtypes-1.4.2 → comtypes-1.4.4}/MANIFEST.in +0 -0
  31. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/GUID.py +0 -0
  32. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/_comobject.py +0 -0
  33. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/_memberspec.py +0 -0
  34. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/_meta.py +0 -0
  35. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/_npsupport.py +0 -0
  36. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/_safearray.py +0 -0
  37. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/clear_cache.py +0 -0
  38. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/client/__init__.py +0 -0
  39. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/client/_code_cache.py +0 -0
  40. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/client/_constants.py +0 -0
  41. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/client/_events.py +0 -0
  42. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/client/_generate.py +0 -0
  43. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/client/dynamic.py +0 -0
  44. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/client/lazybind.py +0 -0
  45. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/connectionpoints.py +0 -0
  46. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/errorinfo.py +0 -0
  47. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/git.py +0 -0
  48. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/hresult.py +0 -0
  49. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/logutil.py +0 -0
  50. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/messageloop.py +0 -0
  51. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/patcher.py +0 -0
  52. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/persist.py +0 -0
  53. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/safearray.py +0 -0
  54. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/server/__init__.py +0 -0
  55. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/server/automation.py +0 -0
  56. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/server/connectionpoints.py +0 -0
  57. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/server/inprocserver.py +0 -0
  58. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/server/localserver.py +0 -0
  59. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/server/register.py +0 -0
  60. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/server/w_getopt.py +0 -0
  61. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/shelllink.py +0 -0
  62. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/TestComServer.idl +0 -0
  63. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/TestComServer.py +0 -0
  64. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/TestComServer.tlb +0 -0
  65. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/TestDispServer.idl +0 -0
  66. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/TestDispServer.py +0 -0
  67. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/TestDispServer.tlb +0 -0
  68. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/__init__.py +0 -0
  69. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/find_memleak.py +0 -0
  70. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/mylib.idl +0 -0
  71. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/mytypelib.idl +0 -0
  72. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/runtests.py +0 -0
  73. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/setup.py +0 -0
  74. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_BSTR.py +0 -0
  75. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_DISPPARAMS.py +0 -0
  76. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_QueryService.py +0 -0
  77. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_agilent.py +0 -0
  78. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_avmc.py +0 -0
  79. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_basic.py +0 -0
  80. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_casesensitivity.py +0 -0
  81. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_clear_cache.py +0 -0
  82. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_client.py +0 -0
  83. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_client_dynamic.py +0 -0
  84. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_client_regenerate_modules.py +0 -0
  85. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_collections.py +0 -0
  86. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_comserver.py +0 -0
  87. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_createwrappers.py +0 -0
  88. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_dict.py +0 -0
  89. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_dispinterface.py +0 -0
  90. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_dyndispatch.py +0 -0
  91. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_excel.py +0 -0
  92. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_getactiveobj.py +0 -0
  93. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_ie.py +0 -0
  94. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_ienum.py +0 -0
  95. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_imfattributes.py +0 -0
  96. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_inout_args.py +0 -0
  97. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_jscript.js +0 -0
  98. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_msscript.py +0 -0
  99. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_npsupport.py +0 -0
  100. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_outparam.py +0 -0
  101. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_propputref.py +0 -0
  102. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_pump_events.py +0 -0
  103. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_safearray.py +0 -0
  104. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_sapi.py +0 -0
  105. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_server.py +0 -0
  106. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_showevents.py +0 -0
  107. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_subinterface.py +0 -0
  108. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_typeinfo.py +0 -0
  109. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_urlhistory.py +0 -0
  110. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_variant.py +0 -0
  111. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_win32com_interop.py +0 -0
  112. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_wmi.py +0 -0
  113. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/test/test_word.py +0 -0
  114. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/tools/__init__.py +0 -0
  115. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/tools/typedesc_base.py +0 -0
  116. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/typeinfo.py +0 -0
  117. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/util.py +0 -0
  118. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes/viewobject.py +0 -0
  119. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes.egg-info/dependency_links.txt +0 -0
  120. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes.egg-info/entry_points.txt +0 -0
  121. {comtypes-1.4.2 → comtypes-1.4.4}/comtypes.egg-info/top_level.txt +0 -0
@@ -1,94 +0,0 @@
1
- import os
2
- import sys
3
- import tempfile
4
- import types
5
- import unittest
6
-
7
- import comtypes
8
- import comtypes.client
9
- import comtypes.gen
10
-
11
- if sys.version_info >= (3, 4):
12
- from importlib import reload
13
- else:
14
- from imp import reload
15
-
16
- imgbase = os.path.splitext(os.path.basename(sys.executable))[0]
17
-
18
-
19
- class Test(unittest.TestCase):
20
- """Test the comtypes.client._find_gen_dir() function in several
21
- simulated environments.
22
- """
23
-
24
- def setUp(self):
25
- # save the original comtypes.gen modules and create a
26
- # substitute with an empty __path__.
27
- self.orig_comtypesgen = sys.modules["comtypes.gen"]
28
- del sys.modules["comtypes.gen"]
29
- del comtypes.gen
30
- mod = sys.modules["comtypes.gen"] = types.ModuleType("comtypes.gen")
31
- mod.__path__ = []
32
- comtypes.gen = mod
33
-
34
- def tearDown(self):
35
- # Delete py2exe-attributes that we have attached to the sys module
36
- for name in "frozen frozendllhandle".split():
37
- try:
38
- delattr(sys, name)
39
- except AttributeError:
40
- pass
41
- # restore the original comtypes.gen module
42
- comtypes.gen = self.orig_comtypesgen
43
- sys.modules["comtypes.gen"] = self.orig_comtypesgen
44
- reload(comtypes.gen)
45
-
46
- def test_script(self):
47
- # %APPDATA%\Python\Python25\comtypes_cache
48
- template = r"$APPDATA\Python\Python%d%d\comtypes_cache"
49
- path = os.path.expandvars(template % sys.version_info[:2])
50
- gen_dir = comtypes.client._find_gen_dir()
51
- self.assertEqual(path, gen_dir)
52
-
53
- def test_frozen_dll(self):
54
- sys.frozen = "dll"
55
- sys.frozendllhandle = sys.dllhandle
56
- ma, mi = sys.version_info[:2]
57
- # %TEMP%\comtypes_cache\<imagebasename>-25
58
- # the image is python25.dll
59
- path = os.path.join(
60
- tempfile.gettempdir(),
61
- r"comtypes_cache\%s%d%d-%d%d" % (imgbase, ma, mi, ma, mi),
62
- )
63
- gen_dir = comtypes.client._find_gen_dir()
64
- self.assertEqual(path, gen_dir)
65
-
66
- def test_frozen_console_exe(self):
67
- sys.frozen = "console_exe"
68
- # %TEMP%\comtypes_cache\<imagebasename>-25
69
- path = os.path.join(
70
- tempfile.gettempdir(),
71
- r"comtypes_cache\%s-%d%d"
72
- % (imgbase, sys.version_info[0], sys.version_info[1]),
73
- )
74
- gen_dir = comtypes.client._find_gen_dir()
75
- self.assertEqual(path, gen_dir)
76
-
77
- def test_frozen_windows_exe(self):
78
- sys.frozen = "windows_exe"
79
- # %TEMP%\comtypes_cache\<imagebasename>-25
80
- path = os.path.join(
81
- tempfile.gettempdir(),
82
- r"comtypes_cache\%s-%d%d"
83
- % (imgbase, sys.version_info[0], sys.version_info[1]),
84
- )
85
- gen_dir = comtypes.client._find_gen_dir()
86
- self.assertEqual(path, gen_dir)
87
-
88
-
89
- def main():
90
- unittest.main()
91
-
92
-
93
- if __name__ == "__main__":
94
- main()
comtypes-1.4.2/setup.cfg DELETED
@@ -1,4 +0,0 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
comtypes-1.4.2/setup.py DELETED
@@ -1,172 +0,0 @@
1
- """comtypes package install script"""
2
- import sys
3
- import os
4
- import subprocess
5
-
6
- from setuptools import Command, setup
7
- from setuptools.command.install import install
8
- from setuptools.command.build_py import build_py
9
-
10
-
11
- with open('README.md') as readme_stream:
12
- readme = readme_stream.read()
13
-
14
-
15
- class test(Command):
16
- # Original version of this class posted
17
- # by Berthold Hoellmann to distutils-sig@python.org
18
- description = "run tests"
19
-
20
- user_options = [
21
- ('tests=', 't',
22
- "comma-separated list of packages that contain test modules"),
23
- ('use-resources=', 'u',
24
- "resources to use - resource names are defined by tests"),
25
- ('refcounts', 'r',
26
- "repeat tests to search for refcount leaks (requires "
27
- "'sys.gettotalrefcount')"),
28
- ]
29
-
30
- boolean_options = ["refcounts"]
31
-
32
- def initialize_options(self):
33
- self.use_resources = ""
34
- self.refcounts = False
35
- self.tests = "comtypes.test"
36
- self.failure = False
37
-
38
- def finalize_options(self):
39
- if self.refcounts and not hasattr(sys, "gettotalrefcount"):
40
- raise Exception("refcount option requires Python debug build")
41
- self.tests = self.tests.split(",")
42
- self.use_resources = self.use_resources.split(",")
43
-
44
- def run(self):
45
- build = self.reinitialize_command('build')
46
- build.run()
47
- if build.build_lib is not None:
48
- sys.path.insert(0, build.build_lib)
49
-
50
- # Register our ATL COM tester dll
51
- import comtypes.test
52
- script_path = os.path.dirname(__file__)
53
- source_dir = os.path.abspath(os.path.join(script_path, "source"))
54
- comtypes.test.register_server(source_dir)
55
-
56
- comtypes.test.use_resources.extend(self.use_resources)
57
- for name in self.tests:
58
- package = __import__(name, globals(), locals(), ['*'])
59
- sys.stdout.write("Testing package %s %s\n"
60
- % (name, (sys.version, sys.platform, os.name)))
61
- package_failure = comtypes.test.run_tests(package,
62
- "test_*.py",
63
- self.verbose,
64
- self.refcounts)
65
- self.failure = self.failure or package_failure
66
-
67
-
68
- classifiers = [
69
- 'Development Status :: 5 - Production/Stable',
70
- 'Intended Audience :: Developers',
71
- 'License :: OSI Approved :: MIT License',
72
- 'Operating System :: Microsoft :: Windows',
73
- 'Programming Language :: Python',
74
- 'Programming Language :: Python :: 3',
75
- 'Topic :: Software Development :: Libraries :: Python Modules',
76
- ]
77
-
78
-
79
- def read_version():
80
- # Determine the version number by reading it from the file
81
- # 'comtypes\__init__.py'. We cannot import this file (with py3,
82
- # at least) because it is in py2.x syntax.
83
- for line in open("comtypes/__init__.py"):
84
- if line.startswith("__version__ = "):
85
- var, value = line.split('=')
86
- return value.strip().strip('"').strip("'")
87
- raise NotImplementedError("__version__ is not found in __init__.py")
88
-
89
-
90
- class post_install(install):
91
-
92
- # both this static variable and method initialize_options() help to avoid
93
- # weird setuptools error with "pip install comtypes", details are here:
94
- # https://github.com/enthought/comtypes/issues/155
95
- # the working solution was found here:
96
- # https://github.com/pypa/setuptools/blob/3b90be7bb6323eb44d0f28864509c1d47aa098de/setuptools/command/install.py
97
- user_options = install.user_options + [
98
- ('old-and-unmanageable', None, "Try not to use this!"),
99
- ('single-version-externally-managed', None,
100
- "used by system package builders to create 'flat' eggs"),
101
- ]
102
-
103
- def initialize_options(self):
104
- install.initialize_options(self)
105
- self.old_and_unmanageable = None
106
- self.single_version_externally_managed = None
107
-
108
- def run(self):
109
- install.run(self)
110
- # Custom script we run at the end of installing
111
- if not self.dry_run and not self.root:
112
- print("Executing post install script...")
113
- print(f'"{sys.executable}" -m comtypes.clear_cache -y')
114
- try:
115
- subprocess.check_call([sys.executable, "-m", "comtypes.clear_cache", '-y'])
116
- except subprocess.CalledProcessError:
117
- print("Failed to run post install script!")
118
-
119
-
120
- setup_params = dict(
121
- name="comtypes",
122
- description="Pure Python COM package",
123
- long_description=readme,
124
- long_description_content_type="text/markdown",
125
- author="Thomas Heller",
126
- author_email="theller@python.net",
127
- url="https://github.com/enthought/comtypes",
128
- download_url="https://github.com/enthought/comtypes/releases",
129
- license="MIT License",
130
- package_data={
131
- "comtypes.test": [
132
- "TestComServer.idl",
133
- "TestComServer.tlb",
134
- "TestDispServer.idl",
135
- "TestDispServer.tlb",
136
- "mytypelib.idl",
137
- "mylib.idl",
138
- "mylib.tlb"
139
- "urlhist.tlb",
140
- "test_jscript.js",
141
- ],
142
- "comtypes": [
143
- "hints.pyi"
144
- ]},
145
- classifiers=classifiers,
146
-
147
- entry_points={
148
- "console_scripts": ["clear_comtypes_cache=comtypes.clear_cache:main"]
149
- },
150
-
151
- cmdclass={
152
- 'test': test,
153
- 'build_py': build_py,
154
- 'install': post_install,
155
- },
156
-
157
- version=read_version(),
158
- packages=[
159
- "comtypes",
160
- "comtypes.client",
161
- "comtypes.server",
162
- "comtypes.tools",
163
- "comtypes.test",
164
- ],
165
- )
166
-
167
- if __name__ == '__main__':
168
- dist = setup(**setup_params)
169
- # Exit with a failure code if only running the tests and they failed
170
- if dist.commands == ['test']:
171
- command = dist.command_obj['test']
172
- sys.exit(command.failure)
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