Skip to content

Commit c7ded6e

Browse files
committed
pre-commit format
1 parent e716288 commit c7ded6e

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

addon/globalPlugins/MathCAT/MathCAT.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
def getLanguageToUse(mathMl: str = "") -> str:
9595
"""Get the language specified in a math tag if the language pref is Auto, else the language preference.
9696
97-
:param mathMl: The MathML string to examine for language. Defaults to an empty string.
98-
:returns: The language string to use.
99-
"""
97+
:param mathMl: The MathML string to examine for language. Defaults to an empty string.
98+
:returns: The language string to use.
99+
"""
100100
mathCATLanguageSetting: str = "Auto"
101101
try:
102102
# ignore regional differences if the MathCAT language setting doesn't have it.
@@ -222,6 +222,7 @@ def convertSSMLTextForNVDA(text: str) -> list[str | SpeechCommand]:
222222

223223
class MathCATInteraction(mathPres.MathInteractionNVDAObject):
224224
"""An NVDA object used to interact with MathML."""
225+
225226
# Put MathML or other formats on the clipboard.
226227
# MathML is put on the clipboard using the two formats below (defined by MathML spec)
227228
# We use both formats because some apps may only use one or the other
@@ -240,9 +241,9 @@ def __init__(
240241
):
241242
"""Initialize the MathCATInteraction object.
242243
243-
:param provider: Optional presentation provider.
244-
:param mathMl: Optional initial MathML string.
245-
"""
244+
:param provider: Optional presentation provider.
245+
:param mathMl: Optional initial MathML string.
246+
"""
246247
super(MathCATInteraction, self).__init__(provider=provider, mathMl=mathMl)
247248
if mathMl is None:
248249
self.initMathML = "<math></math>"
@@ -464,7 +465,7 @@ def _copyToClipAsMathML(
464465
notify: bool | None = False,
465466
) -> bool:
466467
"""Copies the given text to the windows clipboard.
467-
468+
468469
:param text: the text which will be copied to the clipboard.
469470
:param notify: whether to emit a confirmation message.
470471
:returns: True if it succeeds, False otherwise.
@@ -495,7 +496,7 @@ def _copyToClipAsMathML(
495496

496497
def _setClipboardData(self, format: int, data: str) -> None:
497498
"""Sets the clipboard data to the given data with the specified format.
498-
499+
499500
:param format: The format for the clipboard data. This is an integer format code returned by windll.user32.RegisterClipboardFormatW.
500501
:param data: The data to set on the clipboard.
501502
"""

addon/globalPlugins/MathCAT/MathCATPreferences.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ class UserInterface(MathCATgui.MathCATPreferencesDialog):
4747
Initializes and manages user preferences, including language, speech, braille,
4848
and navigation settings. Extends MathCATgui.MathCATPreferencesDialog.
4949
"""
50+
5051
def __init__(self, parent):
5152
"""Initialize the preferences dialog.
5253
53-
Sets up the UI, loads preferences, applies defaults and saved settings,
54+
Sets up the UI, loads preferences, applies defaults and saved settings,
5455
and restores the previous UI state.
5556
5657
:param parent: The parent window for the dialog.
@@ -344,7 +345,8 @@ def getLanguages(self) -> None:
344345
regional dialects. Language folders use ISO 639-1 codes and regional variants use ISO 3166-1 alpha-2 codes.
345346
346347
It also adds a special "Use Voice's Language (Auto)" option at the top.
347-
"""
348+
"""
349+
348350
def addRegionalLanguages(subDir: str, language: str) -> list[str]:
349351
# the language variants are in folders named using ISO 3166-1 alpha-2
350352
# codes https://en.wikipedia.org/wiki/ISO_3166-2
@@ -943,16 +945,16 @@ def onLanguage(self, event: wx.CommandEvent) -> None:
943945
def mathCATPreferencesDialogOnCharHook(self, event: wx.KeyEvent) -> None:
944946
"""Handles character key events within the MathCAT Preferences dialog.
945947
946-
This method interprets specific key presses to mimic button clicks or
948+
This method interprets specific key presses to mimic button clicks or
947949
navigate within the preferences dialog:
948950
949951
- Escape: Triggers the Cancel button functionality.
950952
- Enter: Triggers the OK button functionality.
951953
- Ctrl+Tab: Cycles forward through the preference categories.
952954
- Ctrl+Shift+Tab: Cycles backward through the preference categories.
953-
- Tab: Moves focus to the first control in the currently selected category,
955+
- Tab: Moves focus to the first control in the currently selected category,
954956
if the category list has focus.
955-
- Shift+Tab: Moves focus to the second row of controls,
957+
- Shift+Tab: Moves focus to the second row of controls,
956958
if the OK button has focus.
957959
958960
If none of these keys are matched, the event is skipped to allow default processing.

addon/globalPlugins/MathCAT/MathCATgui.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class MathCATPreferencesDialog(wx.Dialog):
1717
1818
This base class sets up the layout and controls.
1919
"""
20+
2021
def __init__(self, parent):
2122
"""Initialize the preferences dialog.
2223

addon/globalPlugins/MathCAT/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
python3.dll has "Copyright © 2001-2022 Python Software Foundation; All Rights Reserved
1212
"""
1313

14-
1514
import globalPluginHandler # we are a global plugin
1615
import globalVars
1716
import mathPres # math plugin stuff
@@ -31,13 +30,14 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin):
3130
"""
3231
Global plugin for the MathCAT add-on.
3332
"""
33+
3434
def __init__(self, *args, **kwargs):
3535
"""
36-
Initialize the Global Plugin and add the MathCAT menu.
36+
Initialize the Global Plugin and add the MathCAT menu.
3737
38-
:param args: Additional positional arguments.
39-
:param kwargs: Additional keyword arguments.
40-
"""
38+
:param args: Additional positional arguments.
39+
:param kwargs: Additional keyword arguments.
40+
"""
4141
super().__init__(*args, **kwargs)
4242
# MathCAT.__init__(self)
4343
self.addMathCATMenu()
@@ -54,10 +54,10 @@ def addMathCATMenu(self) -> None:
5454

5555
def onSettings(self, evt: wx.CommandEvent) -> None:
5656
"""
57-
Opens the MathCAT preferences dialog.
57+
Opens the MathCAT preferences dialog.
5858
59-
:param evt: The event that triggered this action.
60-
"""
59+
:param evt: The event that triggered this action.
60+
"""
6161
mainFrame.popupSettingsDialog(UserInterface)
6262

6363
def terminate(self) -> None:

0 commit comments

Comments
 (0)