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 # SID:NS:TSID:ONID:STYPE:UNUSED(channelnumber in enigma1)
23 # REFTYPE:FLAGS:STYPE:SID:TSID:ONID:NS:PARENT_SID:PARENT_TSID:UNUSED
26 refstr = "1:0:%X:%X:%X:%X:%X:0:0:0" % (ref[4], ref[0], ref[2], ref[3], ref[1])
27 refstr = refstr.replace(':', '_')
29 filename = name + ".png"
30 linkname = refstr + ".png"
32 if os.access(filename, os.F_OK) and not os.access(linkname, os.F_OK):
33 os.symlink(filename, linkname)
35 print "could not find PNG for %s" % name