AddonManager: Fixes for translation

This commit is contained in:
Yorik van Havre
2019-06-17 20:06:32 -03:00
parent 80725ccfdd
commit 8e4be1a67a
3 changed files with 8 additions and 2 deletions

View File

@@ -363,6 +363,7 @@ class CommandAddonManager:
else:
from PySide import QtGui
self.macros.append(macro)
import AddonManager_rc
addonicon = QtGui.QIcon(":/icons/" + macro.name.replace(" ","_") + "_macro_icon.svg")
if addonicon.isNull():
addonicon = QtGui.QIcon(":/icons/applications-python.svg")

View File

@@ -4,4 +4,7 @@
# License LGPL
import AddonManager
import AddonManager_rc
FreeCADGui.addLanguagePath(":/translations")
FreeCADGui.addCommand('Std_AddonMgr', AddonManager.CommandAddonManager())

View File

@@ -81,6 +81,8 @@ def urlopen(url):
"""Opens an url with urllib2"""
timeout = 5
if sys.version_info.major < 3:
import urllib2
else:
@@ -88,9 +90,9 @@ def urlopen(url):
try:
if ssl_ctx:
u = urllib2.urlopen(url, context=ssl_ctx)
u = urllib2.urlopen(url, context=ssl_ctx, timeout=timeout)
else:
u = urllib2.urlopen(url)
u = urllib2.urlopen(url, timeout=timeout)
except:
return None
else: