r1413@llin: dpavlin | 2007-10-31 13:13:58 +0100
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 31 Oct 2007 12:14:03 +0000 (12:14 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 31 Oct 2007 12:14:03 +0000 (12:14 +0000)
 Add input name to all output filters

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@936 07558da8-63fa-0310-ba24-9fe276d99e06

lib/WebPAC/Output/Webpacus.pm
run.pl

index 088cf9f..1ec64d3 100644 (file)
@@ -7,6 +7,7 @@ use base qw/WebPAC::Common WebPAC::Output Class::Accessor/;
 __PACKAGE__->mk_accessors(qw(
        path
        database
+       input
 ));
 
 use File::Path;
diff --git a/run.pl b/run.pl
index 07f8eeb..c974a5c 100755 (executable)
--- a/run.pl
+++ b/run.pl
@@ -318,7 +318,8 @@ warn '## output = ',dump( $output );
        
                $log->debug("loading output module $module");
                eval "require $module";
-       
+
+               # add database to arugemnts for output filter
                $output->{database} = $database;
 
                $log->debug("calling $module->new(",dump( $output ),")");
@@ -508,6 +509,16 @@ warn '## output = ',dump( $output );
                }
 
 
+               # setup input name for all output filters
+               foreach my $out ( @output_modules ) {
+                       if ( $out->can('input') ) {
+                               $out->input( $input_name );
+                       } else {
+                               $log->warn("output filter $out doesn't support input name");
+                       }
+               }
+
+
                foreach my $pos ( 0 ... $input_db->size ) {
 
                        my $row = $input_db->fetch || next;