MythStatusScreenlet

download MythStatusScreenlet is a Screenlet for MythTV. Inspiration is from the Mac MythTV Dashboard Widget

The MythStatus Screenlet polls the XML info page of MythTV’s backend (normally port 6544), and parses the XML information to display the status of your backend. It shows the next ten upcoming recordings, highlighting in red, any that are currently recording.

It also shows Last Guide Update status, a disk space graph, Load Average and Temperature as provided by MythTV’s XML status page.

The default theme (MePo) uses the MePo character from the Media Portal project. The MePo character was designed by Glenn Melenhorst and is used with permission. The concept of the MePo theme is from the MePo MythTV theme by zdzisekg.

I have published it on the MythStatus page on the Screenlets website. That page contains a link to gnome-look.org to download the tgz.

Please be nice, it’s my first Python App, my first ScreenLet, and first time I’ve done any rendering stuff in Cairo.

MythStatusScreenlet - ScreenShot v0.1

UPDATE5: MythStatusScreenlet v0.2.1 release
– MythTv 0.23 support

UPDATE4: MythStatusScreenlet v0.2.0 release
– MythTv 0.22 support

UPDATE3: MythStatysScreenlet v0.1.1 release
– Element placings and colours/font loaded from theme.conf
– DBus notifications on Recording Start/End
– Options defined in code, rather than XML config file since some users were having problems with it.

UPDATE2: MythStatusScreenlet v0.0.3 released.
– No longer uses xpath, so should now work in Hardy

UPDATE: MythStatusScreenlet v0.0.2 released.
– Tested on Screenlets 0.0.14
– Now supports MythTV 0.20 and 0.21 xml formats
– Better handling when backend goes away/comes back


