8000 More pywin32 stub completion by Avasam · Pull Request #9308 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

More pywin32 stub completion #9308

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

Merged
merged 14 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stubs/pywin32/@tests/stubtest_allowlist_win32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ win32com.client.combrowse
win32com.client.tlbrowse

# Utilities to generate python bindings
win32com.client.build
win32com.client.build.*
win32com.client.CLSIDToClass
win32com.client.connect
# "dynamic.CDipatch" is necessary for mypy to not throw AssertionError
win32com.client.dynamic.*
win32com.client.gencache
win32com.client.gencache.*
win32com.client.genpy
win32com.client.makepy
win32com.client.selecttlb
Expand Down
175 changes: 79 additions & 96 deletions stubs/pywin32/_win32typing.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Not available at runtime. Contains type definitions that are otherwise not exposed and not part of a specific module.
from _typeshed import Incomplete
from typing_extensions import final
from _typeshed import Incomplete, Self
from collections.abc import Iterable
from typing import overload
from typing_extensions import Literal, final

class ArgNotFound: ...
class PyOleEmpty: ...
Expand Down Expand Up @@ -162,13 +164,16 @@ class PRINTER_DEFAULTS:
class PyACL:
def Initialize(self) -> None: ...
def IsValid(self) -> bool: ...
def AddAccessAllowedAce(self, revision, access, sid: PySID, access1, sid1) -> None: ...
def AddAccessAllowedAceEx(self, revision, aceflags, access, sid: PySID) -> None: ...
@overload
def AddAccessAllowedAce(self, __access: int, __sid: PySID) -> None: ...
@overload
def AddAccessAllowedAce(self, __revision: int, __access: int, __sid: PySID) -> None: ...
def AddAccessAllowedAceEx(self, __revision: int, __aceflags: int, __access: int, __sid: PySID) -> None: ...
def AddAccessAllowedObjectAce(
self, AceRevision, AceFlags, AccessMask, ObjectTypeGuid: PyIID, InheritedObjectTypeGuid: PyIID, sid: PySID
) -> None: ...
def AddAccessDeniedAce(self, revision, access, sid: PySID, access1, sid1) -> None: ...
def AddAccessDeniedAceEx(self, revision, aceflags, access, sid: PySID) -> None: ...
def AddAccessDeniedAce(self, __revision: int, __access: int, __sid: PySID, __access1: int, __sid1: PySID) -> None: ...
def AddAccessDeniedAceEx(self, __revision: int, __aceflags: int, __access: int, __sid: PySID) -> None: ...
def AddMandatoryAce(self, AceRevision, AceFlags, MandatoryPolicy, LabelSid: PySID) -> None: ...
def AddAuditAccessAce(self, dwAceRevision, dwAccessMask, sid: PySID, bAuditSuccess, bAuditFailure) -> None: ...
def AddAuditAccessAceEx(self, dwAceRevision, AceFlags, dwAccessMask, sid: PySID, bAuditSuccess, bAuditFailure) -> None: ...
Expand All @@ -185,11 ED4F +190,13 @@ class PyACL:
) -> None: ...
def GetAclSize(self): ...
def GetAclRevision(self): ...
def GetAceCount(self): ...
def GetAce(self, index): ...
def DeleteAce(self, index) -> None: ...
def GetEffectiveRightsFromAcl(self, trustee: PyTRUSTEE): ...
def GetAceCount(self) -> int: ...
def GetAce(self, __index: int) -> tuple[tuple[int, int], int, PySID]: ...
def DeleteAce(self, __index: int) -> None: ...
def GetEffectiveRightsFromAcl(self, __trustee: PyTRUSTEE | dict[str, int | PySID]) -> int: ...
def GetAuditedPermissionsFromAcl(self, trustee: PyTRUSTEE) -> tuple[Incomplete, Incomplete]: ...
def SetEntriesInAcl(self, __obexpl_list: tuple[dict[str, int | dict[str, int | PySID]], ...]) -> PyACL: ...
def GetExplicitEntriesFromAcl(self) -> tuple[dict[str, int | dict[str, int | PySID]]] | None: ...

