r24423 - in /branches/upstream/libdata-report-perl/current: Build.PL Changes MANIFEST META.yml lib/Data/Report.pm lib/Data/Report/Plugin/Csv.pm lib/Data/Report/Plugin/Html.pm lib/Data/Report/Plugin/Text.pm t/02html03.t

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Wed Aug 20 08:55:15 UTC 2008


Author: angelabad-guest
Date: Wed Aug 20 08:55:10 2008
New Revision: 24423

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=24423
Log:
[svn-upgrade] Integrating new upstream version, libdata-report-perl (0.10)

Added:
    branches/upstream/libdata-report-perl/current/t/02html03.t
Modified:
    branches/upstream/libdata-report-perl/current/Build.PL
    branches/upstream/libdata-report-perl/current/Changes
    branches/upstream/libdata-report-perl/current/MANIFEST
    branches/upstream/libdata-report-perl/current/META.yml
    branches/upstream/libdata-report-perl/current/lib/Data/Report.pm
    branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Csv.pm
    branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Html.pm
    branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Text.pm

Modified: branches/upstream/libdata-report-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-report-perl/current/Build.PL?rev=24423&op=diff
==============================================================================
--- branches/upstream/libdata-report-perl/current/Build.PL (original)
+++ branches/upstream/libdata-report-perl/current/Build.PL Wed Aug 20 08:55:10 2008
@@ -1,4 +1,4 @@
-# $Id: Build.PL,v 1.4 2008/08/07 14:50:31 jv Exp $
+# $Id: Build.PL,v 1.5 2008/08/07 20:20:03 jv Exp $
 
 use strict;
 use Module::Build 0.28;

Modified: branches/upstream/libdata-report-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-report-perl/current/Changes?rev=24423&op=diff
==============================================================================
--- branches/upstream/libdata-report-perl/current/Changes (original)
+++ branches/upstream/libdata-report-perl/current/Changes Wed Aug 20 08:55:10 2008
@@ -1,13 +1,21 @@
 Revision history for Data-Report
 
-0.09	2008-08-06
+0.10	2008-08-18
+
+	Add column property 'class' for HTML plugin. Can be used to
+	supply a different class from the default h_XXX and c_XXX.
+
+	The special row for headings has been changed from "head" to
+	"_head" to avoid conlicts with ordinary row styles.
+
+0.09	2008-08-07 22:16
 
 	Add column property 'ignore'. Does what the name implies.
 	This change was suggested by Mário Silva.
 
 	Upgrade requirements for Text::CSV to 1.00.
 
-0.08	2008-08-06 14:27
+0.08	2008-08-07 14:27
 
 	Allow handling of Latin texts with CSV plugin and Text::CSV_XS.
 	This change was suggested by Mário Silva.

Modified: branches/upstream/libdata-report-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-report-perl/current/MANIFEST?rev=24423&op=diff
==============================================================================
--- branches/upstream/libdata-report-perl/current/MANIFEST (original)
+++ branches/upstream/libdata-report-perl/current/MANIFEST Wed Aug 20 08:55:10 2008
@@ -20,6 +20,7 @@
 t/01text07.t
 t/02html01.t
 t/02html02.t
+t/02html03.t
 t/03csv01.t
 t/03csv02.t
 t/03csv03.t

Modified: branches/upstream/libdata-report-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-report-perl/current/META.yml?rev=24423&op=diff
==============================================================================
--- branches/upstream/libdata-report-perl/current/META.yml (original)
+++ branches/upstream/libdata-report-perl/current/META.yml Wed Aug 20 08:55:10 2008
@@ -1,6 +1,6 @@
 ---
 name: Data-Report
-version: 0.09
+version: 0.10
 author:
   - 'Johan Vromans <jvromans at squirrel.nl>'
 abstract: Framework for flexible reporting
@@ -15,7 +15,7 @@
 provides:
   Data::Report:
     file: lib/Data/Report.pm
-    version: 0.09
+    version: 0.10
   Data::Report::Base:
     file: lib/Data/Report/Base.pm
   Data::Report::Plugin::Csv:

Modified: branches/upstream/libdata-report-perl/current/lib/Data/Report.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-report-perl/current/lib/Data/Report.pm?rev=24423&op=diff
==============================================================================
--- branches/upstream/libdata-report-perl/current/lib/Data/Report.pm (original)
+++ branches/upstream/libdata-report-perl/current/lib/Data/Report.pm Wed Aug 20 08:55:10 2008
@@ -1,10 +1,10 @@
 # Data::Reporter.pm -- Framework for flexible reporting
