A Gear With Properties
package SprogEx::Gear::LogByStatus;
=begin sprog-gear-metadata
title: Log By Status
type_in: P
type_out: P
=end sprog-gear-metadata
=cut
use base qw(Sprog::Gear Sprog::Mixin::InputByLine);
__PACKAGE__->declare_properties(
status => '404',
);
sub line {
my($self, $text) = @_;
my $status = $self->status or return;
return unless $text =~ /.*?\] ".*?" $status/;
$self->msg_out( data => $text );
}
sub dialog_xml {
#return 'file:/home/grant/projects/sprog/glade/logbystatus.glade';
return <<'END_XML';
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM
"http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
... chunk of XML here ...
</glade-interface>
END_XML
}