diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2007-09-26 20:33:11 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2007-09-26 20:33:11 +0000 |
| commit | d07d6fd037b2b1bc54717c3f32537c63be1cae7f (patch) | |
| tree | f0f9061ec4dca052571efd74e960b7634b3adff4 /tools | |
| parent | 35f4d6b50c5e8c79e57dea6e9ad9403b5ab6fdd5 (diff) | |
| download | enigma2-d07d6fd037b2b1bc54717c3f32537c63be1cae7f.tar.gz enigma2-d07d6fd037b2b1bc54717c3f32537c63be1cae7f.zip | |
add create_picon_links tool
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/create_picon_links.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/create_picon_links.py b/tools/create_picon_links.py new file mode 100644 index 00000000..a093ef78 --- /dev/null +++ b/tools/create_picon_links.py @@ -0,0 +1,30 @@ +# +# create links for picon +# usage: create_picon_links lamedb +# run in picon directory. +# It will read the servicenames from the lamedb and create symlinks +# for the servicereference names. + +import os, sys + +f = open(sys.argv[1]).readlines() + +f = f[f.index("services\n")+1:-3] + +while len(f): + ref = [int(x, 0x10) for x in f[0][:-1].split(':')] + name = f[1][:-1] + + name = name.replace('\xc2\x87', '').replace('\xc2\x86', '') + + refstr = "1:0:%d:%X:%X:%d:%X:%d:0:0" % (ref[4], ref[0], ref[2], ref[3], ref[1], ref[5]) + refstr = refstr.replace(':', '_') + + filename = name + ".png" + linkname = refstr + ".png" + + if os.access(filename, os.F_OK) and not os.access(linkname, os.F_OK): + os.symlink(filename, linkname) + else: + print "could not find PNG for %s" % name + f =f[3:] |