-# RCS Info        : $Id: Report.pm,v 1.15 2008/08/07 20:05:00 jv Exp $
+# RCS Info        : $Id: Report.pm,v 1.17 2008/08/18 09:51:23 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Wed Dec 28 13:18:40 2005
 # Last Modified By: Johan Vromans
-# Last Modified On: Thu Aug  7 22:02:59 2008
-# Update Count    : 260
+# Last Modified On: Mon Aug 18 11:52:01 2008
+# Update Count    : 265
 # Status          : Unknown, Use with caution!
 
 package Data::Report;
@@ -15,7 +15,7 @@
 
 =cut
 
-$VERSION = 0.09;
+$VERSION = "0.10";
 
 =head1 SYNOPSIS
 
@@ -321,7 +321,8 @@
 When used, the stylist should be a reference to a possibly anonymous
 subroutine with three arguments: the reporter object, the style of a
 row (as specified with C<_style> in the C<add> method), and the name
-of a column as defined in the layout.
+of a column as defined in the layout. For table headings, the row name
+C<_head> is used.
 
 The stylist routine will be repeatedly called by the reporter to
 obtain formatting properties for rows and cells. It should return
@@ -410,7 +411,13 @@
 
 (All) Ignore this column. Note that to prevent surprising results, the
 column must be ignored in all applicable styles, including the special
-style C<"head"> that controls the heading.
+style C<"_head"> that controls the heading.
+
+=item C<class>
+
+(Html) Class name to be used for this cell. Default class name is
+"h_CNAME" for table headings and "c_CNAME" for table rows, where CNAME
+is the name of the column.
 
 =back
 

Modified: branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Csv.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Csv.pm?rev=24423&op=diff
==============================================================================
--- branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Csv.pm (original)
+++ branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Csv.pm Wed Aug 20 08:55:10 2008
@@ -1,10 +1,10 @@
 # Data::Report::Plugin::Csv.pm -- CSV plugin for Data::Report
-# RCS Info        : $Id: Csv.pm,v 1.8 2008/08/07 20:05:00 jv Exp $
+# RCS Info        : $Id: Csv.pm,v 1.9 2008/08/18 09:51:23 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Thu Jan  5 18:47:37 2006
 # Last Modified By: Johan Vromans
-# Last Modified On: Thu Aug  7 19:57:28 2008
-# Update Count    : 118
+# Last Modified On: Mon Aug 18 11:45:48 2008
+# Update Count    : 119
 # Status          : Unknown, Use with caution!
 
 package Data::Report::Plugin::Csv;
@@ -77,7 +77,7 @@
 		       $_->{title}
 		   }
 		   grep {
-		       my $t = $self->_getstyle("head", $_->{name});
+		       my $t = $self->_getstyle("_head", $_->{name});
 		       ! $t->{ignore};
 		   }
 		   @{$self->_get_fields}),

Modified: branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Html.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Html.pm?rev=24423&op=diff
==============================================================================
--- branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Html.pm (original)
+++ branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Html.pm Wed Aug 20 08:55:10 2008
@@ -1,10 +1,10 @@
 # Data::Report::Plugin::Html.pm -- HTML plugin for Data::Report
-# RCS Info        : $Id: Html.pm,v 1.7 2008/08/07 20:05:00 jv Exp $
+# RCS Info        : $Id: Html.pm,v 1.8 2008/08/18 09:51:23 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Thu Dec 29 15:46:47 2005
 # Last Modified By: Johan Vromans
-# Last Modified On: Thu Aug  7 17:13:11 2008
-# Update Count    : 80
+# Last Modified On: Mon Aug 18 11:45:39 2008
+# Update Count    : 83
 # Status          : Unknown, Use with caution!
 
 package Data::Report::Plugin::Html;
@@ -64,8 +64,10 @@
 	my $t = $self->_getstyle($style, $fname);
 	next if $t->{ignore};
 
