2 # create links for picon
3 # usage: create_picon_links lamedb
4 # run in picon directory.
5 # It will read the servicenames from the lamedb and create symlinks
6 # for the servicereference names.
10 f = open(sys.argv[1]).readlines()
12 f = f[f.index("services\n")+1:-3]
15 ref = [int(x, 0x10) for x in f[0][:-1].split(':')]
18 name = name.replace('\xc2\x87', '').replace('\xc2\x86', '')
20 refstr = "1:0:%d:%X:%X:%X:%X:%d:0:0" % (ref[4], ref[0], ref[2], ref[3], ref[1], ref[5])
21 refstr = refstr.replace(':', '_')
23 filename = name + ".png"
24 linkname = refstr + ".png"
26 if os.access(filename, os.F_OK) and not os.access(linkname, os.F_OK):
27 os.symlink(filename, linkname)
29 print "could not find PNG for %s" % name