class PyBITMAP:
@property
Expand Down Expand Up @@ -546,7 +553,7 @@ class PyConsoleScreenBuffer:
def ReadConsole(self, NumberOfCharsToRead): ...
def WriteConsole(self, Buffer): ...
def FlushConsoleInputBuffer(self) -> None: ...
def SetConsoleTextAttribute(self, Attributes) -> None: ...
def SetConsoleTextAttribute(self, __Attributes: int) -> None: ...
def SetConsoleCursorPosition(self, CursorPosition: PyCOORD) -> None: ...
def SetConsoleScreenBufferSize(self, Size: PyCOORD) -> None: ...
def SetConsoleWindowInfo(self, Absolute, ConsoleWindow: PySMALL_RECT) -> None: ...
Expand All @@ -566,7 +573,7 @@ class PyConsoleScreenBuffer:
def SetConsoleFont(self, Font) -> None: ...
def SetStdHandle(self, StdHandle) -> None: ...
def SetConsoleDisplayMode(self, Flags, NewScreenBufferDimensions: PyCOORD) -> None: ...
def WriteConsoleInput(self, Buffer: tuple[PyINPUT_RECORD, ...]): ...
def WriteConsoleInput(self, __Buffer: Iterable[PyINPUT_RECORD]): ...
def ReadConsoleInput(self, Length) -> tuple[PyINPUT_RECORD, ...]: ...
def PeekConsoleInput(self, Length) -> tuple[PyINPUT_RECORD, ...]: ...
def GetNumberOfConsoleInputEvents(self): ...
Expand Down Expand Up @@ -864,7 +871,7 @@ class PyEventLogRecord:
@property
def StringInserts(self) -> tuple[str, ...]: ...
@property
def Sid(self) -> PySID: ...
def Sid(self) -> PySID | None: ...
@property
def Data(self) -> str: ...
@property
Expand Down Expand Up @@ -916,7 +923,7 @@ class PyHANDLE:
def handle(self) -> int: ...
def Close(self) -> None: ...
def close(self) -> None: ...
def Detach(self): ...
def Detach(self: Self) -> Self: ...

@final
class PyHDESK:
Expand Down Expand Up @@ -1049,7 +1056,10 @@ class PyHH_WINTYPE:
def urlJump2(self) -> str: ...

class PyHINTERNET: ...
class PyHKEY: ...

class PyHKEY:
def Close(self): ...

class PyHTHEME: ...

@final
Expand All @@ -1060,36 +1070,25 @@ class PyHWINSTA:
def Detach(self, *args, **kwargs): ... # incomplete

class PyICONINFO: ...

@final
class PyIID: ...

@final
class PyINPUT_RECORD:
@property
def EventType(self): ...
@property
def KeyDown(self): ...
@property
def RepeatCount(self): ...
@property
def VirtualKeyCode(self): ...
@property
def VirtualScanCode(self): ...
@property
def Char(self) -> str: ...
@property
def ControlKeyState(self): ...
@property
def ButtonState(self): ...
@property
def EventFlags(self): ...
@property
def MousePosition(self) -> PyCOORD: ...
@property
def Size(self) -> PyCOORD: ...
@property
def SetFocus(self): ...
@property
def CommandId(self): ...
EventType: int
KeyDown: int | bool
RepeatCount: int
VirtualKeyCode: int
VirtualScanCode: Incomplete
Char: str
ControlKeyState: int
ButtonState: int
EventFlags: int
MousePosition: PyCOORD
Size: PyCOORD
SetFocus: Incomplete
CommandId: Incomplete

class PyLOCALGROUP_INFO_0:
@property
Expand Down Expand Up @@ -1206,20 +1205,13 @@ class PyNMHDR:
class PyNOTIFYICONDATA: ...

class PyOVERLAPPED:
@property
def Offset(self) -> int: ...
@property
def OffsetHigh(self) -> int: ...
@property
def object(self): ...
@property
def dword(self): ...
@property
def hEvent(self) -> int: ...
@property
def Internal(self) -> int: ...
@property
def InternalHigh(self) -> int: ...
Offset: int
OffsetHigh: int
object: object
dword: int
hEvent: int
Internal: int
InternalHigh: int

