Skip to content

Commit

Permalink
Annotations: annotate containers with no type information. Re #155.
Browse files Browse the repository at this point in the history
Mypy: annotate containers with no type information such as dictionaries and lists. This applies to both module-level and class attributes.
  • Loading branch information
josephsl committed Jan 23, 2021
1 parent 6e0d590 commit 125e541
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion addon/appModules/splcreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def isPlaylistEditor(self):
SPLEditorDateTime = 0
SPLEditorDuration = 1
SPLEditorStatusBar = 2
_playlistEditorStatusCache = {}
_playlistEditorStatusCache: dict[int, Any] = {}

@scriptHandler.script(gesture="kb:alt+NVDA+1")
def script_playlistDateTime(self, gesture):
Expand Down
2 changes: 1 addition & 1 deletion addon/appModules/splengine/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# Use a thread to monitor status changes for encoders.
SPLBackgroundMonitor = set()
# A collection of encoder status monitor threads.
SPLBackgroundMonitorThreads = {}
SPLBackgroundMonitorThreads: dict[str, threading.Thread] = {}
# Do not play connection tone while an encoder is connecting.
SPLNoConnectionTone = set()
# Stop announcing connection status messages when an error is encountered.
Expand Down
2 changes: 1 addition & 1 deletion addon/appModules/splremotevt.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
# Playlist editor is same as Creator except it responds a bit faster.
# Without keeping a copy of status cache, NVDA will announce wrong values
# as Creator app module's cache will be used.
_playlistEditorStatusCache = {}
_playlistEditorStatusCache: dict[int, Any] = {}
6 changes: 3 additions & 3 deletions addon/appModules/splstudio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def new(*args, **kwargs):
libScanT = None

# Versions of Studio where library scanning functionality is broken.
noLibScanMonitor = []
noLibScanMonitor: list[str] = []


# Braille and play a sound in response to an alarm or an event.
Expand Down Expand Up @@ -1563,7 +1563,7 @@ def script_timeRangeFinder(self, gesture):
# Cart explorer
cartExplorer = False
# The carts dictionary (key = cart gesture, item = cart name).
carts = {}
carts: dict[str, Any] = {}

# Assigning and building carts.

Expand Down Expand Up @@ -2227,7 +2227,7 @@ def script_SPLAssistantToggle(self, gesture):
SPLTemperature: [7, 0], # Temperature for the current city.
}

_cachedStatusObjs = {}
_cachedStatusObjs: dict[int, Any] = {}

# Called in the layer commands themselves.
# 16.11: in Studio 5.20, it is possible to obtain some of these via the API, hence the API method is used.
Expand Down
2 changes: 1 addition & 1 deletion addon/appModules/splstudio/splconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# Cache a copy of the loaded config.
# This comes in handy when saving configuration to disk. For the most part, no change occurs to config.
# This helps prolong life of a solid-state drive (preventing unnecessary writes).
_SPLCache = {}
_SPLCache: dict[Optional[str], dict[Any, Any]] = {}
# The following settings can be changed in profiles:
_mutatableSettings = ("IntroOutroAlarms", "MicrophoneAlarm", "MetadataStreaming", "ColumnAnnouncement")
# 7.0: Profile-specific confspec (might be removed once a more optimal way to validate sections is found).
Expand Down

0 comments on commit 125e541

Please sign in to comment.