Skip to content

Commit 50fcc84

Browse files
authored
Format import blocks in *.py. (#796)
* Format the import block in `connectionpoints.py`. * Format the import block in `errorinfo.py`. * Format the import block in `git.py`. * Format the import block in `GUID.py`. * Format the import block in `messageloop.py`. * Format the import block in `persist.py`. * Format the import block in `safearray.py`. * Format the import block in `shelllink.py`. * Format the import block in `stream.py`. * Format the import block in `typeinfo.py`. * Format the import block in `viewobject.py`.
1 parent ace0062 commit 50fcc84

11 files changed

Lines changed: 41 additions & 35 deletions

File tree

comtypes/GUID.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""comtypes.GUID module"""
22

3-
from ctypes import HRESULT, POINTER, OleDLL, WinDLL
4-
from ctypes import byref, c_wchar_p, Structure
5-
from ctypes.wintypes import BYTE, LPVOID, WORD, DWORD
6-
from typing import Any, TYPE_CHECKING
3+
from ctypes import HRESULT, POINTER, OleDLL, Structure, WinDLL, byref, c_wchar_p
4+
from ctypes.wintypes import BYTE, DWORD, LPVOID, WORD
5+
from typing import TYPE_CHECKING, Any
76

87
if TYPE_CHECKING:
98
from comtypes import hints # type: ignore

comtypes/connectionpoints.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
from ctypes import *
3-
from comtypes import IUnknown, COMMETHOD, GUID, HRESULT, dispid
3+
4+
from comtypes import COMMETHOD, GUID, HRESULT, IUnknown, dispid
45

56
_GUID = GUID
67

comtypes/errorinfo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import sys
22
from ctypes import *
33
from ctypes.wintypes import DWORD, ULONG
4-
from comtypes import IUnknown, HRESULT, COMMETHOD, GUID, BSTR
4+
5+
from comtypes import BSTR, COMMETHOD, GUID, HRESULT, IUnknown
56
from comtypes.hresult import *
67

78
LPCOLESTR = c_wchar_p

comtypes/git.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
from ctypes import *
88
from ctypes.wintypes import DWORD
9+
910
from comtypes import (
10-
IUnknown,
11-
STDMETHOD,
11+
CLSCTX_INPROC_SERVER,
1212
COMMETHOD,
1313
GUID,
1414
HRESULT,
15+
STDMETHOD,
1516
CoCreateInstance,
16-
CLSCTX_INPROC_SERVER,
17+
IUnknown,
1718
)
1819

1920

comtypes/messageloop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ctypes
2-
from ctypes import WinDLL, byref, WinError
2+
from ctypes import WinDLL, WinError, byref
33
from ctypes.wintypes import MSG
44

55
_user32 = WinDLL("user32")

comtypes/persist.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@
1010
interface, useful in client code.
1111
"""
1212

13-
from ctypes import c_int, c_ulong, c_ushort, c_wchar_p
14-
from ctypes import POINTER, Structure
15-
from ctypes.wintypes import WORD, DWORD, BOOL
13+
from ctypes import POINTER, Structure, c_int, c_ulong, c_ushort, c_wchar_p
14+
from ctypes.wintypes import BOOL, DWORD, WORD
1615
from typing import TYPE_CHECKING
1716

18-
from comtypes import GUID, IUnknown, COMMETHOD, HRESULT
19-
from comtypes import IPersist
17+
from comtypes import COMMETHOD, GUID, HRESULT, IPersist, IUnknown
2018
from comtypes.automation import VARIANT, tagEXCEPINFO
2119

2220
if TYPE_CHECKING:

comtypes/safearray.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import threading
21
import array
2+
import threading
3+
from ctypes import POINTER, Structure, byref, c_long, cast, memmove, pointer, sizeof
34
from typing import TYPE_CHECKING
5+
46
import comtypes
5-
from ctypes import POINTER, Structure, byref, cast, c_long, memmove, pointer, sizeof
6-
from comtypes import _safearray, IUnknown, com_interface_registry
7+
from comtypes import IUnknown, _safearray, com_interface_registry
78
from comtypes.patcher import Patch
89

910
if TYPE_CHECKING:
1011
from typing import Type, TypeVar
12+
1113
from comtypes import hints # type: ignore
1214

1315
_CT = TypeVar("_CT", bound=comtypes._CData)
@@ -73,12 +75,12 @@ def _midlSAFEARRAY(itemtype: "Type[_CT]") -> "Type[hints.LP_SAFEARRAY[_CT]]":
7375
def _make_safearray_type(itemtype):
7476
# Create and return a subclass of tagSAFEARRAY
7577
from comtypes.automation import (
76-
_ctype_to_vartype,
78+
VT_DISPATCH,
79+
VT_HRESULT,
7780
VT_RECORD,
7881
VT_UNKNOWN,
7982
IDispatch,
80-
VT_DISPATCH,
81-
VT_HRESULT,
83+
_ctype_to_vartype,
8284
)
8385

8486
meta = type(_safearray.tagSAFEARRAY)

comtypes/shelllink.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
from ctypes import c_char_p, c_int, c_short, c_wchar_p
2-
from ctypes import POINTER
3-
from ctypes import byref, create_string_buffer, create_unicode_buffer
4-
from ctypes.wintypes import DWORD, WIN32_FIND_DATAA, WIN32_FIND_DATAW, MAX_PATH
5-
from typing import Tuple, TYPE_CHECKING, Literal
6-
7-
from comtypes import IUnknown, GUID, COMMETHOD, HRESULT, CoClass
1+
from ctypes import (
2+
POINTER,
3+
byref,
4+
c_char_p,
5+
c_int,
6+
c_short,
7+
c_wchar_p,
8+
create_string_buffer,
9+
create_unicode_buffer,
10+
)
11+
from ctypes.wintypes import DWORD, MAX_PATH, WIN32_FIND_DATAA, WIN32_FIND_DATAW
12+
from typing import TYPE_CHECKING, Literal, Tuple
813

14+
from comtypes import COMMETHOD, GUID, HRESULT, CoClass, IUnknown
915

1016
if TYPE_CHECKING:
1117
from comtypes import hints # type: ignore

comtypes/stream.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from ctypes import Array, c_ubyte, c_ulong, HRESULT, POINTER, pointer
2-
from typing import Tuple, TYPE_CHECKING
1+
from ctypes import HRESULT, POINTER, Array, c_ubyte, c_ulong, pointer
2+
from typing import TYPE_CHECKING, Tuple
33

44
from comtypes import COMMETHOD, GUID, IUnknown
55

comtypes/typeinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from ctypes import (
1010
HRESULT,
1111
POINTER,
12-
_Pointer,
1312
OleDLL,
1413
WinDLL,
14+
_Pointer,
1515
byref,
1616
c_int,
1717
c_void_p,

0 commit comments

Comments
 (0)