[mythtv-users] Gnome Panel Myth TV status indicator

Douglas Peale Douglas_Peale at comcast.net
Fri Oct 8 20:47:28 UTC 2010


On 10/06/2010 04:14 PM, Douglas Peale wrote:
> I wrote a very simple Gnome Panel status indicator that displays the number of currently recording tuners on a mythTV system.
> 
> This is my first Python application, and as such I probably did a bunch of stuff wrong. It does work however.
> 
> I wrote this because I was continually interrupting recordings by not noticing that the backend was recording something, and
> updating the system.
> 
> I would appreciate it if you would tell me if you notice I did something wrong, or if there is a better way to implement this.
> 

I found a bug in the original. mythstatus.py would crash if mythbackend was shut down for any reason. It gets shut down whenever
the backend gets updated, and it gets shutdown whenever mythtvsetup is run.

To fix this, I open the link to the backend and do all of the access to mythbackend in a try statement. if it fails, I replace
the count of the number of current recordings with an 'X', close any existing connection to the backend, and attempt to
re-establish the connection on the next update.

So, now the program shows two things: it shows if the backend can be accessed, and if it can be accessed, how many tuners are
currently recording.

Now to learn about tool tips.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mythstatus.py
Type: text/x-python
Size: 2482 bytes
Desc: not available
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20101008/bf5b6445/attachment-0001.py>


More information about the mythtv-users mailing list