Skip to content

Commit e1aed55

Browse files
committed
docstrings for __init__.py
1 parent cfe7340 commit e1aed55

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

addon/globalPlugins/MathCAT/__init__.py

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# -*- coding: UTF-8 -*-
22

3-
# MathCAT add-on: generates speech, braille, and allows exploration of expressions written in MathML
4-
# The goal of this add-on is to replicate/improve upon the functionality of MathPlayer which has been discontinued.
5-
# Author: Neil Soiffer
6-
# Copyright: this file is copyright GPL2
7-
# The code additionally makes use of the MathCAT library (written in Rust) which is covered by the MIT license
8-
# and also (obviously) requires external speech engines and braille drivers.
9-
# The plugin also requires the use of a small python dll: python3.dll
10-
# python3.dll has "Copyright © 2001-2022 Python Software Foundation; All Rights Reserved"
3+
"""
4+
MathCAT add-on: generates speech, braille, and allows exploration of expressions written in MathML.
5+
The goal of this add-on is to replicate/improve upon the functionality of MathPlayer which has been discontinued.
6+
Author: Neil Soiffer
7+
Copyright: this file is copyright GPL2
8+
The code additionally makes use of the MathCAT library (written in Rust) which is covered by the MIT license
9+
and also (obviously) requires external speech engines and braille drivers.
10+
The plugin also requires the use of a small python dll: python3.dll
11+
python3.dll has "Copyright © 2001-2022 Python Software Foundation; All Rights Reserved
12+
"""
1113

1214

1315
import globalPluginHandler # we are a global plugin
@@ -26,22 +28,42 @@
2628

2729

2830
class GlobalPlugin(globalPluginHandler.GlobalPlugin):
31+
"""
32+
Global plugin for the MathCAT add-on.
33+
"""
2934
def __init__(self, *args, **kwargs):
35+
"""
36+
Initialize the Global Plugin and add the MathCAT menu.
37+
38+
:param args: Additional positional arguments.
39+
:param kwargs: Additional keyword arguments.
40+
"""
3041
super().__init__(*args, **kwargs)
3142
# MathCAT.__init__(self)
3243
self.addMathCATMenu()
3344

3445
def addMathCATMenu(self) -> None:
46+
"""
47+
Adds the MathCAT settings menu to the NVDA preferences.
48+
"""
3549
if not globalVars.appArgs.secure:
3650
self.preferencesMenu = mainFrame.sysTrayIcon.preferencesMenu
3751
# Translators: this show up in the NVDA preferences dialog. It opens the MathCAT preferences dialog
3852
self.settings = self.preferencesMenu.Append(wx.ID_ANY, _("&MathCAT Settings..."))
3953
mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onSettings, self.settings)
4054

4155
def onSettings(self, evt: wx.CommandEvent) -> None:
56+
"""
57+
Opens the MathCAT preferences dialog.
58+
59+
:param evt: The event that triggered this action.
60+
"""
4261
mainFrame.popupSettingsDialog(UserInterface)
4362

4463
def terminate(self) -> None:
64+
"""
65+
Cleans up by removing the MathCAT menu item upon termination.
66+
"""
4567
try:
4668
if not globalVars.appArgs.secure:
4769
self.preferencesMenu.Remove(self.settings)

0 commit comments

Comments
 (0)