Пример #1
0
	def refreshAddonsList(self,activeIndex=0):
		self.addonsList.DeleteAllItems()
		self.curAddons=[]
		for idx, addon in enumerate(self.unknownCompatibilityAddonsList):
			self.addonsList.Append((
				"",  # check box field
				addon.manifest['summary'],
				addon.version,
				addon.manifest.get('lastTestedNVDAVersion') or
				# Translators: Displayed for add-ons in the incompatible add-ons dialog
				# if the last tested NVDA version is not specified.
				_("not specified")
			))
			compatValue = AddonCompatibilityState.getAddonCompatibility(addon, CURRENT_NVDA_VERSION)
			shouldCheck = compatValue == compatValues.MANUALLY_SET_COMPATIBLE
			self.addonsList.CheckItem(idx, check=shouldCheck)
		# select the given active addon, the last addon (after an addon is installed), or the first addon if not given
		curAddonsLen=len(self.unknownCompatibilityAddonsList)
		if curAddonsLen>0:  # No addons to select
			if activeIndex==-1:  # Special value, select last addon (newly installed)
				activeIndex=curAddonsLen-1
			elif activeIndex<0 or activeIndex>=curAddonsLen:  # Index invalid, select first addon.
				activeIndex=0
			self.addonsList.Select(activeIndex,on=1)
			self.addonsList.SetItemState(activeIndex,wx.LIST_STATE_FOCUSED,wx.LIST_STATE_FOCUSED)
Пример #2
0
 def refreshAddonsList(self, activeIndex=0):
     self.addonsList.DeleteAllItems()
     self.curAddons = []
     for idx, addon in enumerate(self.unknownCompatibilityAddonsList):
         self.addonsList.Append((
             "",  # check box field
             addon.manifest['summary'],
             addon.version,
             addon.manifest.get('lastTestedNVDAVersion') or
             # Translators: Displayed for add-ons in the incompatible add-ons dialog
             # if the last tested NVDA version is not specified.
             _("not specified")))
         compatValue = AddonCompatibilityState.getAddonCompatibility(
             addon, CURRENT_NVDA_VERSION)
         shouldCheck = compatValue == compatValues.MANUALLY_SET_COMPATIBLE
         self.addonsList.CheckItem(idx, check=shouldCheck)
     # select the given active addon, the last addon (after an addon is installed), or the first addon if not given
     curAddonsLen = len(self.unknownCompatibilityAddonsList)
     if curAddonsLen > 0:  # No addons to select
         if activeIndex == -1:  # Special value, select last addon (newly installed)
             activeIndex = curAddonsLen - 1
         elif activeIndex < 0 or activeIndex >= curAddonsLen:  # Index invalid, select first addon.
             activeIndex = 0
         self.addonsList.Select(activeIndex, on=1)
         self.addonsList.SetItemState(activeIndex, wx.LIST_STATE_FOCUSED,
                                      wx.LIST_STATE_FOCUSED)
Пример #3
0
 def test_getAddonCompatibility_stateUnknown_incompatible(self):
     addonNotSupported = mockAddon(minNVDAVersion=NextNVDAVersionString)
     self.resetMockStateSaver(addonNotSupported, compatValues.UNKNOWN)
     compat = AddonCompatibilityState.getAddonCompatibility(
         addonNotSupported, CurrentNVDAVersionTuple)
     self.assertCompatValuesMatch(compat,
                                  compatValues.AUTO_DEDUCED_INCOMPATIBLE)
Пример #4
0
 def test_getAddonCompatibility_noState_testedNotSupported_incompatible(
         self):
     addonNotSupported = mockAddon(minNVDAVersion=NextNVDAVersionString)
     compat = AddonCompatibilityState.getAddonCompatibility(
         addonNotSupported, CurrentNVDAVersionTuple)
     self.assertCompatValuesMatch(compat,
                                  compatValues.AUTO_DEDUCED_INCOMPATIBLE)
