Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Make UIAutomationClient work for tools and runtime
At runtime the import from comtypes.gen will work, as a fallback for IDE
/ Tools that can't find that the relative import is used.

Note: IDE's wont be aware of 'protected' symbols (beginning with
underscore), they aren't imported with the from x import * statment.
  • Loading branch information
feerrenrut committed Mar 19, 2021
commit 2cf976ee1c28c189d2c43a91bd5f6ee6a8456b98
4 changes: 2 additions & 2 deletions source/_UIAHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import eventHandler
from logHandler import log
import UIAUtils
from comtypes.gen import UIAutomationClient as UIA
from comtypes.gen.UIAutomationClient import *
from comInterfaces import UIAutomationClient as UIA
from comInterfaces .UIAutomationClient import *
import textInfos
from typing import Dict
from queue import Queue
Expand Down
6 changes: 5 additions & 1 deletion source/comInterfaces/UIAutomationClient.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from comtypes.gen import _944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0
try:
from comtypes.gen import _944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0
except ModuleNotFoundError:
import _944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0
from _944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0 import *
globals().update(_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.__dict__)
__name__ = 'comtypes.gen.UIAutomationClient'
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class IUIAutomationTogglePattern(comtypes.gen._00020430_0000_0000_C000_000000000
_iid_ = GUID('{94CF8058-9B8D-4AB9-8BFD-4CD0A33C8C70}')
_idlflags_ = []

_isHidden = True
# values for enumeration 'ToggleState'
ToggleState_Off = 0
ToggleState_On = 1
Expand Down