cvsuser 06/02/07 06:34:10
Modified: App-WorkQueue/lib/App/WorkQueue Repository.pm
Log:
fixed print methods
Revision Changes Path
1.3 +13 -8 p5ee/App-WorkQueue/lib/App/WorkQueue/Repository.pm
Index: Repository.pm
===================================================================
RCS file: /cvs/public/p5ee/App-WorkQueue/lib/App/WorkQueue/Repository.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Repository.pm 7 Feb 2006 13:59:32 -0000 1.2
+++ Repository.pm 7 Feb 2006 14:34:09 -0000 1.3
@@ -368,12 +368,14 @@
sub print {
&App::sub_entry if ($App::trace);
- my ($self, $fh) = @_;
+ my ($self, $fh, $no_db) = @_;
$fh = \*STDOUT if (!$fh);
print $fh "ENTRIES IN MEM:\n";
$self->_print_entries_in_mem($fh);
- print $fh "ENTRIES IN DB:\n";
- $self->_print_entries_in_db($fh);
+ if (!$no_db) {
+ print $fh "ENTRIES IN DB:\n";
+ $self->_print_entries_in_db($fh);
+ }
print $fh "CONSTRAINTS:\n";
$self->print_constraints($fh);
print $fh "STATUS COUNTS:\n";
@@ -388,7 +390,7 @@
my ($self, $fh, $format, $columns) = @_;
$fh = \*STDOUT if (!$fh);
$self->_print_entries_in_mem($fh, $format, $columns);
- $self->_print_entries_in_db($fh, $format, $columns);
+ #$self->_print_entries_in_db($fh, $format, $columns);
&App::sub_exit() if ($App::trace);
}
@@ -402,7 +404,12 @@
$self->_sort_spec_to_options(\%options);
my $rows = $db->get_rows($self->{table}, {}, $columns, \%options);
foreach my $row (@$rows) {
- print $fh " [", join("|",@$row), "]\n";
+ if ($format) {
+ printf $fh $format, @$row;
+ }
+ else {
+ print $fh " [", join("|",@$row), "]\n";
+ }
}
&App::sub_exit() if ($App::trace);
}
@@ -421,5 +428,3 @@
1;
-__END__
-