Minsky: 3.17.0
createIcons.py
Go to the documentation of this file.
1 #!/usr/bin/python3
2 import sys
3 from pathlib import Path
4 here=str(Path(sys.argv[0]).parent)
5 if here: sys.path.append(here)
6 else: sys.path.append('.')
7 
8 from pyminsky import minsky
9 
10 iconDir=here+'/gui-js/apps/minsky-web/src/assets/images/icons/'
11 minsky.histogramResource.setResource(iconDir+'histogram.svg')
12 # make the background transparent
13 minsky.canvas.backgroundColour({'a':0})
14 ops=minsky.availableOperations()
15 ops.append("switch")
16 for op in ops:
17  # ignore some operations
18  if op in ["numOps","constant","copy","data","ravel","integrate"]: continue
19 
20  if op=="switch": minsky.canvas.addSwitch()
21  else: minsky.canvas.addOperation(op)
22  if op=="userFunction":
23  #default label too large for a button label
24  minsky.canvas.itemFocus().description('f(x,y)')
25  minsky.renderCanvasToPNG(iconDir+op+'.png')
26  minsky.clearAllMaps()
std::string str(T x)
utility function to create a string representation of a numeric type
Definition: str.h:33