1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Fix KeyError: 'color' when converting some 1.3 topologies

Fix #837
This commit is contained in:
Julien Duponchelle 2016-12-15 16:52:01 +01:00
parent f3e9917479
commit b79235afb7
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -370,7 +370,7 @@ def _convert_1_3_later(topo, topo_path):
height=int(font_info[1]) * 2, height=int(font_info[1]) * 2,
width=int(font_info[1]) * len(note["text"]), width=int(font_info[1]) * len(note["text"]),
fill="#" + note["color"][-6:], fill="#" + note["color"][-6:],
opacity=round(1.0 / 255 * int(note["color"][:3][-2:], base=16), 2), # Extract the alpha channel from the hexa version opacity=round(1.0 / 255 * int(note.get("color", "#ffffffff")[:3][-2:], base=16), 2), # Extract the alpha channel from the hexa version
family=font_info[0], family=font_info[0],
size=int(font_info[1]), size=int(font_info[1]),
weight=weight, weight=weight,