From aa5b956e5000b4138c92a967fc6092f190436d8d Mon Sep 17 00:00:00 2001 From: SeanTolstoyevski Date: Wed, 22 Apr 2020 16:33:18 -0700 Subject: [PATCH] bug fixed and convert \r\n to \n --- .../Unspoken/nvdaaddonupdater/__init__.py | 2 +- .../Unspoken/nvdaaddonupdater/callafter.py | 2 +- .../nvdaaddonupdater/nvdaaddonupdater.py | 20 +++++-------------- .../globalPlugins/Unspoken_docHandler.py | 7 +------ addonSource/manifest.ini | 2 +- 5 files changed, 9 insertions(+), 24 deletions(-) diff --git a/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/__init__.py b/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/__init__.py index a6e3207..ea1492a 100644 --- a/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/__init__.py +++ b/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/__init__.py @@ -1 +1 @@ -from nvdaaddonupdater import * +from .nvdaaddonupdater import * \ No newline at end of file diff --git a/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/callafter.py b/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/callafter.py index 5cf3ced..8577470 100644 --- a/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/callafter.py +++ b/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/callafter.py @@ -9,7 +9,7 @@ def call_after_and_block(func, *args, **kwargs): def wrapper(): try: event.result = func(*args, **kwargs) - except Exception, e: + except Exception as e: event.exception = e finally: event.set() diff --git a/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/nvdaaddonupdater.py b/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/nvdaaddonupdater.py index 3cca8db..ce62334 100644 --- a/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/nvdaaddonupdater.py +++ b/addonSource/globalPlugins/Unspoken/nvdaaddonupdater/nvdaaddonupdater.py @@ -1,16 +1,6 @@ -# Automatically update an NVDA add on. -# By Bryan Smart (bryansmart@bryansmart.com) - -import os -import threading -import urllib -import tempfile - -import gui - -import wx - -from callafter import * +import os, threading, tempfile, gui, wx +import urllib.request, urllib.parse, urllib.error +from .callafter import * class NVDAAddOnUpdater (object): @@ -26,7 +16,7 @@ def __init__ (self, add_on_name, update_url, current_version): def check_update(self): # Retrieve current version number. try: - f = urllib.urlopen(self._update_url + '/version') + f = urllib.request.urlopen(self._update_url + '/version') except: # If Internet unavailable, silently fail. return @@ -55,7 +45,7 @@ def check_update(self): def force_update(self): # Open connection to download update. try: - remote_file = urllib.urlopen(self._update_url + '/install') + remote_file = urllib.request.urlopen(self._update_url + '/install') except: gui.messageBox("Unable to connect to update server!", style=wx.ICON_ERROR) return diff --git a/addonSource/globalPlugins/Unspoken_docHandler.py b/addonSource/globalPlugins/Unspoken_docHandler.py index 9fd3af2..3798bbd 100644 --- a/addonSource/globalPlugins/Unspoken_docHandler.py +++ b/addonSource/globalPlugins/Unspoken_docHandler.py @@ -1,8 +1,3 @@ -# -*- coding: UTF-8 -*- - -# docHandler: module for managing addons documentation -# See: http://community.nvda-project.org/ticket/2694 - import os import languageHandler import addonHandler @@ -55,7 +50,7 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin): def __init__(self): super(globalPluginHandler.GlobalPlugin, self).__init__() self.help = gui.mainFrame.sysTrayIcon.helpMenu - self.helpItem = self.help.Append(wx.ID_ANY, u"{summary} {version}".format(summary=_addonSummary, version=_addonVersion), _addonName) + self.helpItem = self.help.Append(wx.ID_ANY, "{summary} {version}".format(summary=_addonSummary, version=_addonVersion), _addonName) gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onHelp, self.helpItem) def onHelp(self, evt): diff --git a/addonSource/manifest.ini b/addonSource/manifest.ini index 7ffd1f3..548c71d 100644 --- a/addonSource/manifest.ini +++ b/addonSource/manifest.ini @@ -3,6 +3,6 @@ summary = "Unspoken 3D Audio" description = """Adds 3D audio for controls and replaces control messages.""" author = "Camlorn , Bryan Smart, SeanTolstoyevski " url = None -version = 0.1b +version = 0.2b minimumNVDAVersion = 2019.3 lastTestedNVDAVersion = 2020.1