initial commit of file from CVS for smeserver-hwinfo on Sat Sep 7 20:27:43 AEST 2024
This commit is contained in:
0
root/usr/lib/.gitignore
vendored
Normal file
0
root/usr/lib/.gitignore
vendored
Normal file
80
root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/hwinfo.pm
Executable file
80
root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/hwinfo.pm
Executable 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;
|
Reference in New Issue
Block a user