Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
seanbudd committed Feb 19, 2024
2 parents 421fe4e + f9a4b7e commit 17470b9
Show file tree
Hide file tree
Showing 102 changed files with 6,761 additions and 3,019 deletions.
4 changes: 2 additions & 2 deletions source/NVDAObjects/behaviors.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ def startMonitoring(self):
return
thread = self._monitorThread = threading.Thread(
name=f"{self.__class__.__qualname__}._monitorThread",
target=self._monitor
target=self._monitor,
daemon=True,
)
thread.daemon = True
self._keepMonitoring = True
self._event.clear()
thread.start()
Expand Down
4 changes: 2 additions & 2 deletions source/UIAHandler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,9 @@ def __init__(self):
self.MTAThreadInitException=None
self.MTAThread = threading.Thread(
name=f"{self.__class__.__module__}.{self.__class__.__qualname__}.MTAThread",
target=self.MTAThreadFunc
target=self.MTAThreadFunc,
daemon=True,
)
self.MTAThread.daemon=True
self.MTAThread.start()
self.MTAThreadInitEvent.wait(2)
if self.MTAThreadInitException:
Expand Down
29 changes: 25 additions & 4 deletions source/addonStore/dataManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


addonDataManager: Optional["_DataManager"] = None
FETCH_TIMEOUT_S = 120 # seconds


def initialize():
Expand All @@ -63,6 +64,16 @@ def initialize():
addonDataManager = _DataManager()


def terminate():
global addonDataManager
if config.isAppX:
log.info("Add-ons not supported when running as a Windows Store application")
return
addonDataManager.terminate()
log.debug("terminating addonStore data manager")
addonDataManager = None


class _DataManager:
_cacheLatestFilename: str = "_cachedLatestAddons.json"
_cacheCompatibleFilename: str = "_cachedCompatibleAddons.json"
Expand All @@ -85,15 +96,24 @@ def __init__(self):
self._compatibleAddonCache = self._getCachedAddonData(self._cacheCompatibleFile)
self._installedAddonsCache = _InstalledAddonsCache()
# Fetch available add-ons cache early
threading.Thread(
self._initialiseAvailableAddonsThread = threading.Thread(
target=self.getLatestCompatibleAddons,
name="initialiseAvailableAddons",
).start()
daemon=True,
)
self._initialiseAvailableAddonsThread.start()

def terminate(self):
if self._initialiseAvailableAddonsThread.is_alive():
self._initialiseAvailableAddonsThread.join(timeout=1)
if self._initialiseAvailableAddonsThread.is_alive():
log.debugWarning("initialiseAvailableAddons thread did not terminate immediately")