Пример #5
0
 def test_getAddonCompatibility_stateUnknown_testedAndSupported_compatible(
         self):
     compatibleAddon = mockAddon()
     self.resetMockStateSaver(compatibleAddon, compatValues.UNKNOWN)
     compat = AddonCompatibilityState.getAddonCompatibility(
         compatibleAddon, CurrentNVDAVersionTuple)
     self.assertCompatValuesMatch(compat,
                                  compatValues.AUTO_DEDUCED_COMPATIBLE)
Пример #6
0
 def test_getAddonCompatibility_whiteListed_compatible(self):
     compatibleAddon = mockAddon()
     self.resetMockStateSaver(compatibleAddon,
                              compatValues.MANUALLY_SET_COMPATIBLE)
     compat = AddonCompatibilityState.getAddonCompatibility(
         compatibleAddon, CurrentNVDAVersionTuple)
     self.assertCompatValuesMatch(
         compat, compatValues.AUTO_DEDUCED_COMPATIBLE
     )  # auto deduced compat trumps manual set compat
Пример #7
0
 def test_getAddonCompatibility_blackListed_untestedWithSupport_manuallySetIncompatible(
         self):
     notTestedAddon = mockAddon(lastTestedNVDAVersion=LastNVDAVersionString)
     self.resetMockStateSaver(notTestedAddon,
                              compatValues.MANUALLY_SET_INCOMPATIBLE)
     compat = AddonCompatibilityState.getAddonCompatibility(
         notTestedAddon, CurrentNVDAVersionTuple)
     self.assertCompatValuesMatch(compat,
                                  compatValues.MANUALLY_SET_INCOMPATIBLE)
Пример #8
0
 def test_getAddonCompatibility_blackListed_testedWithoutSupport_incompatible(
         self):
     addonNotSupported = mockAddon(minNVDAVersion=NextNVDAVersionString)
     self.resetMockStateSaver(addonNotSupported,
                              compatValues.MANUALLY_SET_INCOMPATIBLE)
     compat = AddonCompatibilityState.getAddonCompatibility(
         addonNotSupported, CurrentNVDAVersionTuple)
     self.assertCompatValuesMatch(
         compat, compatValues.AUTO_DEDUCED_INCOMPATIBLE
     )  # auto deduced incompt trumps manual set incompat
Пример #9
0
 def test_getAddonCompatibility_stateUnknown_unknown(self):
     notTestedAddon = mockAddon(lastTestedNVDAVersion=LastNVDAVersionString)
     self.resetMockStateSaver(notTestedAddon, compatValues.UNKNOWN)
     compat = AddonCompatibilityState.getAddonCompatibility(
         notTestedAddon, CurrentNVDAVersionTuple)
     self.assertCompatValuesMatch(compat, compatValues.UNKNOWN)
Пример #10
0
 def test_getAddonCompatibility_noState_notTestedWithSupport_unknown(self):
     notTestedAddon = mockAddon(lastTestedNVDAVersion=LastNVDAVersionString)
     compat = AddonCompatibilityState.getAddonCompatibility(
         notTestedAddon, CurrentNVDAVersionTuple)
     self.assertCompatValuesMatch(compat, compatValues.UNKNOWN)
Пример #11
0
	def test_getAddonCompatibility_noState_notTestedWithSupport_unknown(self):
		notTestedAddon = mockAddon(lastTestedNVDAVersion=LastNVDAVersionString)
		compat = AddonCompatibilityState.getAddonCompatibility(notTestedAddon, CurrentNVDAVersionTuple)
		self.assertCompatValuesMatch(compat, compatValues.UNKNOWN)
Пример #12
0
	def test_getAddonCompatibility_noState_testedAndSupported_compatible(self):
		compatibleAddon = mockAddon()
		compat = AddonCompatibilityState.getAddonCompatibility(compatibleAddon, CurrentNVDAVersionTuple)
		self.assertCompatValuesMatch(compat, compatValues.AUTO_DEDUCED_COMPATIBLE)
