File: mkicons

package info (click to toggle)
python-mpld3 0.3git%2B20140910dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,808 kB
  • ctags: 1,095
  • sloc: python: 3,595; makefile: 187
file content (13 lines) | stat: -rwxr-xr-x 399 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python

import base64

print 'mpld3.icons = {'
for icon in [('reset', 'icons/home.png'),
             ('move', 'icons/move.png'),
             ('zoom', 'icons/zoom.png'),
             ('brush', 'icons/brush.png')]:
    with open(icon[1]) as _f:
        print('    %s: "data:image/png;base64,%s",'
              % (icon[0], base64.encodestring(_f.read()).replace('\n', '\\n')))
print '};'