def _getLatestAddonsDataForVersion(self, apiVersion: str) -> Optional[bytes]:
url = _getAddonStoreURL(self._preferredChannel, self._lang, apiVersion)
try:
response = requests.get(url)
log.debug(f"Fetching add-on data from {url}")
response = requests.get(url, timeout=FETCH_TIMEOUT_S)
except requests.exceptions.RequestException as e:
log.debugWarning(f"Unable to fetch addon data: {e}")
return None
Expand All @@ -108,7 +128,8 @@ def _getLatestAddonsDataForVersion(self, apiVersion: str) -> Optional[bytes]:
def _getCacheHash(self) -> Optional[str]:
url = _getCacheHashURL()
try:
response = requests.get(url)
log.debug(f"Fetching add-on data from {url}")
response = requests.get(url, timeout=FETCH_TIMEOUT_S)
except requests.exceptions.RequestException as e:
log.debugWarning(f"Unable to get cache hash: {e}")
return None
Expand Down
5 changes: 4 additions & 1 deletion source/addonStore/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ def _downloadAddonToPath(
if not NVDAState.shouldWriteToDisk():
return False

with requests.get(addonData.model.URL, stream=True) as r:
# Some add-ons are quite large, so we need to allow for a long download time.
# 1GB at 0.5 MB/s takes 4.5hr to download.
MAX_ADDON_DOWNLOAD_TIME = 60 * 60 * 6 # 6 hours
with requests.get(addonData.model.URL, stream=True, timeout=MAX_ADDON_DOWNLOAD_TIME) as r:
with open(downloadFilePath, 'wb') as fd:
# Most add-ons are small. This value was chosen quite arbitrarily, but with the intention to allow
# interrupting the download. This is particularly important on a slow connection, to provide
Expand Down
7 changes: 5 additions & 2 deletions source/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ def resetConfiguration(factoryDefaults=False):
hwIo.terminate()
log.debug("terminating addonHandler")
addonHandler.terminate()
# Addons
from addonStore import dataManager
log.debug("terminating addon dataManager")
dataManager.terminate()
log.debug("Reloading config")
config.conf.reset(factoryDefaults=factoryDefaults)
logHandler.setLogLevelFromConfig()
Expand All @@ -302,8 +306,6 @@ def resetConfiguration(factoryDefaults=False):
lang = config.conf["general"]["language"]
log.debug("setting language to %s"%lang)
languageHandler.setLanguage(lang)
# Addons
from addonStore import dataManager
dataManager.initialize()
addonHandler.initialize()
# Hardware background i/o
Expand Down Expand Up @@ -927,6 +929,7 @@ def _doPostNvdaStartupAction():
_terminate(bdDetect)
_terminate(hwIo)
_terminate(addonHandler)
_terminate(dataManager, name="addon dataManager")
_terminate(garbageHandler)
# DMP is only started if needed.
# Terminate manually (and let it write to the log if necessary)
Expand Down
7 changes: 6 additions & 1 deletion source/gui/addonStoreGui/viewModels/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,12 @@ def refresh(self):
_StatusFilterKey.AVAILABLE,
_StatusFilterKey.UPDATE,
}:
threading.Thread(target=self._getAvailableAddonsInBG, name="getAddonData").start()
self._refreshAddonsThread = threading.Thread(
target=self._getAvailableAddonsInBG,
name="getAddonData",
daemon=True,
)
self._refreshAddonsThread.start()