Пример #13
0
	def test_getAddonCompatibility_blackListed_testedWithoutSupport_incompatible(self):
		addonNotSupported = mockAddon(minNVDAVersion=NextNVDAVersionString)
		self.resetMockStateSaver(addonNotSupported, compatValues.MANUALLY_SET_INCOMPATIBLE)
		compat = AddonCompatibilityState.getAddonCompatibility(addonNotSupported, CurrentNVDAVersionTuple)
		self.assertCompatValuesMatch(compat, compatValues.AUTO_DEDUCED_INCOMPATIBLE)  # auto deduced incompt trumps manual set incompat
Пример #14
0
	def test_getAddonCompatibility_blackListed_untestedWithSupport_manuallySetIncompatible(self):
		notTestedAddon = mockAddon(lastTestedNVDAVersion=LastNVDAVersionString)
		self.resetMockStateSaver(notTestedAddon, compatValues.MANUALLY_SET_INCOMPATIBLE)
		compat = AddonCompatibilityState.getAddonCompatibility(notTestedAddon, CurrentNVDAVersionTuple)
		self.assertCompatValuesMatch(compat, compatValues.MANUALLY_SET_INCOMPATIBLE)
Пример #15
0
	def test_getAddonCompatibility_blackListed_testedWithSupport_compatible(self):
		compatibleAddon = mockAddon()
		self.resetMockStateSaver(compatibleAddon, compatValues.MANUALLY_SET_INCOMPATIBLE)
		compat = AddonCompatibilityState.getAddonCompatibility(compatibleAddon, CurrentNVDAVersionTuple)
		self.assertCompatValuesMatch(compat, compatValues.AUTO_DEDUCED_COMPATIBLE)  # auto deduced compat trumps manual set incompat
Пример #16
0
	def test_getAddonCompatibility_stateUnknown_unknown(self):
		notTestedAddon = mockAddon(lastTestedNVDAVersion=LastNVDAVersionString)
		self.resetMockStateSaver(notTestedAddon, compatValues.UNKNOWN)
		compat = AddonCompatibilityState.getAddonCompatibility(notTestedAddon, CurrentNVDAVersionTuple)
		self.assertCompatValuesMatch(compat, compatValues.UNKNOWN)
Пример #17
0
	def test_getAddonCompatibility_stateUnknown_incompatible(self):
		addonNotSupported = mockAddon(minNVDAVersion=NextNVDAVersionString)
		self.resetMockStateSaver(addonNotSupported, compatValues.UNKNOWN)
		compat = AddonCompatibilityState.getAddonCompatibility(addonNotSupported, CurrentNVDAVersionTuple)
		self.assertCompatValuesMatch(compat, compatValues.AUTO_DEDUCED_INCOMPATIBLE)
Пример #18
0
	def test_getAddonCompatibility_stateUnknown_testedAndSupported_compatible(self):
		compatibleAddon = mockAddon()
		self.resetMockStateSaver(compatibleAddon, compatValues.UNKNOWN)
		compat = AddonCompatibilityState.getAddonCompatibility(compatibleAddon, CurrentNVDAVersionTuple)
		self.assertCompatValuesMatch(compat, compatValues.AUTO_DEDUCED_COMPATIBLE)
Пример #19
0
 def test_getAddonCompatibility_noState_testedAndSupported_compatible(self):
     compatibleAddon = mockAddon()
     compat = AddonCompatibilityState.getAddonCompatibility(
         compatibleAddon, CurrentNVDAVersionTuple)
     self.assertCompatValuesMatch(compat,
                                  compatValues.AUTO_DEDUCED_COMPATIBLE)
Пример #20
0
	def test_getAddonCompatibility_noState_notTestedNotSupported_incompatible(self):
		addonNotSupported = mockAddon(minNVDAVersion=NextNVDAVersionString, lastTestedNVDAVersion=LastNVDAVersionString)
		compat = AddonCompatibilityState.getAddonCompatibility(addonNotSupported, CurrentNVDAVersionTuple)
		self.assertCompatValuesMatch(compat, compatValues.AUTO_DEDUCED_INCOMPATIBLE)