Merge branch '2.1' into 2.2

# Conflicts:
#	gns3server/version.py
#	requirements.txt
This commit is contained in:
grossmj committed 2018-06-10 21:19:55 +07:00
commit 96d5e351f7
235 files changed
+3037 -864

No files matched your search

+1 -1
View File
@@ -158,7 +158,7 @@ def md5sum(path, stopped_event=None):
try:
with open(path + '.md5sum') as f:
md5 = f.read()
md5 = f.read().strip()
if len(md5) == 32:
return md5
# Unicode error is when user rename an image to .md5sum ....
+10 -4
View File
@@ -103,10 +103,16 @@ def get_size(data, default_width=0, default_height=0):
root = tree.getroot()
try:
width = _svg_convert_size(root.attrib.get("width", "0"))
height = _svg_convert_size(root.attrib.get("height", "0"))
except IndexError:
raise ValueError("Invalid SVG file")
width_attr = root.attrib.get("width", "0")
height_attr = root.attrib.get("height", "0")
if width_attr.endswith("%") or height_attr.endswith("%"):
# check to viewBox attribute if width or height value is a percentage
_, _, width_attr, height_attr = root.attrib.get("viewBox").split()
else:
width = _svg_convert_size(width_attr)
height = _svg_convert_size(height_attr)
except (AttributeError, IndexError) as e:
raise ValueError("Invalid SVG file: {}".format(e))
return width, height, filetype