+	my $class = $t->{class} || "c_$fname";
+
 	$self->_print("<td ", _align($col->{align}),
-		      "class=\"c_$fname\">",
+		      "class=\"$class\">",
 		      $value eq ""
 		      ? "&nbsp;"
 		      : $t->{raw_html}
@@ -89,11 +91,13 @@
     foreach ( @{$self->_get_fields} ) {
 
 	# Examine style mods.
-	my $t = $self->_getstyle("head", $_->{name});
+	my $t = $self->_getstyle("_head", $_->{name});
 	next if $t->{ignore};
 
+	my $class = $t->{class} || "h_" . $_->{name};
+
 	$self->_print("<th ", _align($_->{align}),
-		      "class=\"h_", $_->{name}, "\">",
+		      "class=\"$class\">",
 		      $self->_html($_->{title}), "</th>\n");
     }
     $self->_print("</tr>\n");

Modified: branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Text.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Text.pm?rev=24423&op=diff
==============================================================================
--- branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Text.pm (original)
+++ branches/upstream/libdata-report-perl/current/lib/Data/Report/Plugin/Text.pm Wed Aug 20 08:55:10 2008
@@ -1,10 +1,10 @@
 # Data::Report::Plugin::Text.pm -- Text plugin for Data::Report
-# RCS Info        : $Id: Text.pm,v 1.9 2008/08/07 20:05:00 jv Exp $
+# RCS Info        : $Id: Text.pm,v 1.10 2008/08/18 09:51:23 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Wed Dec 28 13:21:11 2005
 # Last Modified By: Johan Vromans
-# Last Modified On: Thu Aug  7 21:49:33 2008
-# Update Count    : 147
+# Last Modified On: Mon Aug 18 11:46:04 2008
+# Update Count    : 149
 # Status          : Unknown, Use with caution!
 
 package Data::Report::Plugin::Text;
@@ -178,7 +178,7 @@
     my $t = sprintf($self->{format},
 		    map { $_->{title} }
 		    grep {
-			my $t = $self->_getstyle("head", $_->{name});
+			my $t = $self->_getstyle("_head", $_->{name});
 			! $t->{ignore};
 		    }
 		    @{$self->_get_fields});
@@ -219,7 +219,7 @@
 
     foreach my $a ( @{$self->_get_fields} ) {
 
-	my $t = $self->_getstyle("head", $a->{name});
+	my $t = $self->_getstyle("_head", $a->{name});
 	next if $t->{ignore};
 
 	# Never mind the trailing blanks -- we'll trim anyway.

Added: branches/upstream/libdata-report-perl/current/t/02html03.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-report-perl/current/t/02html03.t?rev=24423&op=file
==============================================================================
--- branches/upstream/libdata-report-perl/current/t/02html03.t (added)
+++ branches/upstream/libdata-report-perl/current/t/02html03.t Wed Aug 20 08:55:10 2008
@@ -1,0 +1,64 @@
+#! perl
+
+use strict;
+use warnings;
+use Test::More qw(no_plan);
+
+use Data::Report;
+
+my $out = "";
+
+my $rep = Data::Report::->create
+  (type => "html",
+   layout => [ { name => "acct", title => "Acct",   width => 6  },
+	       { name => "desc", title => "Report", width => 40, align => "|" },
+	       { name => "deb",  title => "Debet",  width => 10, align => "<" },
+	       { name => "crd",  title => "Credit", width => 10, align => ">" },
+	     ],
+  );
+
+$rep->set_stylist( sub {
+		       my ($rep, $row, $col) = @_;
+		       return unless $col;
+
+		       return { class => "bar" }
+			 if $row && $row eq "_head" && $col && $col eq "deb";
+		       return { class => "foo" }
+			 if $col eq "deb";
+		       return;
+		   } );
+
+$rep->set_output(\$out);
+$rep->start;
+$rep->add({ acct => "one", desc => "two", deb => "three", crd => "four" });
+$rep->add({ acct => "one", desc => "two", deb => "three", crd => "four", _style => "xyz" });
+$rep->finish;
+$rep->close;
+
+my $ref; { undef $/; $ref = <DATA> }
+$ref =~ s/[\r\n]/\n/g;
+$out =~ s/[\r\n]/\n/g;
+
+is($out, $ref);
+
+__DATA__
+<table class="main">
+<tr class="head">
+<th align="left" class="h_acct">Acct</th>
+<th align="center" class="h_desc">Report</th>
+<th align="left" class="bar">Debet</th>
+<th align="right" class="h_crd">Credit</th>
+</tr>
+<tr>
+<td align="left" class="c_acct">one</td>
+<td align="center" class="c_desc">two</td>
+<td align="left" class="foo">three</td>
+<td align="right" class="c_crd">four</td>
+</tr>
+<tr class="r_xyz">
+<td align="left" class="c_acct">one</td>
+<td align="center" class="c_desc">two</td>
+<td align="left" class="foo">three</td>
+<td align="right" class="c_crd">four</td>
+</tr>
+</table>




More information about the Pkg-perl-cvs-commits mailing list