elif self._filteredStatusKey in {
_StatusFilterKey.INSTALLED,
Expand Down
7 changes: 5 additions & 2 deletions source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,11 @@ def makeSettings(self, settingsSizer):
if globalVars.appArgs.secure:
item.Disable()
settingsSizerHelper.addItem(item)
# Translators: The label of a checkbox in general settings to toggle allowing of usage stats gathering
item=self.allowUsageStatsCheckBox=wx.CheckBox(self,label=_("Allow the NVDA project to gather NVDA usage statistics"))
item = self.allowUsageStatsCheckBox = wx.CheckBox(
self,
# Translators: The label of a checkbox in general settings to toggle allowing of usage stats gathering
label=_("Allow NV Access to gather NVDA usage statistics")
)
self.bindHelpEvent("GeneralSettingsGatherUsageStats", self.allowUsageStatsCheckBox)
item.Value=config.conf["update"]["allowUsageStats"]
if globalVars.appArgs.secure:
Expand Down
4 changes: 2 additions & 2 deletions source/locale/af_ZA/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Afrikaans\n"
"Language: af_ZA\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/am/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Amharic\n"
"Language: am_ET\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/an/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Aragonese\n"
"Language: an_ES\n"
Expand Down
20 changes: 10 additions & 10 deletions source/locale/ar/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Arabic\n"
"Language: ar_SA\n"
Expand Down Expand Up @@ -2660,12 +2660,12 @@ msgstr "التبديل بين تفعيل وتعطيل نمط التحديد ال
#. Translators: the message when native selection mode is not available in this browse mode document.
#: browseMode.py:2041
msgid "Native selection mode unsupported in this browse mode document"
msgstr ""
msgstr "نمط التحديد الأصلي غير مدعوم في نمط التصفُّح لهذا المستند"

#. Translators: the message when native selection mode cannot be turned off in this browse mode document.
#: browseMode.py:2044
msgid "Native selection mode cannot be turned off in this browse mode document"
msgstr ""
msgstr "لا يمكن تعطيل نمط التحديد الأصلي في نمط التصفُّح لهذا المستند"

#. Translators: the message when native selection mode is not available in this browse mode document.
#: browseMode.py:2053
Expand All @@ -2675,12 +2675,12 @@ msgstr "نمط التحديد المحلي غير متاح في هذا المس
#. Translators: reported when native selection mode is toggled on.
#: browseMode.py:2057
msgid "Native app selection mode enabled"
msgstr ""
msgstr "تفعيل نمط التحديد الأصلي الخاص بالتطبيق"

#. Translators: reported when native selection mode is toggled off.
#: browseMode.py:2065
msgid "Native app selection mode disabled"
msgstr ""
msgstr "تعطيل نمط التحديد الأصلي الخاص بالتطبيق"

#. Translators: The level at which the given symbol will be spoken.
#: characterProcessing.py:157
Expand Down Expand Up @@ -7464,7 +7464,7 @@ msgstr "رسالة من البرنامج"
#. Translators: reported when unable to display a browsable message.
#: ui.py:119
msgid "Unable to display browseable message"
msgstr ""
msgstr "يتعذّر عرض رسالة قابلة للتصفُّح"

#. Translators: Spoken instead of a lengthy text when copied to clipboard.
#. Translators: This is spoken when the user has selected a large portion of text.
Expand Down Expand Up @@ -7592,7 +7592,7 @@ msgstr "تعذر تأجيل التحديث."
#. Translators: The title of the dialog displayed while downloading an NVDA update.
#: updateCheck.py:606
msgid "Downloading Update"
msgstr "تحميل التحديثات"
msgstr "تنزيل التحديثات"

#. Translators: The progress message indicating that a connection is being established.
#: updateCheck.py:608
Expand Down Expand Up @@ -7816,7 +7816,7 @@ msgstr "قيد الإزالة"
#: addonStore\models\status.py:87
msgctxt "addonStore"
msgid "Available"
msgstr "المتوفرة"
msgstr "متاحة"

#. Translators: Status for addons shown in the add-on store dialog
#: addonStore\models\status.py:89
Expand All @@ -7840,7 +7840,7 @@ msgstr "الانتقال لمستودع الإضافات"
#: addonStore\models\status.py:95
msgctxt "addonStore"
msgid "Incompatible"
msgstr "غير المتوافقة"
msgstr "غير متوافقة"

#. Translators: Status for addons shown in the add-on store dialog
#: addonStore\models\status.py:97
Expand Down
4 changes: 2 additions & 2 deletions source/locale/bg/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Bulgarian\n"
"Language: bg_BG\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/bn/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Bengali\n"
"Language: bn_BD\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/ca/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Catalan\n"
"Language: ca_ES\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/ckb/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Sorani (Kurdish)\n"
"Language: ckb_IR\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/cs/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Czech\n"
"Language: cs_CZ\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/da/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Danish\n"
"Language: da_DK\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/de/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: German\n"
"Language: de_DE\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/de_CH/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: German, Switzerland\n"
"Language: de_CH\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/el/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Greek\n"
"Language: el_GR\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/es/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Spanish\n"
"Language: es_ES\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/es_CO/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Spanish, Colombia\n"
"Language: es_CO\n"
Expand Down
4 changes: 2 additions & 2 deletions source/locale/fa/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: nvda\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-09 02:00+0000\n"
"PO-Revision-Date: 2024-02-11 22:51\n"
"POT-Creation-Date: 2024-02-18 21:46+0000\n"
"PO-Revision-Date: 2024-02-18 23:13\n"
"Last-Translator: \n"
"Language-Team: Persian\n"
"Language: fa_IR\n"
Expand Down
Loading

0 comments on commit 17470b9

Please sign in to comment.