File: encode_bitmaps.py

package info (click to toggle)
nicotine 1.2.9%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,152 kB
  • ctags: 2,358
  • sloc: python: 26,106; ansic: 312; makefile: 69; sh: 37
file content (33 lines) | stat: -rw-r--r-- 857 bytes parent folder | download
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
27
28
29
30
31
32
33
import os
import sys, string

table = [
	["away.png", "away"],
	["online.png", "online"],
	["offline.png", "offline"],
	["connect.png", "connect"],
	["disconnect.png", "disconnect"],
	["away2.png", "away2"],
	["empty.png", "empty"],
	["hilite.png", "hilite"],
	["hilite2.png", "hilite2"],
	["nicotine+.png", "nicotinen"],
	["n.png", "n"],
]
flagtable = []
for name in os.listdir(os.path.join("img", "geoip")):
	flagtable.append( (os.path.join("img", "geoip", name), 'flag_%s' % name[:2].upper()) )

outf = open(os.path.join("pynicotine","gtkgui","imagedata.py"), "w")
for image in table:
	print image[0]
	f = open(os.path.join("img", image[0]), "rb")
	d = f.read()
	f.close()
	outf.write("%s = %s\n" % (image[1], `d`))
for image in flagtable:
	print image[0]
	f = open(image[0], "rb")
	outf.write("%s = %r\n" % (image[1], f.read()))
	f.close()
outf.close()