From 19002d6e8c5b2d078ad821d15acfdad91863df0f Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 27 Nov 2007 23:54:45 +0000 Subject: [PATCH 1/1] r1674@llin: dpavlin | 2007-11-28 00:54:47 +0100 - final tweaks to WebPAC::Output::Excel - version bump [2.34] git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1070 07558da8-63fa-0310-ba24-9fe276d99e06 --- Makefile.PL | 2 +- TODO | 2 +- conf/llin.yml | 2 +- conf/log.conf | 2 +- lib/WebPAC/Output/Excel.pm | 9 +++++++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index ae09ada..2589ce7 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -5,7 +5,7 @@ use inc::Module::Install; name 'WebPAC'; -version '2.34_1'; +version '2.34'; license 'GPL'; requires 'YAML'; diff --git a/TODO b/TODO index 9ed6939..ba22b40 100644 --- a/TODO +++ b/TODO @@ -50,7 +50,7 @@ + validator don't accept 0 as valid subfield + subroutines gets mungled in normalization files [2.33] + fix marc_template hadling of field value 0 -- csv/excel output conf/normalize/csv_ff-peri.pl ++ csv/excel output conf/normalize/csv_ff-peri.pl [2.34] - rewrite WebPAC::Input to be based on Module::Pluggable - check usage of config in normalize file (database, input name?) - load_ds/save_ds should use on-disk hash to preserve inodes diff --git a/conf/llin.yml b/conf/llin.yml index 1429de7..6184fee 100644 --- a/conf/llin.yml +++ b/conf/llin.yml @@ -411,7 +411,7 @@ databases: path: '/data/isis_data/ffps-peri/PERI' # encoding: 'cp852' normalize: - path: 'conf/normalize/common.pl' + path: 'conf/normalize/csv_ff-peri.pl' output: - module: 'Excel' path: 'out/peri.xls' diff --git a/conf/log.conf b/conf/log.conf index 0237883..b171d49 100644 --- a/conf/log.conf +++ b/conf/log.conf @@ -54,7 +54,7 @@ log4perl.logger.WebPAC.Input.PDF=DEBUG #log4perl.logger.WebPAC.Output.KinoSearch=DEBUG #log4perl.logger.WebPAC.Output.Webpacus=DEBUG log4perl.logger.WebPAC.Output.Jifty=DEBUG -log4perl.logger.WebPAC.Output.Excel=DEBUG +#log4perl.logger.WebPAC.Output.Excel=DEBUG #log4perl.logger.WebPAC.Search.Estraier=DEBUG diff --git a/lib/WebPAC/Output/Excel.pm b/lib/WebPAC/Output/Excel.pm index d422746..b0d6ec0 100644 --- a/lib/WebPAC/Output/Excel.pm +++ b/lib/WebPAC/Output/Excel.pm @@ -106,7 +106,7 @@ sub add { my $cols = 0; - my $hash = $self->ds_to_hash( $ds, $self->filter, disable_key_mungle => 1 ); + my $hash = $self->ds_to_hash( $ds, $self->filter, disable_key_mungle => 1, single_values => 1 ); $log->debug("hash from ",$self->filter," = ", sub { dump( $hash ) }); my $worksheet = $self->worksheet || $log->logconfess("no worksheet?"); @@ -134,9 +134,14 @@ sub finish { my $log = $self->_get_logger(); + my $path = $self->path; + $self->workbook->close() || - $log->logdie("can't close Excel file ", $self->path, ": $!"); + $log->logdie("can't close Excel file $path: $!"); + + $log->info("created $path ", -s $path, " bytes with ", $self->line, " rows"); + return $self->line; } =head1 AUTHOR -- 2.20.1