/[webpac2]/trunk/run.pl
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/run.pl

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

revision 213 by dpavlin, Mon Dec 5 17:47:23 2005 UTC revision 251 by dpavlin, Thu Dec 15 14:12:00 2005 UTC
# Line 28  my $total_rows = 0; Line 28  my $total_rows = 0;
28    
29  while (my ($database, $db_config) = each %{ $config->{databases} }) {  while (my ($database, $db_config) = each %{ $config->{databases} }) {
30    
         my $type = lc($db_config->{input}->{type});  
   
         die "I know only how to handle input type isis, not '$type'!\n" unless ($type eq 'isis');  
   
31          my $abs_path = abs_path($0);          my $abs_path = abs_path($0);
32          $abs_path =~ s#/[^/]*$#/#;          $abs_path =~ s#/[^/]*$#/#;
33    
         my $lookup = new WebPAC::Lookup(  
                 lookup_file => $db_config->{input}->{lookup},  
         );  
   
34          my $db_path = $config->{webpac}->{db_path} . '/' . $database;          my $db_path = $config->{webpac}->{db_path} . '/' . $database;
35    
   
         my $log = $lookup->_get_logger;  
         $log->info("working on $database in $db_path");  
   
         my $path = './db/';  
   
36          my $db = new WebPAC::Store(          my $db = new WebPAC::Store(
37                  path => $db_path,                  path => $db_path,
38                    database => $database,
39                    debug => 1,
40          );          );
41    
42            my $log = $db->_get_logger;
43            $log->info("working on $database in $db_path");
44    
45          my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration");          my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration");
46          $est_config->{database} = $database;          $est_config->{database} = $database;
47    
# Line 72  while (my ($database, $db_config) = each Line 63  while (my ($database, $db_config) = each
63          }          }
64    
65          foreach my $input (@inputs) {          foreach my $input (@inputs) {
66    
67                    my $type = lc($input->{type});
68    
69                    die "I know only how to handle input type isis, not '$type'!\n" unless ($type eq 'isis');
70    
71                    my $lookup = new WebPAC::Lookup(
72                            lookup_file => $input->{lookup},
73                    );
74    
75                  $log->info("working on input $input->{path} [$input->{type}]");                  $log->info("working on input $input->{path} [$input->{type}]");
76    
77                  my $isis = new WebPAC::Input::ISIS(                  my $isis = new WebPAC::Input::ISIS(
78                          code_page => $config->{webpac}->{webpac_encoding},                          code_page => $config->{webpac}->{webpac_encoding},
79                          limit_mfn => $input->{limit},                          limit_mfn => $input->{limit},
80                            lookup => $lookup,
81                  );                  );
82    
83                  my $maxmfn = $isis->open(                  my $maxmfn = $isis->open(
# Line 84  while (my ($database, $db_config) = each Line 85  while (my ($database, $db_config) = each
85                          code_page => $input->{encoding},        # database encoding                          code_page => $input->{encoding},        # database encoding
86                  );                  );
87    
88    $log->info( Dumper($lookup->{_lookup_data}) );
89    
90                  my $n = new WebPAC::Normalize::XML(                  my $n = new WebPAC::Normalize::XML(
91                  #       filter => { 'foo' => sub { shift } },                  #       filter => { 'foo' => sub { shift } },
92                          db => $db,                          db => $db,
93                          lookup_regex => $lookup->regex,                          lookup_regex => $lookup->regex,
94                          lookup => $lookup,                          lookup => $lookup,
95                            prefix => $input->{name},
96                  );                  );
97    
98                  $n->open(                  $n->open(

Legend:
Removed from v.213  
changed lines
  Added in v.251

  ViewVC Help
Powered by ViewVC 1.1.26