Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 434838c

Browse files
hkielOpenModelica-Hudson
authored andcommitted
fix SVG generation script for Python3
Belonging to [master]: - #2839
1 parent 7140453 commit 434838c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Examples/generate_icons.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def getGraphicsForClass(modelicaClass):
295295
fname = os.path.join(baseDir, g[8].strip('"'))
296296
if os.path.exists(fname):
297297
with open(fname, "rb") as f_p:
298-
graphicsObj['href'] = "data:image;base64,"+base64.b64encode(f_p.read())
298+
graphicsObj['href'] = "data:image;base64,"+str(base64.b64encode(f_p.read()))
299299
else:
300300
logger.error("Could not find bitmap file {0}".format(g[8]))
301301
graphicsObj['href'] = g[8].strip('"')
@@ -998,7 +998,7 @@ def getSvgFromGraphics(dwg, graphics, minX, maxY, includeInvisibleText, transfor
998998
]
999999

10001000
for (stopValue, idx) in stopValues:
1001-
gradient.add_stop_color(offset=stopValue, color='rgb({0}, {1}, {2})'.format(colors[idx][0], colors[idx][1], colors[idx][2]), opacity=1)
1001+
gradient.add_stop_color(offset=stopValue, color='rgb({0}, {1}, {2})'.format(int(colors[idx][0]), int(colors[idx][1]), int(colors[idx][2])), opacity=1)
10021002

10031003
definitions.add(gradient)
10041004
elif graphics['type'] == 'Rectangle':

0 commit comments

Comments
 (0)