class PyOVERLAPPEDReadBuffer: ...

Expand Down Expand Up @@ -1276,24 +1268,23 @@ class PySCROLLINFO: ...
class PySC_HANDLE: ...

class PySECURITY_ATTRIBUTES:
@property
def bInheritHandle(self): ...
@property
def SECURITY_DESCRIPTOR(self) -> PySECURITY_DESCRIPTOR: ...
bInheritHandle: int
SECURITY_DESCRIPTOR: PySECURITY_DESCRIPTOR

class PySECURITY_DESCRIPTOR:
def Initialize(self) -> None: ...
def GetSecurityDescriptorOwner(self) -> PySID: ...
def GetSecurityDescriptorDacl(self) -> PyACL: ...
def GetSecurityDescriptorSacl(self) -> PyACL: ...
def GetSecurityDescriptorControl(self) -> tuple[Incomplete, Incomplete]: ...
def SetSecurityDescriptorOwner(self, sid: PySID, bOwnerDefaulted) -> None: ...
def SetSecurityDescriptorOwner(self, __sid: PySID, __bOwnerDefaulted: int | bool) -> None: ...
def SetSecurityDescriptorGroup(self, sid: PySID, bOwnerDefaulted): ...
def SetSecurityDescriptorDacl(self, __bSaclPresent: int | bool, __SACL: PyACL, __bSaclDefaulted: int | bool) -> None: ...
def SetSecurityDescriptorSacl(self, bSaclPresent, SACL: PyACL, bSaclDefaulted) -> None: ...
def SetSecurityDescriptorControl(self, ControlBitsOfInterest, ControlBitsToSet) -> None: ...
def IsValid(self) -> bool: ...
def GetLength(self) -> None: ...
def IsSelfRelative(self) -> bool: ...
def SetSecurityDescriptorControl(self, ControlBitsOfInterest, ControlBitsToSet) -> None: ...

class PySERVER_INFO_100:
@property
Expand Down Expand Up @@ -1661,34 +1652,20 @@ class PySMALL_RECT:
def Bottom(self): ...

class PySTARTUPINFO:
@property
def dwX(self) -> int: ...
@property
def dwY(self) -> int: ...
@property
def dwXSize(self) -> int: ...
@property
def dwYSize(self) -> int: ...
@property
def dwXCountChars(self) -> int: ...
@property
def dwYCountChars(self) -> int: ...
@property
def dwFillAttribute(self) -> int: ...
@property
def dwFlags(self) -> int: ...
@property
def wShowWindow(self) -> int: ...
@property
def hStdInput(self) -> int: ...
@property
def hStdOutput(self) -> int: ...
@property
def hStdError(self) -> int: ...
@property
def lpDesktop(self) -> str: ...
@property
def lpTitle(self) -> str: ...
dwX: int
dwY: int
dwXSize: int
dwYSize: int
dwXCountChars: int
dwYCountChars: int
dwFillAttribute: int
dwFlags: int
wShowWindow: int
hStdInput: int
hStdOutput: int
hStdError: int
lpDesktop: str
lpTitle: str

class PySecBuffer:
@property
Expand All @@ -1703,6 +1680,7 @@ class PySecBuffer:

class PySecBufferDesc:
Version: Incomplete
Buffer: Incomplete
def append(self, buffer) -> None: ...

class PyTOKEN_GROUPS: ...
Expand All @@ -1722,17 +1700,18 @@ class PyTRIVERTEX:
@property
def Alpha(self): ...

# Properties Multiple* are ignored
class PyTRUSTEE:
@property
def TrusteeForm(self): ...
def TrusteeForm(self) -> int: ...
@property
def TrusteeType(self): ...
def TrusteeType(self) -> int: ...
@property
def Identifier(self): ...
def Identifier(self) -> PySID: ...
@property
def MultipleTrustee(self): ...
def MultipleTrustee(self) -> None: ...
@property
def MultipleTrusteeOperation(self): ...
def MultipleTrusteeOperation(self) -> Literal[0]: ...

