/[webpac2]/trunk/lib/WebPAC/Input/ISIS.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/Input/ISIS.pm

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

revision 21 by dpavlin, Sun Jul 17 22:28:11 2005 UTC revision 251 by dpavlin, Thu Dec 15 14:12:00 2005 UTC
# Line 76  sub open { Line 76  sub open {
76          $log->logcroak("need filename") if (! $arg->{'filename'});          $log->logcroak("need filename") if (! $arg->{'filename'});
77          my $code_page = $arg->{'code_page'} || '852';          my $code_page = $arg->{'code_page'} || '852';
78    
79          $log->logdie("can't find database ",$arg->{'filename'}) unless (glob($arg->{'filename'}.'.*'));          #$log->logdie("can't find database ",$arg->{'filename'}) unless (glob($arg->{'filename'}.'.*'));
80    
81          # store data in object          # store data in object
82          $self->{'isis_code_page'} = $code_page;          $self->{'isis_code_page'} = $code_page;
# Line 181  sub open { Line 181  sub open {
181                          $log->logdie("hum? implementation missing?");                          $log->logdie("hum? implementation missing?");
182                  }                  }
183    
184                  $log->confess("record $mfn empty?") unless ($rec);                  if (! $rec) {
185                            $log->warn("record $mfn empty? skipping...");
186                            next;
187                    }
188    
189                  # store                  # store
190                  if ($self->{'low_mem'}) {                  if ($self->{'low_mem'}) {
# Line 191  sub open { Line 194  sub open {
194                  }                  }
195    
196                  # create lookup                  # create lookup
197                  $self->{'lookup'}->add( $rec ) if ($self->{'lookup'} && can($self->{'lookup'}->add));                  $self->{'lookup'}->add( $rec ) if ($rec && $self->{'lookup'});
198    
199                  $self->progress_bar($mfn,$maxmfn);                  $self->progress_bar($mfn,$maxmfn);
200    
# Line 242  sub fetch { Line 245  sub fetch {
245    
246          $self->progress_bar($mfn,$self->{'max_mfn'});          $self->progress_bar($mfn,$self->{'max_mfn'});
247    
248            my $rec;
249    
250          if ($self->{'low_mem'}) {          if ($self->{'low_mem'}) {
251                  return $self->{'db'}->get($mfn);                  $rec = $self->{'db'}->get($mfn);
252          } else {          } else {
253                  return $self->{'data'}->{$mfn};                  $rec = $self->{'data'}->{$mfn};
254          }          }
255    
256            $rec ||= 0E0;
257  }  }
258    
259  =head2 pos  =head2 pos

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

  ViewVC Help
Powered by ViewVC 1.1.26