|
1 | 1 | # -*- coding: UTF-8 -*- |
2 | 2 |
|
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 | +""" |
11 | 13 |
|
12 | 14 |
|
13 | 15 | import globalPluginHandler # we are a global plugin |
|
26 | 28 |
|
27 | 29 |
|
28 | 30 | class GlobalPlugin(globalPluginHandler.GlobalPlugin): |
| 31 | + """ |
| 32 | + Global plugin for the MathCAT add-on. |
| 33 | + """ |
29 | 34 | 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 | + """ |
30 | 41 | super().__init__(*args, **kwargs) |
31 | 42 | # MathCAT.__init__(self) |
32 | 43 | self.addMathCATMenu() |
33 | 44 |
|
34 | 45 | def addMathCATMenu(self) -> None: |
| 46 | + """ |
| 47 | + Adds the MathCAT settings menu to the NVDA preferences. |
| 48 | + """ |
35 | 49 | if not globalVars.appArgs.secure: |
36 | 50 | self.preferencesMenu = mainFrame.sysTrayIcon.preferencesMenu |
37 | 51 | # Translators: this show up in the NVDA preferences dialog. It opens the MathCAT preferences dialog |
38 | 52 | self.settings = self.preferencesMenu.Append(wx.ID_ANY, _("&MathCAT Settings...")) |
39 | 53 | mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onSettings, self.settings) |
40 | 54 |
|
41 | 55 | 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 | + """ |
42 | 61 | mainFrame.popupSettingsDialog(UserInterface) |
43 | 62 |
|
44 | 63 | def terminate(self) -> None: |
| 64 | + """ |
| 65 | + Cleans up by removing the MathCAT menu item upon termination. |
| 66 | + """ |
45 | 67 | try: |
46 | 68 | if not globalVars.appArgs.secure: |
47 | 69 | self.preferencesMenu.Remove(self.settings) |
|
0 commit comments