/[webpac2]/trunk/lib/WebPAC/Output/Estraier.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Output/Estraier.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1130 by dpavlin, Mon Sep 3 15:26:46 2007 UTC revision 1131 by dpavlin, Tue Apr 21 21:06:30 2009 UTC
# Line 11  use Data::Dump qw/dump/; Line 11  use Data::Dump qw/dump/;
11  use LWP;  use LWP;
12  use URI::Escape;  use URI::Escape;
13  use List::Util qw/first/;  use List::Util qw/first/;
14    use YAML;
15    
16  =head1 NAME  =head1 NAME
17    
# Line 119  sub new { Line 120  sub new {
120                  $log->debug("opening index $self->{url}");                  $log->debug("opening index $self->{url}");
121          }          }
122    
123            $self->{stats} = {};
124    
125          $self ? return $self : return undef;          $self ? return $self : return undef;
126  }  }
127    
# Line 188  sub add { Line 191  sub add {
191    
192                  $doc->add_attr( $tag, $vals );                  $doc->add_attr( $tag, $vals );
193                  $doc->add_hidden_text( $vals );                  $doc->add_hidden_text( $vals );
194    
195                    $self->{stats}->{attr}->{$tag}++;
196          }          }
197    
198          my $text = $args->{'text'};          my $text = $args->{'text'};
# Line 279  sub convert { Line 284  sub convert {
284          return $text;          return $text;
285  }  }
286    
287    =head2 finish
288    
289    Dump attributes used on disk
290    
291    =cut
292    
293    sub finish {
294            my $self = shift;
295            my $log = $self->_get_logger();
296    
297            my $path = 'var/estraier/' . $self->{database} . '.yaml';
298            YAML::DumpFile( $path, $self->{stats} );
299            $log->info("created  $path ", -s $path, " bytes");
300            $log->debug( dump( $self->{stats} ) );
301    }
302    
303  =head1 AUTHOR  =head1 AUTHOR
304    
305  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>

Legend:
Removed from v.1130  
changed lines
  Added in v.1131

  ViewVC Help
Powered by ViewVC 1.1.26