[mythtv-users] NEW version of mythalsig (channel logo grabber utility for lyngsat)

David Linville dlinvill+mythtv at networksdown.com
Wed Apr 19 03:54:04 UTC 2006


Stephen Boddy wrote:
> S'Okay I just like the warm fuzzy feeling when I do something that someone 
> finds useful. I can wait for my praise ;-)
>   

Good job!  I ran it on the us and us-tx regions.

On the Knoppmyth R5B7 the heapq.nlargest call gives an error because 
python is version 2.3 and that was added in 2.4.  I replaced the call 
with the definition of heapq.nlargest I found in the python 2.5 source 
code.   I don't know python so I didn't take the time to trace through 
this and see if it was optimal but it did give me "fuzzy" results on 
python 2.3.

I also needed to manually install the python2.3-mysqldb package from 
Debian stable.  I used python2.3-mysqldb_1.2.1c2-1_i386.deb.  Anything 
more recent wanted a libc upgrade.

61c61
< import MySQLdb, difflib, heapq,itertools
---
 > import MySQLdb, difflib, heapq
165,178c165
<       it = iter(uniq_results)
<       results = list(itertools.islice(it, n))
<       if not results:
<               return results
<       heapq.heapify(results)
<       sol = results[0]         # sol --> smallest of the nlargest
<       for elem in it:
<               if elem <= sol:
<                       continue
<               heapq.heapreplace(results, elem)
<               sol = results[0]
<       results.sort()
<       results.reverse()
<       #results = heapq.nlargest(n, uniq_results)
---
 >         results = heapq.nlargest(n, uniq_results)

The -c channel id option didn't work well because I ended up with most 
entries something like "[lyngsat]/xx/whatever.jpg" instead of the actual 
URL.    Three icons did actually have the correct URL.  I didn't bother 
to trouble shoot since the regular mode seemed to work.

I'm still a bit confused about the following options:
"a" to start autospeed
"p" to select preset list entry

Once I made those changes './mythalsig.py -r us,us-tx' gave me the right 
db entries and once I copied the files I had my logos for both local and 
national cable stations.
Much more complete than with mkiconmap.pl.

---
David Linville





More information about the mythtv-users mailing list