-
-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathcreateIcons.py
More file actions
executable file
·26 lines (23 loc) · 853 Bytes
/
createIcons.py
File metadata and controls
executable file
·26 lines (23 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/python3
import sys
from pathlib import Path
here=str(Path(sys.argv[0]).parent)
if here: sys.path.append(here)
else: sys.path.append('.')
from pyminsky import minsky
iconDir=here+'/gui-js/apps/minsky-web/src/assets/images/icons/'
minsky.histogramResource.setResource(iconDir+'histogram.svg')
# make the background transparent
minsky.canvas.backgroundColour({'a':0})
ops=minsky.availableOperations()()
ops.append("switch")
for op in ops:
# ignore some operations
if op in ["numOps","constant","copy","data","ravel","integrate"]: continue
if op=="switch": minsky.canvas.addSwitch()
else: minsky.canvas.addOperation(op)
if op=="userFunction":
#default label too large for a button label
minsky.canvas.itemFocus.description('f(x,y)')
minsky.renderCanvasToPNG(iconDir+op+'.png')
minsky.clearAllMaps()