initial commit of file from CVS for smeserver-hwinfo on Sat Sep 7 20:27:43 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:27:43 +10:00
parent 71ad1be047
commit 9e18f2025a
44 changed files with 1616 additions and 2 deletions

0
root/usr/lib/.gitignore vendored Normal file
View File

View File

@@ -0,0 +1,80 @@
package esmith::FormMagick::Panel::hwinfo;
use strict;
use Exporter;
use Carp;
use esmith::FormMagick;
our @ISA = qw(esmith::FormMagick Exporter);
our @EXPORT = qw( print_page );
=pod
=head1 NAME
esmith::FormMagick::Panels::hwinfo - useful panel functions
=head1 SYNOPSIS
use esmith::FormMagick::Panels::hwinfo;
my $panel = esmith::FormMagick::Panel::hwinfo->new();
$panel->display();
=head1 DESCRIPTION
=cut
# {{{ new
=head2 new();
Exactly as for esmith::FormMagick
=begin testing
use_ok('esmith::FormMagick::Panel::hwinfo');
use vars qw($panel);
ok($panel = esmith::FormMagick::Panel::info->new(), "Create panel object");
isa_ok($panel, 'esmith::FormMagick::Panel::hwinfo');
=end testing
=cut
sub new {
shift;
my $self = esmith::FormMagick->new();
$self->{calling_package} = (caller)[0];
bless $self;
return $self;
}
# }}}
=head2 print_page
output the body part of the html page generated by lshw
=cut
sub print_page {
my $self = shift;
my $body = 0;
foreach (`/usr/sbin/lshw -html`)
{
if (/<body>/) {$body=1; next}
next if ($body == 0);
last if (/<\/body>/);
print $_;
}
}
1;