Skip to content

Commit

Permalink
try to repair add-on manager
Browse files Browse the repository at this point in the history
  • Loading branch information
looooo authored and wwmayer committed May 15, 2017
1 parent fa00b4f commit 869e42e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Mod/AddonManager/AddonManager.py
Expand Up @@ -309,7 +309,7 @@ def run(self):
self.progressbar_show.emit(True)
u = urllib2.urlopen("https://github.com/FreeCAD/FreeCAD-addons")
p = u.read()
if isinstance(p, bytes):
if sys.version_info.major >= 3 and isinstance(p, bytes):
p = p.decode("utf-8")
u.close()
p = p.replace("\n"," ")
Expand Down Expand Up @@ -353,7 +353,7 @@ def run(self):
url = repo[1]
u = urllib2.urlopen(url)
p = u.read()
if isinstance(p, bytes):
if sys.version_info.major >= 3 and isinstance(p, bytes):
p = p.decode("utf-8")
u.close()
desc = re.findall("<meta name=\"description\" content=\"(.*?)\">",p)
Expand Down Expand Up @@ -383,7 +383,7 @@ def run(self):
macropath = FreeCAD.ParamGet('User parameter:BaseApp/Preferences/Macro').GetString("MacroPath",os.path.join(FreeCAD.ConfigGet("UserAppData"),"Macro"))
u = urllib2.urlopen("http://www.freecadweb.org/wiki/Macros_recipes")
p = u.read()
if isinstance(p, bytes):
if sys.version_info.major >= 3 and isinstance(p, bytes):
p = p.decode("utf-8")
u.close()
macros = re.findall("title=\"(Macro.*?)\"",p)
Expand Down Expand Up @@ -425,7 +425,7 @@ def run(self):
self.info_label.emit(translate("AddonsInstaller", "Retrieving info from ") + str(url))
u = urllib2.urlopen(url)
p = u.read()
if isinstance(p, bytes):
if sys.version_info.major >= 3 and isinstance(p, bytes):
p = p.decode("utf-8")
u.close()
desc = re.findall("<meta name=\"description\" content=\"(.*?)\">",p)
Expand Down Expand Up @@ -469,7 +469,7 @@ def run(self):
self.info_label.emit("Retrieving info from " + str(url))
u = urllib2.urlopen(url)
p = u.read()
if isinstance(p, bytes):
if sys.version_info.major >= 3 and isinstance(p, bytes):
p = p.decode("utf-8")
u.close()
code = re.findall("<pre>(.*?)<\/pre>",p.replace("\n","--endl--"))
Expand Down Expand Up @@ -528,7 +528,7 @@ def run(self):
self.info_label.emit("python-git not found.")
FreeCAD.Console.PrintWarning(translate("AddonsInstaller","python-git not found. Using standard download instead.\n"))
try:
import zipfile,StringIO
import zipfile,io
except:
self.info_label.emit("no zip support.")
FreeCAD.Console.PrintError(translate("AddonsInstaller","Your version of python doesn't appear to support ZIP files. Unable to proceed.\n"))
Expand Down

0 comments on commit 869e42e

Please sign in to comment.