You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/updateCheck.py
+19-7Lines changed: 19 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,17 @@
1
1
# A part of NonVisual Desktop Access (NVDA)
2
2
# This file is covered by the GNU General Public License.
3
3
# See the file COPYING for more details.
4
-
# Copyright (C) 2012-2021 NV Access Limited, Zahari Yurukov, Babbage B.V., Joseph Lee
4
+
# Copyright (C) 2012-2023 NV Access Limited, Zahari Yurukov, Babbage B.V., Joseph Lee
5
5
6
6
"""Update checking functionality.
7
7
@note: This module may raise C{RuntimeError} on import if update checking for this build is not supported.
8
8
"""
9
-
fromtypingimportDict, Optional, Tuple
9
+
fromtypingimport (
10
+
Any,
11
+
Dict,
12
+
Optional,
13
+
Tuple,
14
+
)
10
15
importgarbageHandler
11
16
importglobalVars
12
17
importconfig
@@ -68,12 +73,12 @@
68
73
log.debugWarning("Default download path for updates %s could not be created."%storeUpdatesDir)
69
74
70
75
#: Persistent state information.
71
-
#: @type: dict
72
-
state=None
73
-
_stateFileName=None
76
+
state: Optional[Dict[str, Any]] =None
77
+
_stateFilename: Optional[str] =None
74
78
#: The single instance of L{AutoUpdateChecker} if automatic update checking is enabled,
75
79
#: C{None} if it is disabled.
76
-
autoChecker=None
80
+
autoChecker: Optional["AutoUpdateChecker"] =None
81
+
77
82
78
83
defgetQualifiedDriverClassNameForStats(cls):
79
84
""" fetches the name from a given synthDriver or brailleDisplay class, and appends core for in-built code, the add-on name for code from an add-on, or external for code in the NVDA user profile.
@@ -250,6 +255,7 @@ def check(self):
250
255
251
256
def_bg(self):
252
257
try:
258
+
assertstateisnotNone
253
259
info=checkForUpdate(self.AUTO)
254
260
except:
255
261
log.debugWarning("Error checking for update", exc_info=True)
0 commit comments