forked from enthought/comtypes
-
Notifications
You must be signed in to change notification settings - Fork 0
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
moi15moi
wants to merge
15
commits into
main
Choose a base branch
from
use-wintypes-everywhere
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
….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 `Unpack` to `hints.pyi`. * Improve type hints for `idlflags` by using `Unpack`. * Fix `dispid` type annotations. See also: https://github.com/enthought/comtypes/blob/01b6fc03ffe0279612a93ae031e60f9095793136/comtypes/tools/codegenerator/helpers.py#L117-L127 https://github.com/enthought/comtypes/blob/01b6fc03ffe0279612a93ae031e60f9095793136/comtypes/tools/codegenerator/helpers.py#L130-L131 https://github.com/enthought/comtypes/blob/01b6fc03ffe0279612a93ae031e60f9095793136/comtypes/tools/codegenerator/helpers.py#L143-L153 * Add a type assertion for `comtypes.dispid`.
* 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.