25 thoughts on “MythStatusScreenlet

    Ravneet Singh said:
    March 4, 2008 at 04:09

    I am looking forward to this screenlet!

    Looks good!

    I hope you release it soon.

    netwolfuk said:
    March 7, 2008 at 23:08

    Hi Ravneet, thanks for your comments. The screenlet is now available on the MythStatus page on the screenlets website.

    [...] MythStatusScreenlet [...]

    Sune Mølgaard said:
    March 24, 2008 at 02:00

    Nice screenlet :-)

    However, with mythtv-0.21 it does list upcoming recordings, but no other status…

    Best regards,

    Sune

    [...] MythStatusScreenlet [...]

    netwolfuk said:
    March 24, 2008 at 13:52

    Hi Sune, thanks for the feedback. I have now fixed support for 0.21.

    I’m still running 0.20 on my backend server, so please test the latest release and let me know if you have any more problems on 0.21

    Thanks, Net Wolf.

    MythTV News » MythTV widgets for 0.21 said:
    April 2, 2008 at 06:38

    [...] The other widget is actually inspired by the first one. It is called “MythStatusScreenlet” and it is a Linux Screenlet. [...]

    mrplow said:
    April 4, 2008 at 01:41

    well I cannot get it to work, I can’t find all the dependencies it requires: cairo, pango, math, urllib, re, gobject, xml. I have python-cairo, libpango1.0-0, urllib2, python-urljr, python-gobject, python-libxml2. I’ve got screenlets 0.0.12 working on Ubuntu.

    mrplow said:
    April 4, 2008 at 02:17

    oh yah forgot my terminal output
    mrplow@mrplow-desktop:~$ screenlets-manager
    It looks like you are running gnome
    Unable to load 'MythStatus' from /home/mrplow/.screenlets/MythStatus: cannot import name xpath
    Error while loading screenlets metadata for "MythStatus".
    /home/mrplow/.config/autostart/Screenlets Daemon.desktop
    /home/mrplow/.config/autostart/screenlets-daemon.desktop
    False
    Starter already exists.
    DAEMON FOUND!
    MythStatus
    Launching Screenlet from: /home/mrplow/.screenlets/MythStatus/MythStatusScreenlet.py
    Logging output goes to: $HOME/.config/Screenlets/MythStatusScreenlet.log
    Traceback (most recent call last):
    File "/home/mrplow/.screenlets/MythStatus/MythStatusScreenlet.py", line 30, in
    from xml import xpath
    ImportError: cannot import name xpath
    Quit!

    netwolfuk said:
    April 4, 2008 at 09:58

    Hi Mr Plow. It appears I have a few xml python bits installed, but it looks like the important one is python-xml

    Firstly, running python and determining the file used by xpath.
    $ python
    >>> from xml import xpath
    >>> print xpath.__file__
    /usr/lib/python2.5/site-packages/_xmlplus/xpath/__init__.pyc

    ls -l on /usr/lib/python2.5/site-packages/_xmlplus/xpath/__init__.py reveals that is is a symlink to /usr/share/pycentral/python-xml/site-packages/_xmlplus/xpath/__init__.py

    Then determining which packages are installed.
    $ dpkg -l | grep -i xml | grep python
    ii python-libxml2 2.6.30.dfsg-2ubuntu1.1 Python bindings for the GNOME XML library
    ii python-lxml 1.3.3-1 pythonic binding for the libxml2 and libxslt
    ii python-xml 0.8.4-8ubuntu1 XML tools for Python

    Then get dpkg to list the file in the packages (I just tried them one at a time until I found it)
    $ dpkg -L python-xml | grep '/usr/share/pycentral/python-xml/site-packages/_xmlplus/xpath/__init__.py'

    So, that’s a long winded way of saying, “just install python-xml”. I’ll update the requires list.

    Thanks, Net Wolf.

    mrplow said:
    April 5, 2008 at 01:21

    doh, guess Ubuntu Hardy is messing this up
    mrplow@mrplow-desktop:~$ sudo apt-get install python-xml
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    python-xml is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
    mrplow@mrplow-desktop:~$ python
    Python 2.5.2 (r252:60911, Mar 12 2008, 13:36:25)
    [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from xml import xpath
    Traceback (most recent call last):
    File "", line 1, in
    ImportError: cannot import name xpath
    >>>

    netwolfuk said:
    April 10, 2008 at 10:22

    Hi Mr Plow, I’ve now have a Hardy VMware image installed (I am running Gutsy), so will try and look at it this weekend.

    From the limited time I spent on it last night, I see that the python-xml in Hardy installs into some “old” dir. I had a quick play around with PYTHONPATH, but had no luck. I suspect I might have to change to one of the newer xpath implementations.

    Justin said:
    April 28, 2008 at 14:35

    Any progress on xpath so far?

    Sune Mølgaard said:
    April 28, 2008 at 21:51

    Replace

    from xml import xpath
    with
    from Ft.Xml import XPath

    Replace all other appearances of
    xpath
    with
    XPath

    I think that’s all I did, but will check back if it doesn’t work. However, I now get a completely blank mythstatus screenlet except for the first short while. Might be some further updates in mythtv at work in that respect…

    Best regards and all ;-)

    netwolfuk said:
    April 28, 2008 at 23:06

    @Justin, thanks for your interest. It would appear the other implementations of xpath are much more complicated than the simple one that worked in Gutsy. I was looking at ElementTree, but had come up against a wall. Any suggestions welcomed.

    @Sune, thanks for your suggestion. I made your changes, but XPath from Ft behaves quite differently from xml.xpath. Try running screenlets-manager from an xterm to see all that’s going on. I do think it’s a python/xml problem, rather than a mythtv XML format change (I’m still running 0.20 on my backend).

    Again, any more suggestions very much welcomed.

    netwolfuk said:
    May 11, 2008 at 16:02

    I pretty much gave up on xpath/ElementTree, and have written the XML parsing using simple regular expressions. I’ve done a little bit of testing, and it seems to work in a Hardy virtual machine.

    [...] MythStatusScreenlet [...]

    Matt said:
    July 23, 2008 at 11:39

    It appears 0.0.2 is still only available from gnome-look.org website.

    Have you got another URL to grab this from?

    I’m running Hardy and 0.0.2 is pretty useless. :(

    netwolfuk said:
    July 23, 2008 at 14:12

    Hi Matt, I just downloaded it from Gnome Look, and it is 0.0.3, and there is a VERSION-0.0.3 file inside the tgz.
    However, I did notice that in the actual code is still says 0.0.2, so will fix that when I get my dev machine back up and running (although it shouldn’t really matter).
    I’ll find somewhere else to host it if you find that you’re getting an old version from Gnome Look.

    [...] MythStatusScreenlet [...]

      cross157 said:
      April 3, 2010 at 22:05

      Hi netwolkuk, I love this screenlet. Any chance of another update? If I knew the first thing about coding I’d give it a shot, but I don’t :-( Thanks

    Jan said:
    April 12, 2012 at 07:25

    Please MythTV 0.25 ;-)

      netwolfuk responded:
      April 12, 2012 at 08:14

      Hi Jan. Can you email me the xml output from the status port? My email address is in the python script.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s