Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wintypes everywhere #8

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Use wintypes everywhere #8

wants to merge 15 commits into from

Conversation

moi15moi
Copy link
Owner

No description provided.

junkmd and others added 15 commits February 17, 2025 09:49
….wintypes.MAX_PATH`. (enthought#809)

* Replace a `260` literal with the `ctypes.wintypes.MAX_PATH` constant in `server/register.py`.

* Replace the `MAX_PATH` constant definition with import from `ctypes.wintypes.MAX_PATH` in `client/_code_cache.py`.

* Replace a `260` literal with the `ctypes.wintypes.MAX_PATH` constant in `test/test_server_register.py`.

* Replace a `260` literal with the `ctypes.wintypes.MAX_PATH` constant in `test/test_typeinfo.py`.
…de_cache.py`, and `errorinfo.py`. (enthought#810)

* Format the import block in `server/localserver.py`.

* Replace `from ctypes import wintypes` with specific imports in `client/_code_cache.py`.

* Replace `from ctypes import *` with specific imports in `errorinfo.py`.
…oduleFileName`. (enthought#811)

* Add a conditional branch and a test to throw an error in `GetModuleFileName`.

* Avoid importing `_get_module_filename` on the global level.

* Remove an unused `BSTR` import from `tools/tlbparser.py`.

* Replace import source of `COMError` in `server/tlbparser.py`.

* Replace defining `GetModuleFileName` with importing from `typeinfo`.

* Replace `client._code_cache._get_module_filename` with `typeinfo.GetModuleFileName`.

* Remove unnecessary rules.
…ought#812)

* For semantics and readability, use `ctypes.wintypes` symbols instead of `ctypes` symbols in `client._code_cache`.
See also https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetspecialfolderpathw

* Add `restype` to `client._code_cache.SHGetSpecialFolderPath`.
See also https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetspecialfolderpathw

* Use the enthought#735 style for referencing the `shell32` DLL library.

* Add `# noqa` comments and remove `tools/tlbparser.py` from `[tool.ruff.lint.per-file-ignores]`.

* Resolve the `E711` style error in `client/_code_cache.py`.
* Replace type aliases: `BYREFTYPE` -> `_CArgObject`

* Replace type aliases: `SIMPLETYPE` -> `_PyCSimpleType`

* Make the `prepare_parameter` a private function.

* Change an argname of `_prepare_parameter`.

* Add type annotations to `_prepare_parameter`.

* Move definitions of type aliases.

* Add comments.
…ient/_events.py`. (enthought#815)

* Replace `ctypes.byref` with `byref` in `client/_events.py`.

* Replace `import comtypes.typeinfo` with specific imports in `client/_events.py`.

* Replace `comtypes.COMObject` and `comtypes.IUnknown` with specific imports in `server/localserver.py`.

* Replace `import ctypes` with specific imports in `server/inprocserver.py`.

* Remove assignment to unused variable `res` from `PumpEvents`.

* Convert to `not in` from `not ... in` in `inproc_find_class`.

* Add type assertions.
… `client/_events.py`, `server/inprocserver.py` and `server/localserver.py`. (enthought#816)
* Add `SupportErrorInfoTest` to `test_comserver`.

* Add type hints to `errorinfo.py` for supressing type errors in `test_comserver`.
* Add `test_errorinfo`.

* Replace `_SetErrorInfo` with `SetErrorInfo`.
This allows us to remove the magic number `0` from the arguments without changing the behavior.

* Replace `from comtypes.hresult import *` with specific imports in `errorinfo.py`.

* Fix expected `__name__` of frames in `Test_ReportException.test_with_stacklevel`.
* Add type hints to `errorinfo.py` for supressing type errors in `test_errorinfo`.

* Add type hints to `errorinfo.ReportError` and `errorinfo.ReportException`.

* Add type hints to `errorinfo.ICreateErrorInfo`.

* Add type hints to `errorinfo.CreateErrorInfo`.

* Add type hints to `errorinfo.SetErrorInfo`.
* Fix `GetMessage.argtypes` style.

* Add type annotations to `messageloop.py`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants