From 4b9ee4d1feda617f8762188b6feaa04d3bdd7c57 Mon Sep 17 00:00:00 2001 From: "St.Huang" Date: Mon, 30 Jul 2018 22:27:02 +0800 Subject: [PATCH] updater bug fixes. --- addons21/fastwq/libs/ankihub.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons21/fastwq/libs/ankihub.py b/addons21/fastwq/libs/ankihub.py index 05fdcf0..c9f7d43 100644 --- a/addons21/fastwq/libs/ankihub.py +++ b/addons21/fastwq/libs/ankihub.py @@ -109,7 +109,7 @@ class DialogUpdates(QDialog, Ui_DialogUpdates): def installZipFile(data, fname): - base = mw.pm.addonFolder()#os.path.join(defaultBase(),'addons') + base = os.path.join(mw.pm.addonFolder(), 'fastwq') if fname.endswith(".py"): path = os.path.join(base, fname) with open(path, "wb") as file: @@ -149,8 +149,8 @@ def updateSingle(repositories,path,data): p, fname = os.path.split(code) response = urllib2.urlopen(code) meta = response.info() - file_size = int(meta.getheaders("Content-Length")[0]) - d = buffer('') + file_size = int(meta.get("Content-Length")) + d = b'' dl = 0 i = 0 lastPercent = None