From: Andrew Ruthven Date: Sat, 8 Dec 2007 05:30:23 +0000 (+1300) Subject: Add support for my modified version of the XML for storage groups. X-Git-Tag: 0.6.0~11 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a70d34983668a913854fd91d6a5a23a13051c92b;p=mythtv-status.git Add support for my modified version of the XML for storage groups. In trac at: - http://svn.mythtv.org/trac/ticket/4278 --- diff --git a/bin/mythtv-status b/bin/mythtv-status index 1776553..df3cff7 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -226,6 +226,24 @@ my @blocks = ( } }, + # Diskspace, with storage groups and sensible XML layour. + { + 'name' => 'Total Disk Space', + 'type' => 'xpath', + 'xpath' => '//Status/MachineInfo/Storage/Group[@id="total"]', + 'protocol_version' => [ ">= 36" ], + 'xml_version' => [ "> 0" ], + 'attrs' => [ qw/total used/ ], + 'commify' => [ qw/total used/ ], + 'template' => "Total space is __total__ GB, with __used__ GB used (__percent__)", + 'format' => 'one line', + 'subs' => { + 'percent' => sub { + calc_disk_space_percentage($_[0]->{'used'}, $_[0]->{'total'}) + } + } + }, + # How many hours till the next recording. { 'name' => 'Next Recording In', @@ -454,7 +472,7 @@ sub process_xml { return unless defined $result && $result ne ''; - warn "We have the correct version of the XML protocol\n" + warn "We have the correct $vers version for $block->{'name'}\n" if $verbose; } }