-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdab709
commit 1e4194e
Showing
8 changed files
with
124 additions
and
74 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
{ | ||
"editor.accessibilitySupport": "on", | ||
"python.linting.enabled": true, | ||
"python.linting.maxNumberOfProblems": 10000, | ||
"python.linting.flake8Args": [ | ||
"flake8.args": [ | ||
"--config=flake8.ini" | ||
], | ||
"python.linting.flake8Enabled": true, | ||
"python.linting.pylintEnabled": false, | ||
"flake8.importStrategy": "fromEnvironment", | ||
"python.autoComplete.extraPaths": [ | ||
"../nvda/source", | ||
"../nvda/miscDeps/python" | ||
], | ||
], | ||
"files.insertFinalNewline": true, | ||
"files.trimFinalNewlines": true, | ||
"editor.insertSpaces": false, | ||
"python.analysis.diagnosticSeverityOverrides": { | ||
"reportUndefinedVariable": "none" | ||
}, | ||
"python.analysis.stubPath": "${workspaceFolder}/.vscode/typings", | ||
"python.analysis.extraPaths": [ | ||
"../nvda/source", | ||
"../nvda/miscDeps/python" | ||
], | ||
"python.defaultInterpreterPath": "../nvda/.venv/scripts/python.exe" | ||
"python.defaultInterpreterPath": "${workspaceFolder}/../nvda/.venv/scripts/python.exe" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def _(msg: str) -> str: | ||
... | ||
|
||
|
||
def pgettext(context: str, message: str) -> str: | ||
... |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,37 @@ | ||
import appModuleHandler | ||
import api | ||
import ui | ||
import mouseHandler | ||
import winUser | ||
from scriptHandler import script | ||
import controlTypes | ||
import ui | ||
from versionInfo import version_year | ||
|
||
role = controlTypes.Role if version_year>=2022 else controlTypes.role.Role | ||
role = controlTypes.Role if version_year >= 2022 else controlTypes.role.Role | ||
|
||
|
||
def find_nth_from_end(string, substring, n): | ||
if n <= 0 or substring not in string: | ||
return -1 | ||
count = string.count(substring) | ||
if n > count: # 如果n大于出现次数,则直接返回-1 | ||
return -1 | ||
start = len(string) | ||
for _ in range(n): | ||
idx = string.rfind(substring, 0, start) | ||
start = idx # 更新下次查找的结束位置为当前找到的位置 | ||
return start # 返回找到的索引 | ||
|
||
|
||
class AppModule(appModuleHandler.AppModule): | ||
|
||
def event_gainFocus(self, obj, nextHandler, isFocus=False): | ||
try: | ||
if obj.treeInterceptor and obj.role==role.LIST and "discuss_list" == obj.IA2Attributes.get("class"): | ||
o=obj.firstChild.firstChild | ||
while o: | ||
ui.message(o.firstChild.name) | ||
o=o.next | ||
elif obj.treeInterceptor and obj.role==role.LISTITEM and "js_comment" in obj.IA2Attributes.get("class"): | ||
ui.message(obj.firstChild.name) | ||
elif obj.treeInterceptor and obj.role==role.BUTTON and "sns_opr_btn sns_praise_btn" == obj.IA2Attributes.get("class"): | ||
ui.message(obj.simplePrevious.name) | ||
except: pass | ||
message = [] | ||
if obj.treeInterceptor and obj.role == role.BUTTON \ | ||
and obj.IA2Attributes.get('class', '') == 'sns_opr_btn sns_praise_btn': | ||
while "discuss_user_avatar" not in obj.IA2Attributes.get('class', ''): | ||
if obj.IA2Attributes.get('display', '') == 'inline': | ||
message.append(obj.name) | ||
obj = obj.simplePrevious | ||
temp = obj.name | ||
parts = temp.split(' ,') | ||
temp = ','.join(parts[:-3]) if len(parts) >= 3 else temp | ||
message.append(temp) | ||
ui.message(','.join(message)) | ||
nextHandler() | ||
|
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
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
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