class PyTS_HANDLE: ...

Expand Down Expand Up @@ -2459,7 +2438,9 @@ class SERVICE_FAILURE_ACTIONS:
@property
def Actions(self): ...

class SERVICE_STATUS: ...
class SERVICE_STATUS:
def __getitem__(self, __i: int) -> int: ...

class TRACKMOUSEEVENT: ...
class ULARGE_INTEGER: ...
class WIN32_FIND_DATA: ...
Expand Down Expand Up @@ -3389,6 +3370,7 @@ class PyIDirectorySearch:
def GetColumn(self, handle, name: str) -> tuple[Incomplete, Incomplete, Incomplete]: ...
def GetNextColumnName(self) -> None: ...

@final
class PyIDispatch:
def Invoke(self, dispid, lcid, flags, bResultWanted, arg: tuple[Incomplete, ...]): ...
def InvokeTypes(
Expand Down Expand Up @@ -4679,6 +4661,7 @@ class PyIUniformResourceLocator:
def SetURL(self, URL, InFlags: int = ...) -> None: ...
def InvokeCommand(self, Verb, Flags: int = ..., hwndParent: int = ...): ...

@final
class PyIUnknown:
def QueryInterface(self, iid, useIID: Incomplete | None = ...) -> PyIUnknown: ...

Expand Down Expand Up @@ -5788,7 +5771,7 @@ class PyCWinApp:
def LoadCursor(self, cursorId: PyResourceId): ...
def LoadStandardCursor(self, cursorId: PyResourceId): ...
def LoadOEMCursor(self, cursorId): ...
def LoadIcon(self, idResource): ...
def LoadIcon(self, idResource: int) -> int: ...
def LoadStandardIcon(self, resourceName: PyResourceId): ...
def OpenDocumentFile(self, fileName: str) -> None: ...
def OnFileNew(self) -> None: ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/pywin32/pythoncom.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def CoCreateInstanceEx(
iids: list[_win32typing.PyIID],
) -> _win32typing.PyIUnknown: ...
def CoCreateInstance(
clsid: _win32typing.PyIID, unkOuter: _win32typing.PyIUnknown, context, iid: _win32typing.PyIID
__clsid: _win32typing.PyIID, __unkOuter: _win32typing.PyIUnknown | None, __context: int, __iid: _win32typing.PyIID
) -> _win32typing.PyIUnknown: ...
def CoFreeUnusedLibraries() -> None: ...
def CoInitialize() -> None: ...
Expand Down Expand Up @@ -84,7 +84,7 @@ def OleLoadFromStream(stream: _win32typing.PyIStream, iid: _win32typing.PyIID) -
def OleSaveToStream(persist: _win32typing.PyIPersistStream, stream: _win32typing.PyIStream) -> None: ...
def OleLoad(storage: _win32typing.PyIStorage, iid: _win32typing.PyIID, site: _win32typing.PyIOleClientSite) -> None: ...
def ProgIDFromCLSID(clsid) -> str: ...
def PumpWaitingMessages(): ...
def PumpWaitingMessages(__firstMessage: int = ..., __lastMessage: int = ...) -> int: ...
def PumpMessages() -> None: ...
def QueryPathOfRegTypeLib(iid: _win32typing.PyIID, versionMajor, versionMinor, lcid) -> str: ...
def ReadClassStg(storage: _win32typing.PyIStorage) -> _win32typing.PyIID: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/pywin32/pythonwin/win32ui.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def MessageBox(message: str, arg, title: str | None = ...): ...
def OutputDebugString(msg: str) -> None: ...
def EnableControlContainer(): ...
def PrintTraceback(tb, output) -> None: ...
def PumpWaitingMessages(firstMessage, lastMessage): ...
def PumpWaitingMessages(__firstMessage: int = ..., __lastMessage: int = ...) -> int: ...
def RegisterWndClass(style, hCursor: int = ..., hBrush: int = ..., hIcon=...) -> str: ...
def RemoveRecentFile(index: int = ...) -> None: ...
def SetAppHelpPath(): ...
Expand Down
Loading
0